http://stackoverflow.com/q/29849666
has answer: http://stackoverflow.com/a/60225146
type: Question
linked to: http://stackoverflow.com/q/23251488
score: 10
has body: I'm using bootstrap on a site, and using the following code on load to turn my select boxes into select2 dropdowns $("select").select2(); However when any page with a select dropdown loads, there's a brief delay where the original can be seen before the select2 replacement is drawn in. This is quite jarring as elements of the forms on my pages move around. Is there a way to generate the select2 HTML in my backend (ASP MVC3) and write it out to the page in such a way that the select2 plugin will still hook up all the behaviours correctly?
tagged with: javascript
tagged with: jquery
has title: Counteract a bootstrap / select2 rendering delay?
has comment: http://stackoverflow.com/comment/47833079
has answer: http://stackoverflow.com/a/29850577
downvote count: 0
has answer: http://stackoverflow.com/a/59152595
favorite count: 0
tagged with: jquery-select2
has answer: http://stackoverflow.com/a/30236417
tagged with: twitter-bootstrap
answer count: 5
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47825566
has answer: http://stackoverflow.com/a/70250132
tagged with: asp.net-mvc-3
upvote count: 10

http://stackoverflow.com/comment/47995091
has text: @RoryMcCrossan There's a problem, if any of the ""inputs" is not empty: " if ($(input).val() == ''){", it doesn't return false. I don't want it proceeding if any of the input fields in the "validate_g" class is empty.
comment on: http://stackoverflow.com/q/29936168
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47826310
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29849959
has text: But if i access `__proto__` on my `car`-object i can see the specific methods on that object, and if i look into the next `__proto__` i can see the `Vehicle`-object. How come i cannot fetch their names that way?
score: 0

http://stackoverflow.com/a/29860551
has body: The jQuery Validate plugin automatically creates and toggles an error message element. You can specify the type of element, such as div, label, etc. using the errorElement option. Default is label. You can specify the placement of this error message element, such as before, after, inside a parent, etc. using various jQuery methods inside the errorPlacement option. Default is "after" the input element. However, you cannot easily wrap the error message element around the input element. While it's possible to use jQuery to do this within the errorPlacement option, the problem occurs when the error needs to be cleared. The plugin will automatically remove/hide the error message element when the message needs to be cleared and your input element will be removed/hidden along with it. The solution would be to create the outer div yourself and use the highlight and unhighlight options to toggle the error class on this outer div. You'll have to remember to also include the default code within highlight and unhighlight or the default behavior will be broken. Since your desired class is the default error class, you can simply use the errorClass argument within the highlight and unhighlight options. Your HTML: Your .validate() method: $('#yourForm').validate({ // rules and options, errorPlacement: function(error, element) { error.insertBefore(element); }, highlight: function(element, errorClass, validClass) { $(element).addClass(errorClass).removeClass(validClass); // <- default behavior $(element).parent('div').addClass(errorClass); // <- add error class to your parent div }, unhighlight: function(element, errorClass, validClass) { $(element).removeClass(errorClass).addClass(validClass); // <- default behavior $(element).parent('div').removeClass(errorClass); // <- remove error class from your parent div } }); The end result in the DOM during a validation error: This field is required.
type: AcceptedAnswer
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/29857269
answers question: http://stackoverflow.com/q/29857269
upvote count: 3
score: 3

http://stackoverflow.com/q/29993882
has body: I'm using the Google Analytics Management API to get a list of the user's profiles. Using the analytics.management.profiles.list endpoint I can get a lot of information about a user's profiles, but what I really want is a url to the page they would get if they signed into Google Analytics themselves and clicked on the profile from there. Is there a way to get this url? Previously, I was faking it with this url: https://www.google.com/analytics/web/?authuser=3#report/visitors-overview/a{ACCOUNT ID}w{WEB PROPERTY ID}p{PROFILE ID}/ All the ids in curly braces were numbers that I just happened to notice match up with a profile's account, web property, and profile IDs. But I soon found that the authuser=3 part is specific to me; it refers to which of my several Google accounts I am accessing this page through. So is there a way to generate a url like that which works for anyone who is authenticated and has access to the profile they want to get to? As a disclaimer, I do not use Google Analytics myself and I don't have anything more than a superficial understanding of it, so please provide links and explain jargon if you can.
tagged with: javascript
answer count: 1
tagged with: python
favorite count: 0
type: UnansweredQuestion
tagged with: google-api
score: 2
tagged with: google-analytics
downvote count: 0
has title: Get view/profile page url from Google Analytics API
type: Question
has answer: http://stackoverflow.com/a/66544880
upvote count: 2
tagged with: api

http://stackoverflow.com/comment/48084200
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29981401
has text: Product or products?

http://stackoverflow.com/comment/47985260
type: Comment
has text: it bl***y worked though didn't it !!! legend !!! ....... why no dots then is that just a jquery derivation ?
comment on: http://stackoverflow.com/a/29931406
score: 0
type: AnswerComment

http://stackoverflow.com/comment/48146739
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29969523
has text: Any luck with that approach?

http://stackoverflow.com/a/29908013
accepted answer of: http://stackoverflow.com/q/29867234
answers question: http://stackoverflow.com/q/29867234
has body: The short answer is no, config.js lives only on the server. The sample app you mentioned is written using Node.js (which is a server-side javascript run-time) using the Express framework. By default, you should assume every file lives on the server (unless it is explicitly exposed). For the sample app, anything in the /public/ directory (which contains a simple .css stylesheet) is exposed to the client. This is exposed by app.js on line 29: app.use(express.static(path.join(__dirname, 'public'))); You can find the full code sample for the tutorial you mentioned on github: https://github.com/Azure/azure-documentdb-node/tree/master/tutorial/todo
upvote count: 1
type: AcceptedAnswer
type: Answer
downvote count: 0
score: 1

http://stackoverflow.com/comment/47990365
type: QuestionComment
has text: @ArunPJohny That was my mistake on the fiddle but in my app it is called as other logs are executed and code ran. as for the `async: false` option, that was because my App can't really proceed until the data from this AJAX request is received and I was trying to delay other code from running that relies on this data to instantiate other parts. I'm still learning so I have read the alternative is to use `promises` and stuff like that which is really confusing still so for now `async: false` solved my issue
comment on: http://stackoverflow.com/q/29933792
score: 0
type: Comment

http://stackoverflow.com/comment/47819621
comment on: http://stackoverflow.com/q/29846799
score: 0
type: Comment
type: QuestionComment
has text: $locationProvider is supposed to pass the baseUrl to trimEmptyHash(url), but url is undefined. This is my url http://localhost:3000/c/login

http://stackoverflow.com/comment/47965228
comment on: http://stackoverflow.com/q/29921795
score: 0
type: Comment
type: QuestionComment
has text: substring also works, just .length is not method, so not .length(), but .length

http://stackoverflow.com/a/29850156
answers question: http://stackoverflow.com/q/29850033
has body: Use setAttribute var element = document.getElementById('myDiv'); element.setAttribute('class','class1 class2'); See it in action
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29850033
type: Answer
score: 2
upvote count: 2

http://stackoverflow.com/comment/48023777
has text: Could you specify what you changed? Like this new Date().toLocaleTimeString()?
comment on: http://stackoverflow.com/a/29927588
type: Comment
type: AnswerComment
score: 0

http://stackoverflow.com/a/29931211
score: 0
type: Answer
answers question: http://stackoverflow.com/q/29930994
has body: You can convert that JSON data to an array which you can easily use with PHP. To do this use PHP's json_decode() function. $decodedJSON = json_decode($JSON, true); It's important you pass in true as the second parameter otherwise you will not get an array back. Now that you have an array you can access elements from that JSON data in that array. For example: $decodedJSON[key] In the above example, key can be any key that was in the JSON data we converted and it will return whatever value belongs to that key.

http://stackoverflow.com/comment/48001321
score: 0
comment on: http://stackoverflow.com/q/29940202
has text: Have you tried a more global selector like `$(window).unbind(`
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29888100
score: 0
answer count: 1
tagged with: jquery
tagged with: backbone.js
type: UnansweredQuestion
has title: layzr.js doesn't load the last image
has body: I'm using layzr.js in my backbone.js project, in order to do a lazy loading image. Here I put it in my backbone view : render: function(){ var _item = _.template(ItemTem); this.$el.html(_item(this.model.toJSON())); $(document).ready(function() { var layzr = new Layzrr({ selector: '[data-layzr]', attr: 'data-layzr', retinaAttr: 'data-layzr-retina', bgAttr: 'data-layzr-bg', threshold: 0, callback: null }); }); } }); Every image works fine except the last image, it is not loaded. I have no idea what's wrong with it or did I do any thing wrong. I attempted to find an answer to my question with the search engine but i was unable to.
type: Question
has answer: http://stackoverflow.com/a/29930989
tagged with: javascript

http://stackoverflow.com/a/29998729
upvote count: 3
answers question: http://stackoverflow.com/q/29998698
has body: How about this: $(document).click(function (event) { if(!$(event.target).closest('#accordion').length) {//if you clicked outside of the accordion $("#accordion").accordion({active: false});//collapse all the panels } });
score: 3
type: AcceptedAnswer
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/29998698

http://stackoverflow.com/comment/48081128
has text: As long as the jQuery works it is immaterial, but the (one line) PHP I gave is a very common way to extract query string parameters in PHP. Just wanted to make sure the OP understood that.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29980701

http://stackoverflow.com/comment/48015407
comment on: http://stackoverflow.com/q/29947027
score: 0
type: QuestionComment
has text: use the web console for debug your js.
type: Comment

http://stackoverflow.com/a/29972058
has body: to overlay on everything, z-index value must be bigger then everything else. yours -1.
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/29972009
has comment: http://stackoverflow.com/comment/48067856
upvote count: 2
type: Answer

http://stackoverflow.com/a/29921789
type: Answer
answers question: http://stackoverflow.com/q/29920428
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/47971446
has comment: http://stackoverflow.com/comment/47965414
has body: Then how about: $('#btnHyperlink').click(function() { var href = prompt("Insert url"); if(href != "" &amp;&amp; href != null) { HyperLink("id_description", href); } }); And the function: function HyperLink(elementID, url) { var textArea = $('#' + elementID); var len = textArea.val().length; var start = textArea[0].selectionStart; var end = textArea[0].selectionEnd; var selectedText = textArea.val().substring(start, end); var replacement = $('&lt;div/&gt;').append( $('&lt;a/&gt;').attr('href', url).html(selectedText) ).html(); textArea.val(textArea.val().substring(0, start) + replacement + textArea.val().substring(end, len)); } EDIT Seems that concatenating an a tag into a string gives just the url, so I wrapped it into a div and extracted its content to output it as a string. EDIT 2 Seems that I copied a wrong version of the code. Sorry. Here's the JSFiddle: http://jsfiddle.net/rok1ev0g/
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29920428

http://stackoverflow.com/comment/47988740
score: 2
has text: Err, `class="a {{cards.card}}"`?
comment on: http://stackoverflow.com/q/29933257
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/138627956
has text: DebugElement is a common component returned from componentFixture and is used to query the DOM: https://testing-angular.com/testing-components/#componentfixture-and-debugelement
comment on: http://stackoverflow.com/a/78444426
type: AnswerComment
score: 0
type: Comment

javascript
tags question: http://stackoverflow.com/q/29877568
tags question: http://stackoverflow.com/q/29956074
tags question: http://stackoverflow.com/q/29943824
tags question: http://stackoverflow.com/q/29950881
tags question: http://stackoverflow.com/q/29893389
tags question: http://stackoverflow.com/q/29856010
tags question: http://stackoverflow.com/q/29973596
tags question: http://stackoverflow.com/q/29936636
tags question: http://stackoverflow.com/q/29930849
tags question: http://stackoverflow.com/q/29985568
tags question: http://stackoverflow.com/q/29914381
tags question: http://stackoverflow.com/q/29933358
tags question: http://stackoverflow.com/q/29853219
tags question: http://stackoverflow.com/q/29854269
tags question: http://stackoverflow.com/q/29933712
tags question: http://stackoverflow.com/q/29957856
tags question: http://stackoverflow.com/q/29913964
tags question: http://stackoverflow.com/q/29996236
tags question: http://stackoverflow.com/q/29884780
tags question: http://stackoverflow.com/q/29900241
tags question: http://stackoverflow.com/q/29896396
tags question: http://stackoverflow.com/q/29857293
tags question: http://stackoverflow.com/q/29848821
tags question: http://stackoverflow.com/q/29995696
tags question: http://stackoverflow.com/q/29877178
tags question: http://stackoverflow.com/q/29898734
tags question: http://stackoverflow.com/q/29952047
tags question: http://stackoverflow.com/q/29936188
tags question: http://stackoverflow.com/q/29993753
tags question: http://stackoverflow.com/q/29891262
tags question: http://stackoverflow.com/q/29847628
tags question: http://stackoverflow.com/q/29883274
tags question: http://stackoverflow.com/q/29966439
tags question: http://stackoverflow.com/q/29946463
tags question: http://stackoverflow.com/q/29851441
tags question: http://stackoverflow.com/q/29943818
tags question: http://stackoverflow.com/q/29876018
tags question: http://stackoverflow.com/q/29996227
tags question: http://stackoverflow.com/q/29999407
tags question: http://stackoverflow.com/q/29944569
tags question: http://stackoverflow.com/q/29975975
tags question: http://stackoverflow.com/q/29992511
tags question: http://stackoverflow.com/q/29942581
tags question: http://stackoverflow.com/q/29963145
tags question: http://stackoverflow.com/q/29905139
tags question: http://stackoverflow.com/q/29876474
tags question: http://stackoverflow.com/q/29979182
tags question: http://stackoverflow.com/q/29882370
tags question: http://stackoverflow.com/q/29857179
tags question: http://stackoverflow.com/q/29929402
tags question: http://stackoverflow.com/q/29936379
tags question: http://stackoverflow.com/q/29958777
tags question: http://stackoverflow.com/q/29910560
tags question: http://stackoverflow.com/q/29927158
tags question: http://stackoverflow.com/q/29922214
tags question: http://stackoverflow.com/q/29972119
tags question: http://stackoverflow.com/q/29865334
tags question: http://stackoverflow.com/q/29928803
tags question: http://stackoverflow.com/q/29886339
tags question: http://stackoverflow.com/q/29994405
tags question: http://stackoverflow.com/q/29908811
tags question: http://stackoverflow.com/q/29876623
tags question: http://stackoverflow.com/q/29961571
tags question: http://stackoverflow.com/q/29904903
tags question: http://stackoverflow.com/q/29928452
tags question: http://stackoverflow.com/q/29884635
tags question: http://stackoverflow.com/q/29864630
tags question: http://stackoverflow.com/q/29869700
tags question: http://stackoverflow.com/q/29848656
tags question: http://stackoverflow.com/q/29892126
tags question: http://stackoverflow.com/q/29867370
tags question: http://stackoverflow.com/q/29982254
tags question: http://stackoverflow.com/q/29954936
tags question: http://stackoverflow.com/q/29896731
tags question: http://stackoverflow.com/q/29914580
tags question: http://stackoverflow.com/q/29860848
tags question: http://stackoverflow.com/q/29871139
tags question: http://stackoverflow.com/q/29940884
tags question: http://stackoverflow.com/q/29967752
tags question: http://stackoverflow.com/q/29992822

http://stackoverflow.com/a/29932999
has body: This is happening because in both frames, window.parent makes reference to the same window object, and you are setting the onscroll property/event on the same object, twice. This means that the second time around you set the window.parent.onscroll property, you're actually overwriting the first attempt to set the event, and you're overwriting it with the second frame's window.document object, which is why it only updates the contents of the elements in the second frame. To overcome this issue, you can simply just use addEventListener instead of onscroll: http://jsfiddle.net/x046o0p7/ function run() { document.write("&lt;div id='scrollY' style='float:left;'&gt;&lt;/div&gt;&lt;br&gt;"); scrollY = 'no'; document.getElementById("scrollY").innerHTML = scrollY; window.parent.addEventListener('scroll', function() { scrollY = window.parent.pageYOffset; document.getElementById("scrollY").innerHTML = scrollY; }); } addEventListener allows you to set multiple events of the same type for the same element, while the .onstuff listeners don't.
score: 0
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29932711
type: Answer
accepted answer of: http://stackoverflow.com/q/29932711

http://stackoverflow.com/comment/47924245
type: Comment
comment on: http://stackoverflow.com/a/29900643
has text: No still it return the entire,
type: AnswerComment
score: 0

http://stackoverflow.com/a/29981879
has comment: http://stackoverflow.com/comment/48105263
upvote count: 3
type: Answer
has comment: http://stackoverflow.com/comment/48116888
score: 3
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29981713
has comment: http://stackoverflow.com/comment/48131754
answers question: http://stackoverflow.com/q/29981713
has comment: http://stackoverflow.com/comment/48100675
type: AcceptedAnswer
has body: Look closely at what alert(document.cookie) alerts. It seems that the key-value pairs in the string it returns are separated from each other by both, a semicolon (;), and a whitespace (). So you need to split by that. Without doing so, your comparison looks like this, because that extra whitespace isn't being removed: 'a' == ' a' // False! All you need to change is this line: var cookie_pieces = current_cookie.split(';'); To this: var cookie_pieces = current_cookie.split('; '); http://plnkr.co/edit/WkBfD7pU10cMwJQxyIp0?p=preview

http://stackoverflow.com/q/29863841
accepted answer: http://stackoverflow.com/a/29864055
tagged with: cache-manifest
has comment: http://stackoverflow.com/comment/47853025
tagged with: javascript
has title: Appending cache manifest to existing site
answer count: 2
has body: Is it possible to add a cache manifest programmatically right after the page was loaded? Like adding the attribute to the html tag with JavaScript and re-init/re-load the page? I want to add a cache manifest to a page but cannot edit its HTML itself.
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
has answer: http://stackoverflow.com/a/29864070
favorite count: 0
has answer: http://stackoverflow.com/a/29864055
score: 6
possible better answer: http://stackoverflow.com/a/29864070
upvote count: 6
type: AnsweredQuestion
type: Question

django-models
tag name: django-models
tags question: http://stackoverflow.com/q/29900914
type: Tag

http://stackoverflow.com/comment/48047384
type: Comment
has text: How your data looks like, can you try to put null value for point which is "transparent" ?
comment on: http://stackoverflow.com/q/29961206
score: 0
type: QuestionComment

http://stackoverflow.com/q/29965394
has comment: http://stackoverflow.com/comment/48052709
has comment: http://stackoverflow.com/comment/48052248
has comment: http://stackoverflow.com/comment/48053618
has comment: http://stackoverflow.com/comment/48052814
tagged with: session
type: UnansweredQuestion
has body: I would like persist some data in session. I am using MongoDB as session store. I prepared simple code, to do this. But it, doesn't work. I got this error: Type Error: Cannot set property 'myVariable' of undefined And this is my code: var express = require('express'); var app = require('express')(); var http = require('http') var server = require('http').Server(app); var io = require('socket.io')(server); var get_ip = require('ipware')().get_ip; var Sequelize = require('sequelize'); var url = require("url"); var crypto = require('crypto'); var cookieParser = require('cookie-parser'); var Session = require('express-session'); var MongoStore = require('connect-mongo')(Session); var mongoose = require('mongoose'); var url =require('url'); app.use(cookieParser()); app.use(Session({ cookie: { maxAge: 1000*60*2 } , secret: "session secret" , resave: true, saveUninitialized: true, store:new MongoStore({ db: 'linchat' }) })); server.listen(3000); io.on('connection', function (socket) { socket.on('join', function(href, referer){ socket.request.session.myVariable = 'my session variable value'; console.log('save on to session'); }) }); What I do wrong? I use: "express": "4.12.3", "socket.io": "1.3.5" EDIT I try also use express-socket.io-session package: var express = require('express'); var app = require('express')(); var http = require('http') var server = require('http').Server(app); var io = require('socket.io')(server); var get_ip = require('ipware')().get_ip; var Sequelize = require('sequelize'); var url = require("url"); var crypto = require('crypto'); var cookieParser = require('cookie-parser'); var Session = require('express-session'); var MongoStore = require('connect-mongo')(Session); var mongoose = require('mongoose'); var url =require('url'); app.use(cookieParser()); var session = require("express-session")({ secret: "my-secret", resave: true, saveUninitialized: true, store:new MongoStore({ db: 'linchat' }) }); app.use(session); io.use(require("express-socket.io-s…
score: 2
answer count: 0
downvote count: 0
tagged with: javascript
favorite count: 0
type: Question
has comment: http://stackoverflow.com/comment/48052451
tagged with: express-session
has comment: http://stackoverflow.com/comment/48052028
tagged with: node.js
upvote count: 2
has title: session in node.js with express 4 and socket.io
tagged with: socket.io-1.0
has comment: http://stackoverflow.com/comment/48051213

http://stackoverflow.com/q/29945646
score: 17
answer count: 5
has title: Sweet alert timer - done function
has answer: http://stackoverflow.com/a/29946543
upvote count: 17
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29946543
has answer: http://stackoverflow.com/a/29946094
has answer: http://stackoverflow.com/a/45275381
has answer: http://stackoverflow.com/a/55070618
tagged with: sweetalert
has body: I have been playing a little with the SweetAlert plugin: Sweet alert I wanted to make a delete button, where the user gets prompted before the actual delete. When the user then presses "delete" again, is then says "done" and the user has to click "ok" again for the prompt to go away for good. SweetAlert has a timer function, so you can auto-close that last "Done" prompt after a few seconds or so, which works just fine. They also have a feature, where you can implement a function to be run when the user clicks "OK" on the "Done" prompt. Problem is, that function is not ran if the prompt auto closes after the timer is done. Any ideas how this can be done? With timer and function not being run: swal({ title: "Deleted!", text: "Your row has been deleted.", type: "success", timer: 3000 }, function () { location.reload(true); tr.hide(); }); Without timer, but with a working function (when clicking the "ok" button): swal("Deleted!", "Your row has been deleted.", "success"), function () { location.reload(); tr.hide(); };
has answer: http://stackoverflow.com/a/57783371
type: Question
possible better answer: http://stackoverflow.com/a/55070618
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0

http://stackoverflow.com/comment/48043126
type: Comment
has text: "stackoverflow mentality" you try and help a person with your input but get down voted. Even though it was wrong it was an attempt to help. But obviously this is not a site you come to to get "help".
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29946499

http://stackoverflow.com/comment/48078847
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29979571
has text: think I misinterpreted expected results on larger tables ... was going on premise only outer and inner got zeros
type: AnswerComment

http://stackoverflow.com/comment/47821590
type: Comment
type: QuestionComment
has text: Works fine... Wich browser do you use?
score: 0
comment on: http://stackoverflow.com/q/29847282

http://stackoverflow.com/comment/47867647
score: 0
type: Comment
type: QuestionComment
has text: No, `Sprite.call()` is calling *into* the `Sprite()` function. At the point where you make the call, there is no knowledge of what goes on inside that function. You have to use only what you have available at that point. See my answer below for one way you could do this.
comment on: http://stackoverflow.com/q/29871261

http://stackoverflow.com/q/29929044
has answer: http://stackoverflow.com/a/33362179
has comment: http://stackoverflow.com/comment/47982172
has comment: http://stackoverflow.com/comment/47980295
answer count: 2
has answer: http://stackoverflow.com/a/30081851
has comment: http://stackoverflow.com/comment/47980836
tagged with: javascript
tagged with: meanjs
tagged with: angularjs
has body: This concerns a MEAN.js environment. I have if-statements in my Angular view to check if I have any results from my database. If there are results then I show them, if not then I show an error message. I have an issue with Angular code blinking: when the page loads, for a split-second I see the error message, and then it immediately shows the results from my database. The ng-cloak directive does not work. Code Below I have included very basic Angular code that should make clear what I am doing. Controller: // Return a specific person from the database. this.person = Persons.get({ personId: $stateParams.personId }); View: Sorry, person could not be found. I tried adding the ng-cloak directive, which does not work. MEAN.js also uses Bootstrap and provides a few CSS classes, but no matter which ones I add, none of them work: [ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak { display: none !important; } In short: I can add the ng-cloak directive AND the ng-cloak CSS class, but they do not work. I can add style="display:none;" but that hides the error message even if it is supposed to be shown.
has title: AngularJS ng-cloak does not prevent code blinking in Mean.js
has comment: http://stackoverflow.com/comment/47980695
has comment: http://stackoverflow.com/comment/47994588
has comment: http://stackoverflow.com/comment/47981271
favorite count: 0
downvote count: 0
has comment: http://stackoverflow.com/comment/47980719
has comment: http://stackoverflow.com/comment/47982287
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47980518
score: 6
has comment: http://stackoverflow.com/comment/47980663
type: Question
has comment: http://stackoverflow.com/comment/47980272
has comment: http://stackoverflow.com/comment/47980291
upvote count: 6

http://stackoverflow.com/a/29896823
downvote count: 0
type: Answer
has body: You can get this value off the sails object. MODEL.update(id,{myAttribute:sails.models.MODEL.myAttribute.defaultsTo})
upvote count: 3
accepted answer of: http://stackoverflow.com/q/29896589
answers question: http://stackoverflow.com/q/29896589
score: 3
type: AcceptedAnswer

http://stackoverflow.com/q/29985124
tagged with: woocommerce
type: Question
has comment: http://stackoverflow.com/comment/48090195
answer count: 1
tagged with: javascript
tagged with: jquery
score: 0
has comment: http://stackoverflow.com/comment/48113759
has body: This is irritating. Last year it was no problem for me to customize the order review area at checkout, but a few updates later and it isn't working. I have disabled all plugins except WC and using a basic theme and this still is happening. When I use my custom loaded JS to change part of the order review area, the change takes place, but then it auto refreshes itself for no reason at all and the change is gone. No matter where I put the JS, or if I set priority to max, the area always updates itself somehow and I can't change anything without disabling the wc-checkout script, which is needed. Any ideas how to achieve this? I tried searching everywhere for a filter for when the area is refreshed but found nothing except for individual item name filters or for quantities.
has title: How to modify the WooCommerce 'order review' at checkout?
type: UnansweredQuestion
tagged with: wordpress
has answer: http://stackoverflow.com/a/30000459

http://stackoverflow.com/q/29992915
tagged with: javascript
score: 0
tagged with: jquery
has body: So i have a program that's generating a map based on reading from a json file. When I click on the option to draw the map, i get the following error in the Safari browser element inspector: Error: JSON Parse error: Unrecognized token '/' After combing through the json file and making sure it was correct, I realized there are no '/' tokens anywhere in the file. not even a //(i read about escaping characters). It says the error generates from: angular.js:9037 and the contents of that line are: function consoleLog(type) { var console = $window.console || {}, logFn = console[type] || console.log || noop; if (logFn.apply) { return function() { var args = []; forEach(arguments, function(arg) { args.push(formatError(arg)); }); return logFn.apply(console, args); #this is line 9037 in angular.js }; } I'm not familiar with angular.js at all, and I am not understanding why i'm getting this error. Any ideas? Thanks a lot.
tagged with: angularjs
has title: AngularJS/JSON: Error: JSON Parse error: Unrecognized token '/' at angular.js:9037
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/48105613
has comment: http://stackoverflow.com/comment/48105902
answer count: 0
tagged with: http://stackoverflow.com/tag/json
type: Question

http://stackoverflow.com/q/29925525
linked to: http://stackoverflow.com/q/20433069
type: UnansweredQuestion
tagged with: php
downvote count: 1
has answer: http://stackoverflow.com/a/29928441
type: Question
tagged with: javascript
score: -1
tagged with: google-maps-api-3
has body: &lt;script src="https://maps.googleapis.com/maps/api/js?v=3&amp;sensor=false"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; var directionsDisplay; var directionsService = new google.maps.DirectionsService(); var map; var something; var locations = &lt;?php echo json_encode($googlemaparray);?&gt;; var uniquelocations= &lt;?php echo json_encode($uniquegoogle);?&gt;; var barinfo = &lt;?php echo json_encode($barinfoarray);?&gt;; var marker, i; var total = uniquelocations.length; var test; function initialize() { directionsDisplay = new google.maps.DirectionsRenderer(); map = new google.maps.Map(document.getElementById('map-canvas'), { zoom: 17, center: new google.maps.LatLng(locations[0],locations[1]), mapTypeId: google.maps.MapTypeId.ROADMAP }); directionsDisplay.setMap(map); var start = new google.maps.LatLng(uniquelocations[0],uniquelocations[1]); var end = new google.maps.LatLng(uniquelocations[0],uniquelocations[1]); var waypts = []; for (var i = 2; i &lt; uniquelocations.length; i+=2){ waypts.push({ location:new google.maps.LatLng(uniquelocations[i],uniquelocations[i+1])}); }; var request = { origin: start, destination: end, waypoints:waypts, optimizeWaypoints:true, travelMode: google.maps.DirectionsTravelMode.WALKING }; directionsService.route(request, function (response, status) { if (status == google.maps.DirectionsStatus.OK) { directionsDisplay.setDirections(response); var something=response.routes.waypoint_order; console.log(something); } }); // test = google.maps.geometry.spherical.computeDistanceBetween({ // from:new google.maps.LatLng(uniquelocations[0],uniquelocations[1]), // to:new google.maps.LatLng(uniquelocations[2],uniquelocations[3]) // }); } google.maps.event.addDomListener(window, 'load', initialize); &lt;/script&gt; How do I gain access to the array from waypoint_order, because I need to know how my waypoints are being ordered. When I console.log(something) for the existing code, it says "undefined" in the console. I am using a WAMP st…
upvote count: 0
has title: Need to get waypoint_order after optimizedwaypoint
answer count: 1
has comment: http://stackoverflow.com/comment/47977473
favorite count: 0

http://stackoverflow.com/q/29892006
type: Question
tagged with: javascript
answer count: 3
has title: Toggling if a condition is met on table elements
upvote count: 1
tagged with: jquery
possible better answer: http://stackoverflow.com/a/29892629
has answer: http://stackoverflow.com/a/29892816
favorite count: 0
has body: I have a table. Each column has a button at the top. If the td elements below within the column have content in them, then hide the button. If not then display the button and onClick add class active too the td element. $(document).ready(function (){ $('.button-fill').on("click", function() { var i=$(this).parent().index(); if($(this).closest("tr").siblings().find("td:eq("+i+")").text()=="") $(this).hide(); else $(this).show(); }); &lt;!-- Fill in the td --&gt; $('.button-fill').on("click", function() { var i=$(this).parent().index(); $(this).closest("tr").siblings().find("td:eq("+i+")").addClass("active"); //}); }); }); http://jsfiddle.net/ujw0u6au/ I've created a jsfiddle. I don't know what i'm doing wrong? Thank you
has comment: http://stackoverflow.com/comment/47908066
accepted answer: http://stackoverflow.com/a/29892305
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/29892305
has answer: http://stackoverflow.com/a/29892629

http://stackoverflow.com/tag/html
tags question: http://stackoverflow.com/q/29897405
tags question: http://stackoverflow.com/q/29915375
tags question: http://stackoverflow.com/q/29982543
tags question: http://stackoverflow.com/q/29955085
tags question: http://stackoverflow.com/q/29910022
tags question: http://stackoverflow.com/q/29961236
tags question: http://stackoverflow.com/q/29929528
tags question: http://stackoverflow.com/q/29966521
tags question: http://stackoverflow.com/q/29964035
tags question: http://stackoverflow.com/q/29884837
tags question: http://stackoverflow.com/q/29972009
tags question: http://stackoverflow.com/q/29999549
tags question: http://stackoverflow.com/q/29937522
tags question: http://stackoverflow.com/q/29856201
tags question: http://stackoverflow.com/q/29934359
tags question: http://stackoverflow.com/q/29925527
tags question: http://stackoverflow.com/q/29992780
tags question: http://stackoverflow.com/q/29879802
tags question: http://stackoverflow.com/q/29930637
tags question: http://stackoverflow.com/q/29968883
tags question: http://stackoverflow.com/q/29933410
tags question: http://stackoverflow.com/q/29935330
tags question: http://stackoverflow.com/q/29994591
tags question: http://stackoverflow.com/q/29912902
tags question: http://stackoverflow.com/q/29968816
tags question: http://stackoverflow.com/q/29857393
tags question: http://stackoverflow.com/q/29881010
tags question: http://stackoverflow.com/q/29865174
tags question: http://stackoverflow.com/q/29863845
tags question: http://stackoverflow.com/q/29978022
tags question: http://stackoverflow.com/q/29906126
tags question: http://stackoverflow.com/q/29934245
tags question: http://stackoverflow.com/q/29926999
tags question: http://stackoverflow.com/q/29954026
tags question: http://stackoverflow.com/q/29890556
tags question: http://stackoverflow.com/q/29917249
tags question: http://stackoverflow.com/q/29918465
tags question: http://stackoverflow.com/q/29932782
tags question: http://stackoverflow.com/q/29915144
tags question: http://stackoverflow.com/q/29872201
tags question: http://stackoverflow.com/q/29922704
tags question: http://stackoverflow.com/q/29923269
tags question: http://stackoverflow.com/q/29980598
tags question: http://stackoverflow.com/q/29961388
tags question: http://stackoverflow.com/q/29868087
tags question: http://stackoverflow.com/q/29981876
tags question: http://stackoverflow.com/q/29851587
tags question: http://stackoverflow.com/q/29864588
tags question: http://stackoverflow.com/q/29959085
tags question: http://stackoverflow.com/q/29963040
tags question: http://stackoverflow.com/q/29903896
tags question: http://stackoverflow.com/q/29941338
tags question: http://stackoverflow.com/q/29995241
tags question: http://stackoverflow.com/q/29980113
tags question: http://stackoverflow.com/q/29865860
tags question: http://stackoverflow.com/q/29884014
tags question: http://stackoverflow.com/q/29847452
tags question: http://stackoverflow.com/q/29871313
tags question: http://stackoverflow.com/q/29851134
tags question: http://stackoverflow.com/q/29898487
tags question: http://stackoverflow.com/q/29899364
tags question: http://stackoverflow.com/q/29988270
tags question: http://stackoverflow.com/q/29861582
tags question: http://stackoverflow.com/q/29964099
tags question: http://stackoverflow.com/q/29882361
tags question: http://stackoverflow.com/q/29845708
tags question: http://stackoverflow.com/q/29893885
tags question: http://stackoverflow.com/q/29997227
tags question: http://stackoverflow.com/q/29875095
tags question: http://stackoverflow.com/q/29939286
tags question: http://stackoverflow.com/q/29989571
tags question: http://stackoverflow.com/q/29998775
tags question: http://stackoverflow.com/q/29996362
tags question: http://stackoverflow.com/q/29872848
tags question: http://stackoverflow.com/q/29982985
tags question: http://stackoverflow.com/q/29861827
tags question: http://stackoverflow.com/q/29889361
tags question: http://stackoverflow.com/q/29878516
tags question: http://stackoverflow.com/q/29960206
tags question: http://stackoverflow.com/q/29852143

http://stackoverflow.com/q/29999113
has answer: http://stackoverflow.com/a/29999320
linked to: http://stackoverflow.com/q/2987605
type: AnsweredQuestion
score: 1
has title: Javascript check if list is sorted after one swap
upvote count: 1
has answer: http://stackoverflow.com/a/29999150
type: Question
tagged with: algorithm
tagged with: javascript
tagged with: sorting
has answer: http://stackoverflow.com/a/29999324
answer count: 3
downvote count: 0
tagged with: swap
favorite count: 0
has body: I want to check if a list can be sorted by performing at most one swap operation, and I want to return true if it does. Otherwise, I want to return false. For example, the input A = [1,2,3,4,5] should result in true because it is already sorted. A = [1,2,5,4,3] should result in true because with one swap, involving 5 and 3, the list is sorted. A = [1,2,5,3,4] should result in false because it requires more than one swap to sort. My code is below. It returns true if A is already sorted, but it returns undefined if it is not sorted but can be sorted with one swap. Can someone help me find the problem? function solution(A) { var count=0; for(var k=0; k&lt;A.length; k++) //check if sorted { if(A[k] &lt;= A[k+1]) count++; else break; } if (count === A.length - 1) //if already sorted return true { return true; } for(var i=0; i&lt;A.length; i++) //if not sorted lets check { var temp=0; for(var j=i+1; j&lt;A.length; j++) { if(A[i] &gt; A[j]) //swap only if A[i] &gt; A[j] { temp = A[i]; A[i] = A[j]; A[j] = temp; //check if sorted } } } } I want to check if the array is sorted after every swap. How can I do that ?
accepted answer: http://stackoverflow.com/a/29999324
possible better answer: http://stackoverflow.com/a/29999320
has comment: http://stackoverflow.com/comment/48117453

http://stackoverflow.com/q/29928765
linked to: http://stackoverflow.com/q/33481824
tagged with: bookmarklet
has body: I'm writing a bookmarklet to login to my bank and the navigate to my statement page and click a download button./ I know I can do the login part OK, but can the bookmarklet then run a navigate to a second page and click buttons etc on the second page
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/47979568
answer count: 0
type: UnansweredQuestion
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/47979590
has comment: http://stackoverflow.com/comment/47979683
type: Question
has comment: http://stackoverflow.com/comment/54750099
tagged with: javascript
has title: Can a bookmarklet work across several pages

http://stackoverflow.com/comment/48069843
type: AnswerComment
comment on: http://stackoverflow.com/a/29958048
type: Comment
has text: And please, let me know if any further issues arise.
score: 1

http://stackoverflow.com/a/29928757
type: Answer
has body: You need to re-assign the value to test3. Some relevant reading: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Grammar_and_types#Declarations
score: 0
answers question: http://stackoverflow.com/q/29928719

http://stackoverflow.com/comment/47999839
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29938114
has text: @Kobi: True, the only `]` is a non-word character. Great! So, there would be no solution if the look-ahead and look-behind were of variable width.
score: 0

http://stackoverflow.com/comment/47915080
has text: I think you need to add mouseEnter/mouseLeave but I'm not sure if you can do it in the handlebars template directly. You may have to create a View which extends Ember.Select.
score: 0
comment on: http://stackoverflow.com/q/29895762
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/60920808
comment on: http://stackoverflow.com/a/29916802
has text: I banged my head cause I thought it has something to do with cors, great answer!!
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/29887156
downvote count: 0
has comment: http://stackoverflow.com/comment/47898735
has comment: http://stackoverflow.com/comment/47900230
type: Answer
has comment: http://stackoverflow.com/comment/48165021
upvote count: 6
score: 6
has comment: http://stackoverflow.com/comment/48162835
has comment: http://stackoverflow.com/comment/47900440
answers question: http://stackoverflow.com/q/29887089
has body: Use val() function to get data from inputs $(document).ready(function(e) { $("button").click(function(e) { e.preventDefault(); var ajax = { isSubmitting: false, send: function() { if(ajax.isSubmitting == false) { ajax.isSubmitting = true; var userName = $('input[name="contact-name"]').val(); var userEmail = $('input[name="contact-email"]').val(); var userWebsite = $('input[name="contact-website"]').val(); var userMessage = $('input[name="contact-message"]').val(); if(userName === "" || userEmail === "" || userWebsite === "" || userMessage === "") { alert("Please fill out all required fields."); } else { $.post("mailer3.php", { name: userName, email: userEmail, website: userWebsite, message: userMessage }, function(data) { ajax.isSubmitting = false; }); } } else alert("Send only 1 email at a time."); } } }); Try this using $.ajax: $("button").click(function(){ isSubmitting: false; var userName = $('input[name="contact-name"]').val(); var userEmail = $('input[name="contact-email"]').val(); var userWebsite = $('input[name="contact-website"]').val(); var userMessage = $('input[name="contact-message"]').val(); if(isSubmitting == false) { $.ajax({url: "mailer3.php", type:'POST', data:{ name: userName, email: userEmail, website: userWebsite, message: userMessage }, success: function(result){ isSubmitting == true; },error(xhr,status,error){ isSubmitting == false; } }); } });
has comment: http://stackoverflow.com/comment/47943465
has comment: http://stackoverflow.com/comment/47945017
has comment: http://stackoverflow.com/comment/47899432
has comment: http://stackoverflow.com/comment/47945113
has comment: http://stackoverflow.com/comment/48164577
has comment: http://stackoverflow.com/comment/47900264

http://stackoverflow.com/q/29912431
answer count: 0
has title: Load page trought AJAX, get file from location.hash
has comment: http://stackoverflow.com/comment/47947012
has comment: http://stackoverflow.com/comment/47947044
type: Question
has comment: http://stackoverflow.com/comment/47950289
has comment: http://stackoverflow.com/comment/47946993
tagged with: javascript
has comment: http://stackoverflow.com/comment/47946869
tagged with: get
score: 0
tagged with: jquery
has body: When i try to do this: $.ajax ({ url: location.hash, method: 'GET', dataType: 'html', success: function (data, textStatus, jqXHR) { $('#content').html(data); }, error: function (jqXHR, textStatus, errorThrown) { console.log(textStatus); } }); I get this error: 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/. My url is: localhost/index.php#test.php It should use test.php as url to load. What i need is when there is a hash in the url, i need to load the hash (filename).. Edit: When i add: async: false, I still get the same error.. Edit: I am using jQuery version 2.1.3
tagged with: ajax
tagged with: hash
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/27736186

events
tags question: http://stackoverflow.com/q/29929430
tags question: http://stackoverflow.com/q/29993026
tags question: http://stackoverflow.com/q/29971990
tags question: http://stackoverflow.com/q/29877055
tags question: http://stackoverflow.com/q/30000929
tags question: http://stackoverflow.com/q/29947534
tags question: http://stackoverflow.com/q/29984761
tags question: http://stackoverflow.com/q/29914362
tags question: http://stackoverflow.com/q/29983685
tags question: http://stackoverflow.com/q/29992485
tags question: http://stackoverflow.com/q/29902128
tags question: http://stackoverflow.com/q/29987675
tags question: http://stackoverflow.com/q/29908261
tags question: http://stackoverflow.com/q/29972219
tags question: http://stackoverflow.com/q/29956526
tag name: events
tags question: http://stackoverflow.com/q/29879775
tags question: http://stackoverflow.com/q/29880200
tags question: http://stackoverflow.com/q/30000021
tags question: http://stackoverflow.com/q/29867625
tags question: http://stackoverflow.com/q/29979864
type: Tag
tags question: http://stackoverflow.com/q/29974088
tags question: http://stackoverflow.com/q/29953982

http://stackoverflow.com/a/29912022
upvote count: 1
type: Answer
has body: Instead of &lt;tr ng-repeat="item in data"&gt; try &lt;tr ng-repeat="item in $data"&gt;
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/29893720

http://stackoverflow.com/q/29873804
linked to: http://stackoverflow.com/q/16657399
tagged with: http://stackoverflow.com/tag/html
type: Question
tagged with: iframe
score: 0
answer count: 2
has body: Is there a way to inject javascript from an iframe into its parent window using javascript? Both the iframe and the parent are in the same domain. I cannot simply perform the action from the parent window after detecting changes in the iframe, due to other reasons. example: &lt;div id="bar"&gt; Hello World &lt;/div&gt; &lt;iframe srcdoc=" &lt;html&gt; &lt;body&gt; &lt;script type="text/javascript"&gt; // change "bar"'s style or alter its content &lt;/script&gt; &lt;/body&gt; &lt;/html&gt; "&gt;&lt;/iframe&gt;
has answer: http://stackoverflow.com/a/29873861
has title: Is there a way to inject javascript code from an iframe into the parent window?
has answer: http://stackoverflow.com/a/29873833
tagged with: javascript
type: UnansweredQuestion
tagged with: javascript-injection

http://stackoverflow.com/comment/81919954
type: AnswerComment
comment on: http://stackoverflow.com/a/34513331
type: Comment
has text: Note that `google.visualization.ColumnChart()` is for the old **Classic** charts not the new **Material** charts. Humans will have a permanent colony on Mars before Google gets **Material** charts figured out.
score: 0

ajax
tags question: http://stackoverflow.com/q/29884009
tags question: http://stackoverflow.com/q/29991302
tags question: http://stackoverflow.com/q/29954343
tags question: http://stackoverflow.com/q/29904027
tags question: http://stackoverflow.com/q/29977357
tags question: http://stackoverflow.com/q/29883966
tags question: http://stackoverflow.com/q/29875177
tags question: http://stackoverflow.com/q/29853842
tags question: http://stackoverflow.com/q/29937550
tags question: http://stackoverflow.com/q/29896513
tags question: http://stackoverflow.com/q/29880097
tags question: http://stackoverflow.com/q/29948826
tags question: http://stackoverflow.com/q/29982565
tags question: http://stackoverflow.com/q/29941327
tags question: http://stackoverflow.com/q/29887539
tags question: http://stackoverflow.com/q/29917473
tags question: http://stackoverflow.com/q/29963009
tags question: http://stackoverflow.com/q/29921417
tags question: http://stackoverflow.com/q/29943445
tags question: http://stackoverflow.com/q/29990311
tags question: http://stackoverflow.com/q/29935254
tags question: http://stackoverflow.com/q/29915613
tags question: http://stackoverflow.com/q/29906693
tags question: http://stackoverflow.com/q/29939361
tags question: http://stackoverflow.com/q/29914631
tags question: http://stackoverflow.com/q/29863571
tags question: http://stackoverflow.com/q/29869327
tags question: http://stackoverflow.com/q/29916592
tags question: http://stackoverflow.com/q/29950100
tags question: http://stackoverflow.com/q/29980442
tags question: http://stackoverflow.com/q/29973936
tags question: http://stackoverflow.com/q/29974011
tags question: http://stackoverflow.com/q/29864695
tags question: http://stackoverflow.com/q/29888916
tags question: http://stackoverflow.com/q/29956374
tags question: http://stackoverflow.com/q/29847299
tags question: http://stackoverflow.com/q/29863581
tags question: http://stackoverflow.com/q/29861319
tags question: http://stackoverflow.com/q/29854522
tags question: http://stackoverflow.com/q/29908644
tags question: http://stackoverflow.com/q/29935032
tags question: http://stackoverflow.com/q/29991065
tags question: http://stackoverflow.com/q/29881338
tags question: http://stackoverflow.com/q/29871544
tags question: http://stackoverflow.com/q/29908007
tags question: http://stackoverflow.com/q/29935312
tags question: http://stackoverflow.com/q/29966817
tags question: http://stackoverflow.com/q/30001197
tags question: http://stackoverflow.com/q/29924548
tags question: http://stackoverflow.com/q/29901933
type: Tag
tags question: http://stackoverflow.com/q/29858388
tags question: http://stackoverflow.com/q/29955141
tags question: http://stackoverflow.com/q/29885551
tags question: http://stackoverflow.com/q/29900868
tags question: http://stackoverflow.com/q/29931746
tags question: http://stackoverflow.com/q/29972701
tags question: http://stackoverflow.com/q/29932729
tags question: http://stackoverflow.com/q/30000764
tags question: http://stackoverflow.com/q/29986108
tags question: http://stackoverflow.com/q/29947585
tags question: http://stackoverflow.com/q/29917111
tags question: http://stackoverflow.com/q/29861273
tags question: http://stackoverflow.com/q/29989327
tags question: http://stackoverflow.com/q/29914862
tags question: http://stackoverflow.com/q/29893240
tags question: http://stackoverflow.com/q/29992447
tags question: http://stackoverflow.com/q/29865907
tags question: http://stackoverflow.com/q/29993284
tags question: http://stackoverflow.com/q/29945774
tags question: http://stackoverflow.com/q/29888830
tags question: http://stackoverflow.com/q/29890134
tags question: http://stackoverflow.com/q/29949131
tags question: http://stackoverflow.com/q/29988231
tags question: http://stackoverflow.com/q/29926718
tags question: http://stackoverflow.com/q/29908538
tags question: http://stackoverflow.com/q/29850351
tags question: http://stackoverflow.com/q/29852780
tags question: http://stackoverflow.com/q/29971254
tags question: http://stackoverflow.com/q/29923461

php
tags question: http://stackoverflow.com/q/29944090
tags question: http://stackoverflow.com/q/29961893
tags question: http://stackoverflow.com/q/29856590
tags question: http://stackoverflow.com/q/29860960
tags question: http://stackoverflow.com/q/29861492
tags question: http://stackoverflow.com/q/29986262
tags question: http://stackoverflow.com/q/29864741
tags question: http://stackoverflow.com/q/29845681
tags question: http://stackoverflow.com/q/29974354
tags question: http://stackoverflow.com/q/29938949
tags question: http://stackoverflow.com/q/29921720
tags question: http://stackoverflow.com/q/29995715
tags question: http://stackoverflow.com/q/29882731
tags question: http://stackoverflow.com/q/29972701
tags question: http://stackoverflow.com/q/29892411
tags question: http://stackoverflow.com/q/29845346
tags question: http://stackoverflow.com/q/30000764
tags question: http://stackoverflow.com/q/29890679
tags question: http://stackoverflow.com/q/29918464
tags question: http://stackoverflow.com/q/29917111
tags question: http://stackoverflow.com/q/29986731
tags question: http://stackoverflow.com/q/29919302
tags question: http://stackoverflow.com/q/29989327
tags question: http://stackoverflow.com/q/29989034
tags question: http://stackoverflow.com/q/29986519
tags question: http://stackoverflow.com/q/29969054
tags question: http://stackoverflow.com/q/29992447
tags question: http://stackoverflow.com/q/29964588
tags question: http://stackoverflow.com/q/29939064
tags question: http://stackoverflow.com/q/29952460
tags question: http://stackoverflow.com/q/29888830
tags question: http://stackoverflow.com/q/29890134
tags question: http://stackoverflow.com/q/29926718
tags question: http://stackoverflow.com/q/29859900
tags question: http://stackoverflow.com/q/29980149
tags question: http://stackoverflow.com/q/29864844
tags question: http://stackoverflow.com/q/29913791
tags question: http://stackoverflow.com/q/29877665
tags question: http://stackoverflow.com/q/29949860
tags question: http://stackoverflow.com/q/29856755
tags question: http://stackoverflow.com/q/29889094
tags question: http://stackoverflow.com/q/29877268
tags question: http://stackoverflow.com/q/29985894
tags question: http://stackoverflow.com/q/29868849
tags question: http://stackoverflow.com/q/29898641
tags question: http://stackoverflow.com/q/29987956
tags question: http://stackoverflow.com/q/29881895
tags question: http://stackoverflow.com/q/29961430
tags question: http://stackoverflow.com/q/29847941
tags question: http://stackoverflow.com/q/29961289
tags question: http://stackoverflow.com/q/29858846
tags question: http://stackoverflow.com/q/29919345
tags question: http://stackoverflow.com/q/29948912
tags question: http://stackoverflow.com/q/29888900
tags question: http://stackoverflow.com/q/29914164
tags question: http://stackoverflow.com/q/29930354
tags question: http://stackoverflow.com/q/29876730
tags question: http://stackoverflow.com/q/29878363
tags question: http://stackoverflow.com/q/29939549
tags question: http://stackoverflow.com/q/29965573
tags question: http://stackoverflow.com/q/29973544
tags question: http://stackoverflow.com/q/30001002
tags question: http://stackoverflow.com/q/29846471
tags question: http://stackoverflow.com/q/29994380
tags question: http://stackoverflow.com/q/29946127
tags question: http://stackoverflow.com/q/29892184
tags question: http://stackoverflow.com/q/29906396
tags question: http://stackoverflow.com/q/29974108
tags question: http://stackoverflow.com/q/29919145
tags question: http://stackoverflow.com/q/29856068
tags question: http://stackoverflow.com/q/29997408
tags question: http://stackoverflow.com/q/29960438
tags question: http://stackoverflow.com/q/29918117
tags question: http://stackoverflow.com/q/29907750
tags question: http://stackoverflow.com/q/29962857
tags question: http://stackoverflow.com/q/29897612
tags question: http://stackoverflow.com/q/29980442
tags question: http://stackoverflow.com/q/29940677
tags question: http://stackoverflow.com/q/30001920
tags question: http://stackoverflow.com/q/29937593

http://stackoverflow.com/q/29967599
tagged with: javascript
score: 4
answer count: 1
has body: I know that to convert a C# date, like /Date(1430341152570)/ to a JavaScript date, it's the following: var part = "/Date(1430341152570)/".substr(6); // =&gt; "1430341152570)/" var jsDate = new Date(parseInt(part)); My question: how is the part value, which includes a trailing )/ able to be parsed into an int via parseInt? Wouldn't JS throw an error on trying to convert something that has the )/ characters? It would make more sense to me if the part value was something like "/Date(......)/".substr(6).replace(')/','') b/c at least you're making it a string of #'s to be parsed to an int.
has answer: http://stackoverflow.com/a/29967654
accepted answer: http://stackoverflow.com/a/29967654
favorite count: 0
upvote count: 4
has comment: http://stackoverflow.com/comment/48054839
type: AnsweredQuestion
downvote count: 0
has title: How does parsing a c# date to be a javascript date even work with the ')'?
type: Question
tagged with: c#

http://stackoverflow.com/q/29990953
tagged with: jquery-mobile
has answer: http://stackoverflow.com/a/29991228
tagged with: javascript
tagged with: jquery
has body: I don't understand jQuery enough to either search for the solution, or try to implement one on my own. On desktop, I use a slideToggle to show/hide content based on which button is clicked. If the content window is 'shown' I scroll the screen to the top of the '#section' holding the content. I want to disable this on Mobile, becasue the content stacks into a single column on mobile and if the user clicks on the bottom of the stack, it scrolls him back to the top of the section. This is the script: var $align = $("#features"); function slideonlyone(thechosenone) { $('.feature-box').each(function(index) { if ($(this).attr("id") == thechosenone) { $(this).slideToggle(400); $("body").animate({ scrollTop: $align.offset().top },{ duration: 1200, queue: false }) } else { $(this).slideUp(400); } }); } The site can be viewed here: www.newmarketsolar.ca If you enable the inspector and turn on mobile emulation you can see what I mean by clicking on 'learn more' button on the last icon 'interactive' - it will scroll you up - I need to turn this off for devices only up to 768px. Any help would be marvelous.
score: 0
has answer: http://stackoverflow.com/a/29991150
has title: How do I disable the scroll to $align of this script on mobile?
type: UnansweredQuestion
type: Question
answer count: 2

http://stackoverflow.com/q/29873799
favorite count: 0
has comment: http://stackoverflow.com/comment/47872926
accepted answer: http://stackoverflow.com/a/29874004
answer count: 4
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47872980
has comment: http://stackoverflow.com/comment/47872913
tagged with: cookies
score: 1
has answer: http://stackoverflow.com/a/29874004
has answer: http://stackoverflow.com/a/29873818
possible better answer: http://stackoverflow.com/a/29873827
has body: If my website writes a string into cookies using document.cookie will any website be able read those strings or only the one that created it? If anyone can read it is there a way to limit access to the string? This is a question in javascript. EDIT: I have no much problem if a third party reads my cookie they shouldn't be able to edit/delete it. Can a hacker do that?
type: Question
has answer: http://stackoverflow.com/a/29873827
has comment: http://stackoverflow.com/comment/47872993
has answer: http://stackoverflow.com/a/29873921
tagged with: javascript
has comment: http://stackoverflow.com/comment/47872885
has title: how to limit access to strings i save in cookies?
upvote count: 2
linked to: http://stackoverflow.com/q/1062963
has comment: http://stackoverflow.com/comment/47873030
downvote count: 1
has comment: http://stackoverflow.com/comment/47872888

http://stackoverflow.com/a/33591673
has body: I had a problem with npm run build not printing anything. ended up using npm run build --verbose to get the output I needed.
type: Answer
score: 2
answers question: http://stackoverflow.com/q/29939697
upvote count: 3
downvote count: 1

http://stackoverflow.com/q/29979203
tagged with: node.js
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/29979220
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/48078207
possible better answer: http://stackoverflow.com/a/29979220
has comment: http://stackoverflow.com/comment/48078009
has title: Why do people access fields in JS constructors, but not set them?
has comment: http://stackoverflow.com/comment/48078435
tagged with: javascript
has answer: http://stackoverflow.com/a/29979734
has comment: http://stackoverflow.com/comment/48078060
answer count: 3
accepted answer: http://stackoverflow.com/a/29979734
downvote count: 0
has comment: http://stackoverflow.com/comment/48078575
has comment: http://stackoverflow.com/comment/48085564
favorite count: 0
has answer: http://stackoverflow.com/a/29979242
has comment: http://stackoverflow.com/comment/48077968
has body: I've been reading lots of code that looks like this: function Constructor(foo) { this.bar; } for defining constructor methods. Ofcourse, that field read does nothing. Why is it there? In a lot of cases, I do not see comments or tags for documentation generators either.

http://stackoverflow.com/a/29881297
upvote count: 10
has comment: http://stackoverflow.com/comment/47889738
has comment: http://stackoverflow.com/comment/65262667
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/47890049
type: Answer
has body: Read more at this URL: http://www.richardfarrar.com/embedding-album-art-in-mp3-files/ What you want is to use the ID3 header, where the arists data and more is stored. Also images can be stored in these headers. Probably this is also done in the mp3 files you have. A library like https://github.com/aadsm/JavaScript-ID3-Reader can read this data out of the MP3 with Javascript. Borrowed from the example (Note: you need the library above before this code will work): function showTags(url) { var tags = ID3.getAllTags(url); console.log(tags); document.getElementById('title').textContent = tags.title || ""; document.getElementById('artist').textContent = tags.artist || ""; document.getElementById('album').textContent = tags.album || ""; var image = tags.picture; if (image) { var base64String = ""; for (var i = 0; i &lt; image.data.length; i++) { base64String += String.fromCharCode(image.data[i]); } var base64 = "data:" + image.format + ";base64," + window.btoa(base64String); document.getElementById('picture').setAttribute('src',base64); } else { document.getElementById('picture').style.display = "none"; } }
accepted answer of: http://stackoverflow.com/q/29881237
answers question: http://stackoverflow.com/q/29881237
has comment: http://stackoverflow.com/comment/133988899
score: 10
has comment: http://stackoverflow.com/comment/47889972

http://stackoverflow.com/q/29873988
type: UnansweredQuestion
score: 6
has answer: http://stackoverflow.com/a/33851778
tagged with: require
favorite count: 0
type: Question
has body: I am trying to set up a basic contact form using SengGrid and I keep getting a "Uncaught ReferenceError: require is not defined" error. I have this code in a script tag in the head of the html page. var sendgrid = require('sendgrid')(username,pass); I have looked at requirejs, but I am not sure why I am getting this error. Could someone explain to me how I can resolve this issue?
tagged with: requirejs
tagged with: node.js
has comment: http://stackoverflow.com/comment/47872985
has answer: http://stackoverflow.com/a/29874219
answer count: 2
has title: Resolve "Uncaught ReferenceError: require is not defined" error in Node.js
upvote count: 7
downvote count: 1
has comment: http://stackoverflow.com/comment/47872859
tagged with: javascript

node.js
tags question: http://stackoverflow.com/q/29864960
tags question: http://stackoverflow.com/q/29906870
tags question: http://stackoverflow.com/q/29846199
tags question: http://stackoverflow.com/q/29906688
tags question: http://stackoverflow.com/q/29906113
tags question: http://stackoverflow.com/q/29903047
tags question: http://stackoverflow.com/q/29986406
tags question: http://stackoverflow.com/q/29943088
tags question: http://stackoverflow.com/q/29905247
tags question: http://stackoverflow.com/q/29987847
tags question: http://stackoverflow.com/q/30000706
tags question: http://stackoverflow.com/q/29958076
tags question: http://stackoverflow.com/q/29999972
tags question: http://stackoverflow.com/q/29890720
tags question: http://stackoverflow.com/q/29905378
tags question: http://stackoverflow.com/q/29998921
tags question: http://stackoverflow.com/q/29884780
tags question: http://stackoverflow.com/q/29948016
tags question: http://stackoverflow.com/q/29867370
tags question: http://stackoverflow.com/q/29903562
tags question: http://stackoverflow.com/q/29850036
tags question: http://stackoverflow.com/q/29883126
tags question: http://stackoverflow.com/q/29969283
tags question: http://stackoverflow.com/q/29915361
tags question: http://stackoverflow.com/q/29995960
tags question: http://stackoverflow.com/q/29952234
tags question: http://stackoverflow.com/q/29855098
tags question: http://stackoverflow.com/q/29983476
tags question: http://stackoverflow.com/q/29859210
tags question: http://stackoverflow.com/q/29965394
tags question: http://stackoverflow.com/q/29877172
tags question: http://stackoverflow.com/q/29865973
tags question: http://stackoverflow.com/q/29883805
tags question: http://stackoverflow.com/q/29896134
tags question: http://stackoverflow.com/q/29977855
tags question: http://stackoverflow.com/q/29896589
tags question: http://stackoverflow.com/q/29960154
tags question: http://stackoverflow.com/q/29885066
tags question: http://stackoverflow.com/q/29855880
tags question: http://stackoverflow.com/q/29867234
tags question: http://stackoverflow.com/q/29963412
tags question: http://stackoverflow.com/q/29945046
tags question: http://stackoverflow.com/q/29876351
tags question: http://stackoverflow.com/q/29874454
tags question: http://stackoverflow.com/q/29951398
tags question: http://stackoverflow.com/q/29941488
tags question: http://stackoverflow.com/q/29974466
tags question: http://stackoverflow.com/q/29903483
tags question: http://stackoverflow.com/q/29997759
tags question: http://stackoverflow.com/q/30000695
tags question: http://stackoverflow.com/q/29867642
tags question: http://stackoverflow.com/q/29896322
tags question: http://stackoverflow.com/q/29909006
tags question: http://stackoverflow.com/q/29878602
tags question: http://stackoverflow.com/q/29871496
tags question: http://stackoverflow.com/q/29872317
tags question: http://stackoverflow.com/q/29941208
tags question: http://stackoverflow.com/q/29902603
tags question: http://stackoverflow.com/q/29849465
tags question: http://stackoverflow.com/q/29891293
tags question: http://stackoverflow.com/q/29920013
tags question: http://stackoverflow.com/q/29863336
tags question: http://stackoverflow.com/q/29936269
tags question: http://stackoverflow.com/q/29923192
tags question: http://stackoverflow.com/q/29930321
tags question: http://stackoverflow.com/q/29954767
tags question: http://stackoverflow.com/q/29882220
tags question: http://stackoverflow.com/q/29930464
tags question: http://stackoverflow.com/q/29914505
tags question: http://stackoverflow.com/q/29903815
tags question: http://stackoverflow.com/q/29959653
tags question: http://stackoverflow.com/q/29956855
tags question: http://stackoverflow.com/q/29867547
tags question: http://stackoverflow.com/q/29939567
tags question: http://stackoverflow.com/q/29908780
tags question: http://stackoverflow.com/q/29969647
tags question: http://stackoverflow.com/q/29896315
tags question: http://stackoverflow.com/q/29938992
tags question: http://stackoverflow.com/q/29941689
tags question: http://stackoverflow.com/q/29873732

http://stackoverflow.com/q/29891262
has answer: http://stackoverflow.com/a/29891393
score: -4
has title: Unable to use jQuery
upvote count: 1
accepted answer: http://stackoverflow.com/a/29891534
possible better answer: http://stackoverflow.com/a/29891393
has comment: http://stackoverflow.com/comment/47906902
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47906062
has comment: http://stackoverflow.com/comment/47906078
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/47908309
downvote count: 5
tagged with: javascript
tagged with: jquery
has body: When the browser loads a js file, it's working with document.getElementById("name"). But when I change to jQuery style, which is $("#name"), that particular element doesn't seem to work any more. This is how I write my script file in the HTML (right above the closing body tag) &lt;script src="http://code.jquery.com/jquery-latest.min.js"&gt; &lt;/script&gt; &lt;script src="js/form.js"&gt;&lt;/script&gt; &lt;/body&gt; Does anyone knows why jQuery doesn't work? Edit: It's just simple code, replacing all document.getElementById to $. But since you asked, this is the original js code that I've used: function formValidation() { var name = document.getElementById("name"), email = document.getElementById("email"), phone = document.getElementById("phone"), message = document.getElementById("message"), nameRe = /[a-zA-Z]/, emailRe = /^[a-zA-Z0-9._]+@[a-zA-Z0-9.]+\.[a-zA-Z]{2,4}$/, phoneRe = /[0-9]/, messageError = ""; document.getElementById("frmContact").onsubmit = function () { messageError = ""; // Validation for name, email and phone, using regular expression if (!nameRe.test(name.value)) { messageError = errorHighlight(name, "Invalid name"); } else if (!emailRe.test(email.value)) { messageError = errorHighlight(email, "Invalid email"); } else if (!phoneRe.test(phone.value)) { messageError = errorHighlight(phone, "Invalid phone"); } else if (message.value.length &lt;= 50) { messageError = errorHighlight(message, "Message must be at least 50 characters"); } // form validation if (messageError !== "") { document.getElementById("errorMessage").innerHTML = messageError; return false; } return true; }; }
has comment: http://stackoverflow.com/comment/47906045
has comment: http://stackoverflow.com/comment/47906455
has comment: http://stackoverflow.com/comment/47906043
favorite count: 0
has answer: http://stackoverflow.com/a/29891534

http://stackoverflow.com/q/29886066
tagged with: touch
score: 0
has body: I have a JQuery TouchTouch based gallery on one of my websites. It works perfect when I call it once for the photos list that was loaded with the page. Recently, I needed to add new functionality to this page (the website is online store, I'm talking about page with a product). I need to load same product of a different color without leaving the page (different URLs are still used for this purpose, but I need to change this ASAP because of duplicates affect SEO). Using AJAX, I'm loading all necessary information about product (including photos URLs) and everything is ok, except the JQTT gallery: if I don't call touchTouch() on selector that was used the first time, during the page loading - nothing works at all (that is obviously, because no photos information auto-updates provided in plugin). However, when I call touchTouch() second time on the same selector, overlay with buttons (arrows) appears, but photo is never loaded, only the loading GIF is shown permanently. I have checked this in Mozilla FireFox and Google Chrome - the same behavior. By the way, thumbnail photos are loaded fine, but displaying them is not directly related to the plugin, because they are only triggers for loading large photos. The first thing that may help, as I supposed, was a test: call touchTouch() not immediately after AJAX-request and new photos insertion in DOM, but call it after a long delay (for example, 10 secs) to make sure that problem is not in plugin's preloading features (if any) or someting similar. That didn't help. Then I made the second test: I deleted first touchTouch() call in document-ready (so, plugin doesn't work on document load), then made this call after updating photos. In this case, plugin worked fine. So, in view of the aforesaid, i'm searching for solution how to make JQTT plugin work after photos list update. The selector is always the same (I mean CSS class name that is used for every photo and that is called in $(selector).touchTouch()). Here is a real examp…
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/30009180
accepted answer: http://stackoverflow.com/a/30009180
type: Question
answer count: 1
has title: JQuery TouchTouch plugin doesn't display photos if their URLs were dynamically changed
tagged with: javascript
tagged with: jquery

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

http://stackoverflow.com/a/29901877
downvote count: 0
answers question: http://stackoverflow.com/q/29901790
has body: document.write("Wroks"); will replace everything in your window with "Wroks". try this: You also may want to consider using jQuery because then you could do a lot more out of the box with this. for example: The above code will give you the value of the input on change.
type: Answer
has comment: http://stackoverflow.com/comment/47930149
score: 3
upvote count: 3

http://stackoverflow.com/q/29874823
upvote count: 1
tagged with: local-storage
has answer: http://stackoverflow.com/a/29874852
has answer: http://stackoverflow.com/a/29900889
score: 1
has answer: http://stackoverflow.com/a/29874845
type: Question
has body: I'm trying to save a change in background-color in local storage after a button click, but it's not saved when refreshing window. Have I forgotten something? $(".btn-secondmenu").click(function(){ $(".btn-secondmenu").css('background-color', 'red'); var status = $(".btn-secondmenu"); localStorage.setItem(".btn-secondmenu", status); });
downvote count: 0
tagged with: javascript
tagged with: jquery
has title: jquery save background-color in local storage
answer count: 3
has comment: http://stackoverflow.com/comment/47874565
favorite count: 0
type: UnansweredQuestion

http://stackoverflow.com/a/29947359
has comment: http://stackoverflow.com/comment/48048363
type: Answer
downvote count: 0
score: 1
has body: Well, this was actually a stupid mistake on my behalf. I needed to wrap the deferred.resolve inside of a function. function startChain(someNeededValues) { var deferred = $q.defer(); firstApi .getData(someNeededValues.values).$promise .then(function (data) { result.value = data.value; }) .then(recurringAction) .then(function () { deferred.resolve(result); }); return deferred.promise; } Seems like $defer auto resolves or something if there is no .resolve method available.
has comment: http://stackoverflow.com/comment/48022190
has comment: http://stackoverflow.com/comment/48022452
has comment: http://stackoverflow.com/comment/48016192
has comment: http://stackoverflow.com/comment/48021823
answers question: http://stackoverflow.com/q/29945767
has comment: http://stackoverflow.com/comment/48047856
upvote count: 1
has comment: http://stackoverflow.com/comment/48029073

http://stackoverflow.com/a/29976524
has body: Okay so after a couple of restarts with Code, it seems that most of the time it will pick up the typescript definitions that you've included in other files. I think I'll still go with Steve's answer though, as that way I can avoid having a bunch of references in my code.
downvote count: 0
type: Answer
score: 1
answers question: http://stackoverflow.com/q/29974875
upvote count: 1

http://stackoverflow.com/a/29983633
answers question: http://stackoverflow.com/q/29983585
has body: The immediate problem is that the navItem is not the same value when the event is triggered much later. To fix this common issue use a scoping IIFE (immediately invoked function expression): function loadNav(nav){ for(item in nav){ var navItem = nav[item]; var element = $("&lt;div&gt;" + navItem.text + "&lt;/div&gt;"); (function(navItem){ element.click(function(){ getContent(navItem.id,navItem.type); //in practice I'm getting two click listeners with a navItem.id of 'litGL' and a navItem.type of 'b' }); })(navItem); $('#horzNav').append(element); } } Better solutions involve putting the require attributes into the injected elements, then extracting them at event time. This simplifies the event handler and removes the dependency on the original navItem variable. e.g. something like: function loadNav(nav){ for(var i = 0; i &lt; nav.length; i++){ var navItem = nav[i]; var element = $("div", {id: navItem.id}).html(navItem.text).data('type', navitem.type ).appendTo('#horzNav'); } } and use a delegated event handler with a selector: $(function () { $(document).on("click", ".navItem", function () { getContent($(this).attr("id"), $(this).data("type")); }); }); This works by listening for the event (e.g. click) to bubble up to a non-changing ancestor element (e.g. document), then applying the selector to the items in the bubble-chain, then applying the function only to those matching element that caused the event. The upshot of this is the the items only need to match at event time and not when the event was registered. Great for dynamically added items. document is the best default if no other ancestor else is closer/convenient. Do not use body for delegated events as it has a bug (styling can cause it to not get mouse events).
type: Answer
upvote count: 3
score: 3
downvote count: 0

http://stackoverflow.com/q/29886129
type: Question
has comment: http://stackoverflow.com/comment/47898247
has answer: http://stackoverflow.com/a/29887800
answer count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/47924258
has body: I want to be able to keep my map centred and zoomed according to my LatLngBounds when the viewport size changes, but not when a user drags or zooms. I'm using the "bounds_changed" event along with fitBounds() to keep it centred and zoomed properly for viewport changes, but when the map is dragged or zoomed the bounds also change so fitBounds() is essentially preventing these actions too. function initialize() { var mapProp = { center:new google.maps.LatLng(49.8994, -97.1392), zoom:1, draggable: true, zoomControl: true, scrollwheel: false, disableDoubleClickZoom: false, mapTypeId:google.maps.MapTypeId.ROADMAP }; var bounds = new google.maps.LatLngBounds( new google.maps.LatLng(49.803060, -97.229094), new google.maps.LatLng(49.963223, -97.054686) ); var map = new google.maps.Map(document.getElementById("googleMap"), mapProp); google.maps.event.addListener(map, 'bounds_changed', function() { map.fitBounds(bounds); }); } google.maps.event.addDomListener(window, 'load', initialize); According to the docs I should be able to access event properties, so I thought I'd check for something that would indicate what specifically triggered the "bounds_changed" event, but the event is showing as undefined in the console. google.maps.event.addListener(map, 'bounds_changed', function(event) { console.log(event) }); I can access properties for simple "click" event but not "bounds_changed", so I'm not sure if there is even supposed to be properties for "bounds_changed", or if there is a completely different approach to accomplishing what I'm trying to do.
has title: Determining specific user action that triggers a "bounds_changed" event
tagged with: google-maps
upvote count: 0
tagged with: javascript
type: UnansweredQuestion
tagged with: google-maps-api-3
favorite count: 0
score: -1

http://stackoverflow.com/comment/48128249
score: 0
type: Comment
has text: disregard the help in the chat Samurai, I was able to figure something out, I had to add another variable and change the last portion in my javascript file from an "else" statement to an "else if"
type: AnswerComment
comment on: http://stackoverflow.com/a/29996889

http://stackoverflow.com/comment/47840296
type: AnswerComment
score: 0
type: Comment
has text: Also sorry, I do not know JS, just wrote a general answer
comment on: http://stackoverflow.com/a/29857106

http://stackoverflow.com/comment/71134012
type: Comment
score: 2
has text: `Uncaught Error: Cannot find module ''.` at the line `req([])`, why doesn't it work?
comment on: http://stackoverflow.com/a/34252626
type: AnswerComment

arrays
tags question: http://stackoverflow.com/q/29969062
tags question: http://stackoverflow.com/q/29999657
tags question: http://stackoverflow.com/q/29932181
tags question: http://stackoverflow.com/q/29956294
tags question: http://stackoverflow.com/q/29856541
tags question: http://stackoverflow.com/q/29976664
tags question: http://stackoverflow.com/q/29981401
tags question: http://stackoverflow.com/q/29931900
tags question: http://stackoverflow.com/q/29924697
tags question: http://stackoverflow.com/q/29976616
tags question: http://stackoverflow.com/q/29972211
tags question: http://stackoverflow.com/q/29958234
tags question: http://stackoverflow.com/q/29906602
tags question: http://stackoverflow.com/q/29891698
tags question: http://stackoverflow.com/q/29953480
tags question: http://stackoverflow.com/q/29991473
type: Tag
tags question: http://stackoverflow.com/q/29987432
tags question: http://stackoverflow.com/q/29991016
tags question: http://stackoverflow.com/q/29983778
tags question: http://stackoverflow.com/q/29878639
tags question: http://stackoverflow.com/q/29883144
tags question: http://stackoverflow.com/q/29924032
tags question: http://stackoverflow.com/q/29847647
tags question: http://stackoverflow.com/q/29934583
tags question: http://stackoverflow.com/q/29978007
tags question: http://stackoverflow.com/q/29888900
tags question: http://stackoverflow.com/q/29872731
tags question: http://stackoverflow.com/q/29989854
tags question: http://stackoverflow.com/q/29898573
tags question: http://stackoverflow.com/q/29942698
tags question: http://stackoverflow.com/q/29918117
tags question: http://stackoverflow.com/q/29992582
tags question: http://stackoverflow.com/q/29884597
tags question: http://stackoverflow.com/q/29956151
tags question: http://stackoverflow.com/q/29915540
tags question: http://stackoverflow.com/q/29924905
tags question: http://stackoverflow.com/q/29942339
tags question: http://stackoverflow.com/q/29978252
tags question: http://stackoverflow.com/q/29849573
tags question: http://stackoverflow.com/q/29847988
tags question: http://stackoverflow.com/q/29863302
tags question: http://stackoverflow.com/q/29903524
tags question: http://stackoverflow.com/q/29901544
tags question: http://stackoverflow.com/q/29991455
tags question: http://stackoverflow.com/q/29900535
tags question: http://stackoverflow.com/q/29898985
tags question: http://stackoverflow.com/q/29979066
tags question: http://stackoverflow.com/q/29986339
tags question: http://stackoverflow.com/q/29952458
tags question: http://stackoverflow.com/q/29909726
tags question: http://stackoverflow.com/q/29901333
tags question: http://stackoverflow.com/q/29885020
tags question: http://stackoverflow.com/q/29871445
tags question: http://stackoverflow.com/q/29848617
tags question: http://stackoverflow.com/q/29964764
tags question: http://stackoverflow.com/q/29944171
tags question: http://stackoverflow.com/q/29995428
tags question: http://stackoverflow.com/q/29945774
tags question: http://stackoverflow.com/q/29884119
tags question: http://stackoverflow.com/q/29985121
tags question: http://stackoverflow.com/q/29980563
tags question: http://stackoverflow.com/q/29964962
tags question: http://stackoverflow.com/q/29925093
tags question: http://stackoverflow.com/q/29958134
tags question: http://stackoverflow.com/q/29893416
tags question: http://stackoverflow.com/q/29906901
tags question: http://stackoverflow.com/q/29874075
tags question: http://stackoverflow.com/q/29981943
tags question: http://stackoverflow.com/q/29879904
tags question: http://stackoverflow.com/q/29951293
tags question: http://stackoverflow.com/q/29883151
tags question: http://stackoverflow.com/q/29924232
tags question: http://stackoverflow.com/q/29976050
tags question: http://stackoverflow.com/q/29930010
tags question: http://stackoverflow.com/q/29886489
tags question: http://stackoverflow.com/q/29932238
tags question: http://stackoverflow.com/q/29885030
tags question: http://stackoverflow.com/q/29972301
tags question: http://stackoverflow.com/q/29932336

http://stackoverflow.com/comment/136950660
score: 0
type: Comment
comment on: http://stackoverflow.com/a/77654771
has text: I made a confusion. My solution is the best way of compare two dates is the same
type: AnswerComment

http://stackoverflow.com/a/54887525
upvote count: 2
answers question: http://stackoverflow.com/q/29876185
has body: here is another example for changing the arrows and using your own arrow-images. .slick-prev:before { background-image: url('images/arrow-left.png'); background-size: 50px 50px; display: inline-block; width: 50px; height: 50px; content:""; } .slick-next:before { background-image: url('images/arrow-right.png'); background-size: 50px 50px; display: inline-block; width: 50px; height: 50px; content:""; }
type: Answer
score: 2
downvote count: 0

http://stackoverflow.com/q/29881068
answer count: 1
has title: document.getElementById(id) where id is variable
tagged with: javascript
tagged with: variables
favorite count: 0
has comment: http://stackoverflow.com/comment/47889432
has body: I would like your assistance with some functions I'm trying to develop. The code I'm working with: function ApplyModificationDate (){ var results; var today; var moddatestable; var arrayID; results = getIframeTableContent('reportresults'); var arrayID = [100,101,102,103,104,105,106]; for(var i=0;i&lt;arrayID.length;i++){ if(arrayID[i]==results[i][1]) document.getElementById(arrayID[i]).innerHTML = results[i][1]; } } The getIframeTableContent is a function that collects the data from an iframe and works fine. The results is an array of two columns.The 1st column has the ids and the 2nd the last modification date for each id. I want to check the id's of the arrayID with results values and appear the date, however there is an error in IE console and the dates are not appearing( Unable to set value of the property 'innerHTML': object is null or undefined). With The second function i want to check whether the date is older than 7 days from today .In that case i would like date to become bold.Again i tried with the following function but doesn't work. function CheckModDate(){ today = new Date(); var dd = today.getDate(); var mm = today.getMonth()+1; var yyyy = today.getFullYear(); if(dd&lt;10) { dd='0'+dd } if(mm&lt;10) { mm='0'+mm } today = dd+'/'+mm+'/'+yyyy; moddatestable = [100,101,102,103,104,105,106]; for(var i=0;i&lt;moddatestable.length;i++){ if((today - document.getElementById(moddatestable[i]).innerHTML)&lt;=7) document.getElementById(moddatestable[i]).innerHTML.style.fontWeight = 'bold'; } } Any help is welcome , Thank you
has comment: http://stackoverflow.com/comment/47945915
tagged with: getelementbyid
has answer: http://stackoverflow.com/a/29881258
has comment: http://stackoverflow.com/comment/47886756
has comment: http://stackoverflow.com/comment/47886446
has comment: http://stackoverflow.com/comment/47912050
upvote count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47890699
downvote count: 1
has comment: http://stackoverflow.com/comment/47901029
type: Question
has comment: http://stackoverflow.com/comment/47900150
has comment: http://stackoverflow.com/comment/47912180
score: -1
has comment: http://stackoverflow.com/comment/47889230

http://stackoverflow.com/q/29925541
has comment: http://stackoverflow.com/comment/47972810
score: 0
duplicate of: http://stackoverflow.com/q/5891840
has comment: http://stackoverflow.com/comment/47972701
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47972788
linked to: http://stackoverflow.com/q/5891840
answer count: 0
has body: I have multiple outputs in html. I want to reach them with for loop. For example: unitsTotal = 4; Then I want to have (output1, tag1), (output2, tag2), (output3, tag3), (output4, tag4). And I don't know how to pass i inside a string. Can someone help me with doing that? Maybe there is a better idea how to make it. for (var i = 1; i &lt; unitsTotal; i += 1) { $(':input[name="output"]').val(output1.toFixed(5).toString()); $('#output').text(tag1); }
has comment: http://stackoverflow.com/comment/47972734
type: Question
has comment: http://stackoverflow.com/comment/47972690
tagged with: javascript
tagged with: jquery
has title: Passing index value from for loop to a string

http://stackoverflow.com/comment/57604085
comment on: http://stackoverflow.com/a/29879374
has text: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/class lead me to believe that class name [extends] { // class body } means [extends] is an array of classes which would all be mixed into the new class. then again, how would "super()" work?
type: AnswerComment
type: Comment
score: 1

http://stackoverflow.com/comment/48060770
comment on: http://stackoverflow.com/a/29970079
has text: Thanks! I hate when it's so simple, but I never would've figured it out on my own!
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/comment/48169795
type: Comment
comment on: http://stackoverflow.com/a/30022458
type: AnswerComment
has text: Very simple thought. For an answers like that I wait for a couple days.. +1 I like that :)
score: 0

http://stackoverflow.com/q/29996036
possible better answer: http://stackoverflow.com/a/29996160
answer count: 2
has answer: http://stackoverflow.com/a/29996160
downvote count: 0
has body: So whenever the scrollTop of my page reaches 1, it will automatically scroll down to another location on the page (this is demonstrated in the JSFiddle more clearly). This does work, but however trying to remove a class from a menu item (so that it becomes "unselected"), problems occur. The element doesn't seem to get the properties of the other class and shows as standard text (again, look at the JSFiddle for a demonstration). I was wondering how to fix this. The following code is where my problems occur: Home Over Contact .menuItem { padding-top: 29px; height: calc(100% - 29px); border: 0; text-align: center; font-family: Signika; font-size: 25px; color: rgb(203, 207, 218); } .selected { border-bottom: 4px solid rgb(59, 89, 202); height: calc(100% - 33px); color: rgb(160, 170, 218); } var homeButton = document.getElementById("homeButton"); var aboutButton = document.getElementById("overButton"); homeButton.className = homeButton.className - " selected"; aboutButton.className = aboutButton.className + " selected";
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has title: Trying to remove a class with JavaScript, element doesn't take properties of other class
tagged with: css
has answer: http://stackoverflow.com/a/29996114
type: AnsweredQuestion
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/48111638
has comment: http://stackoverflow.com/comment/48111677
type: Question
accepted answer: http://stackoverflow.com/a/29996114
tagged with: javascript
has comment: http://stackoverflow.com/comment/48112019

http://stackoverflow.com/q/29931291
tagged with: javascript
tagged with: jquery
score: 0
answer count: 3
has comment: http://stackoverflow.com/comment/47984975
has title: Holding on a function for a specific time
has comment: http://stackoverflow.com/comment/47984990
has comment: http://stackoverflow.com/comment/47985106
has answer: http://stackoverflow.com/a/29931364
has comment: http://stackoverflow.com/comment/47984974
has answer: http://stackoverflow.com/a/29931481
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/29931364
accepted answer: http://stackoverflow.com/a/29931481
type: Question
has answer: http://stackoverflow.com/a/29931399
has comment: http://stackoverflow.com/comment/47984920
has body: so this is kind of a weird question i am working on a project where i am required to Hold something off for a period of time using javascript, such as sending info to another page for example but, i do not want that line of code executing untill Midnight pseudo code if(midnight){ do this } This is the simplest way i could explain what i am trying to do, i know setInterval only goes with milliseconds and its pretty difficult (well for me) to get it to run every day at 12am(midnight) any suggestion &amp; advice would be great, thank you !

http://stackoverflow.com/q/29898059
type: Question
has answer: http://stackoverflow.com/a/29898111
has answer: http://stackoverflow.com/a/29898116
accepted answer: http://stackoverflow.com/a/29898116
tagged with: javascript
score: 0
answer count: 3
has comment: http://stackoverflow.com/comment/47918846
has comment: http://stackoverflow.com/comment/47918831
has answer: http://stackoverflow.com/a/29898114
has body: i have a loop in this loop i want to populate my array photos: $scope.photos = []; var str = data.data.Photos; var res = str.split('|'); angular.forEach(res, function (item) { var line = src: 'photos/'+item, desc: item; $scope.photos.push(line); }); i have errors in the line var line = src: 'photos/'+item, desc: item;: Unexpected token
tagged with: angularjs
possible better answer: http://stackoverflow.com/a/29898111
type: AnsweredQuestion
has title: How to put line in array

http://stackoverflow.com/comment/47944533
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/29911246
type: Comment
has text: @ArunPJohny I know. I asked in my question, "without passing in the number as a string".

http://stackoverflow.com/comment/47972078
score: 0
type: Comment
has text: Thanks again for your help, i have solved the issue now. There was one more problem i had which was that it was always outputting the first contract in the object, i managed to fix this myself though, the reason was that I had been using the variable 'i' in both loops, so i simply changed the variable of one of the loops.
comment on: http://stackoverflow.com/a/29922080
type: AnswerComment

web-services
tags question: http://stackoverflow.com/q/29847358
type: Tag
tags question: http://stackoverflow.com/q/29978009
tag name: web-services

http://stackoverflow.com/comment/47997254
type: QuestionComment
has text: With the snippet above, you only declare the function that updates the `TextBox`. Also, you need to call the function in a place in your page where the `TextBox` has already appeared.
score: 0
comment on: http://stackoverflow.com/q/29937886
type: Comment

http://stackoverflow.com/q/29942259
favorite count: 0
has answer: http://stackoverflow.com/a/29942349
has comment: http://stackoverflow.com/comment/48005362
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29942338
tagged with: jakarta-ee
linked to: http://stackoverflow.com/q/11922383
has comment: http://stackoverflow.com/comment/48005535
tagged with: http://stackoverflow.com/tag/json
downvote count: 3
has body: i want have a value for a specific key may be nested value also like change value of key1 to value100 or key11 to value111. { "key1": "value1", "key2": "value2", "key3": "value3", "map1" : {"key4":"value4", "key5":"value5", "key6":"value6", "map2" : { "key7":"value7", "key8":"value8", "key9":"value9", "map3" : { "key10":"value10", "key11":"value11", "key12":"value12" }, "map4" : { "key13":"value13", "key14":"value14", "key15":"value15" } } } } how to achieve this using javascript or jquery. please help me to find out the issue.
duplicate of: http://stackoverflow.com/q/11922383
type: Question
has title: how to edit JSON value using Javascript or Jquery
answer count: 2
upvote count: 0
tagged with: javascript
tagged with: jquery
score: -3

http://stackoverflow.com/comment/47833540
has text: @CMYJ Finally, I found a solution that fits your exact requirement with vibrant colors from 1 to 16,777,215, if you will indulge my solution below.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29851873

http://stackoverflow.com/comment/47934990
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29906058
type: Comment
has text: Indeed, corrected it. That's what I get for not testing first. Also not 100% sure this is what the you want to do, but we'll see!

http://stackoverflow.com/comment/48048403
comment on: http://stackoverflow.com/a/29961132
score: 0
type: AnswerComment
type: Comment
has text: There is no Select tag

http://stackoverflow.com/a/29924964
has body: You can use the instanceof operator: function isSet(candidate) { return candidate instanceof Set; } If the candidate object has Set.prototype in its prototype chain, then the instanceof operator returns true. edit &mdash; while the instanceof thing will work most of the time, there are situations in which it won't, as described in Bergi's answer.
type: Answer
has comment: http://stackoverflow.com/comment/47971520
has comment: http://stackoverflow.com/comment/72324637
upvote count: 12
has comment: http://stackoverflow.com/comment/47971602
has comment: http://stackoverflow.com/comment/72324580
answers question: http://stackoverflow.com/q/29924932
has comment: http://stackoverflow.com/comment/72325098
has comment: http://stackoverflow.com/comment/72324486
score: 12
downvote count: 0
has comment: http://stackoverflow.com/comment/47971768
has comment: http://stackoverflow.com/comment/72324709

http://stackoverflow.com/comment/47872587
score: 0
has text: I went for `THREE.Object3D.extend = Class.extend;` and it seems to have worked. Am I doing something wrong? (using [John Resig's Simple JavaScript Inheritance](http://ejohn.org/blog/simple-javascript-inheritance/))
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29873583

http://stackoverflow.com/q/29913204
type: AnsweredQuestion
score: 1
upvote count: 1
accepted answer: http://stackoverflow.com/a/29914414
possible better answer: http://stackoverflow.com/a/29914132
type: Question
tagged with: c#
tagged with: asp.net-mvc
has body: In my web app, I am sending some strings from the server, and I am using them like this in my JS var Texts = { FillAllFieldsError: '@Texts.FillAllFieldsError', PasswordChangeSuccess: '@Texts.PasswordChangeSuccess' } The strings which are coming from the server have some special characters like "Ø,Æ" etc.. They turn up into something with HTML code "foresp&amp;#248;rsel". Does anybody know how to solve it? I am using utf-8 encoding &lt;meta charset="utf-8" /&gt;
tagged with: javascript
has answer: http://stackoverflow.com/a/29914163
has answer: http://stackoverflow.com/a/29914414
downvote count: 0
has answer: http://stackoverflow.com/a/29914132
favorite count: 0
has title: Special Characters turn to html code C#
has answer: http://stackoverflow.com/a/29921476
tagged with: razor
answer count: 4

http://stackoverflow.com/q/29937593
score: 2
has answer: http://stackoverflow.com/a/29938098
has answer: http://stackoverflow.com/a/29937951
type: Question
downvote count: 0
tagged with: javascript
has title: Dynamically validate user selection using ajax/Javascript
tagged with: jquery
favorite count: 0
tagged with: ajax
upvote count: 2
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29937871
tagged with: mysqli
has answer: http://stackoverflow.com/a/29937862
tagged with: php
has body: See below my simple html form. I want a user to pick a product from the dropdown list.After this, proceed to pick quantity from the next dropdown list and add to cart. Here is the question: at the point of selecting the quantity, I want the system to dynamically go to the Database(PHP/MYSQL), compare the database qty with the selected value. If it is greater than the stock value(total value in DB), then it should pop up a message like alert box and disable the submit buttom, otherwise it should add to cart and enable the submit button. I have looked at many ajax examples and help, but hasn't been able to get it. Will appreciate a sample/modification if necessary. Product Name: Select <?php while ($line = mysqli_fetch_array($query, MYSQL_ASSOC)) { ?> <option value="<?php echo $line['prod_name'];?>"><?php echo $line['prod_name'];?> <?php } ?> Quantity: |
answer count: 4

http://stackoverflow.com/a/29988012
type: Answer
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/29987763
has body: Try this: $(document).ready(function() { $('#button').click(function(event) { event.preventDefault(); var text= $('#poster').val(); if (text === '') { alert('Nothing to post!'); return; } $('#posts').prepend("&lt;div class='post'&gt;" + text + "&lt;span class='close-post'&gt;&amp;times;&lt;/span&gt;&lt;/div&gt;"); $('#poster').val(''); }); $('#posts').on('click', '.close-post', function() { $(this).closest('.post').fadeOut(); }); }); JSFiddle
upvote count: 2

http://stackoverflow.com/a/29878842
type: Answer
answers question: http://stackoverflow.com/q/29878602
score: 0
has body: require will return a reference to whatever is the module places into its exports property. You are saying that the file contains many more functions than what you see when you print the object with console.log. Number of functions in the file doesn't matter. It's the exports that matter. https://nodejs.org/api/modules.html#modules_module_exports As for console.log, it will call util.inspect on the supplied object to build a string representation of it. It writes to the process's STDOUT (standard output) stream. https://nodejs.org/api/console.html#console_console_log_data

http://stackoverflow.com/q/29870789
has title: Dynamically adding and updating style block
tagged with: css
has comment: http://stackoverflow.com/comment/47866753
has comment: http://stackoverflow.com/comment/47866906
has body: Currently I am doing something like this: function newFont(newSizeA, newSizeB) { var elem = document.getElementById('style-1'); if (typeof(elem) != 'undefined' &amp;&amp; elem != null) { removeChildNodes(elem); // function that removes child nodesremoveNode(elem); } var styleText = ".a { font-size:" + newSizeA + "px; } .b { font-size:" + newSizeB + "px; }"; var x = document.createElement('style'); x.setAttribute("type", "text/css"); x.setAttribute("id", "style-1"); if (x.styleSheet) { // for IE x.styleSheet.cssText = styleText; } else { // others var textnode = document.createTextNode(styleText); x.appendChild(textnode); } } The point of it is that there is a loop happening and another function is measuring the size of a menu to make sure it fits in a spot when someone is changing the font size. I am wondering, is there a better way to create and manipulate elements? I need to change padding and font size but right now as you can see I'm just removing it entirely and recreating it.
has answer: http://stackoverflow.com/a/29872026
has comment: http://stackoverflow.com/comment/47867239
has comment: http://stackoverflow.com/comment/47867206
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/47867224
has comment: http://stackoverflow.com/comment/47866828
has comment: http://stackoverflow.com/comment/47867084
score: 0
has comment: http://stackoverflow.com/comment/47866985
linked to: http://stackoverflow.com/q/195951
answer count: 1
has comment: http://stackoverflow.com/comment/47867180
has comment: http://stackoverflow.com/comment/47867024
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/47924903
comment on: http://stackoverflow.com/a/29890274
type: AnswerComment
score: 0
has text: thank you for reply. I read again and yes I have to get refresh token from server request. Apologies.
type: Comment

http://stackoverflow.com/a/29934283
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/29933597
has body: try this in javascript Show Hide
downvote count: 0
score: 1

http://stackoverflow.com/comment/48610106
type: Comment
comment on: http://stackoverflow.com/a/29982951
score: 0
type: AnswerComment
has text: I think you can see the Django Signal framework, it's helpful to you.

http://stackoverflow.com/comment/47829757
type: Comment
has text: See my edit. My method does not create the datepicker. Your script is changing the options then creating the datepicker.
comment on: http://stackoverflow.com/a/29851589
type: AnswerComment
score: 0

http://stackoverflow.com/comment/47845329
comment on: http://stackoverflow.com/q/29859657
type: Comment
has text: I'm going to need to write that data anyway for what I'm doing next
score: 0
type: QuestionComment

http://stackoverflow.com/comment/47981998
type: Comment
type: QuestionComment
has text: If it's a proper crash it should be reported to Chrome team at https://crbug.com/ (try to [enable logging](https://www.chromium.org/for-testers/enable-logging) and see the exact error)
score: 0
comment on: http://stackoverflow.com/q/29929734

http://stackoverflow.com/comment/47820867
has text: Your `if` returns `true`, hence the output.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29847553

http://stackoverflow.com/a/29938402
type: Answer
score: 1
upvote count: 1
has body: In most browsers, this is the default behavior when the letter is at the beginning of the label instead of the end, so you might try that. Otherwise, you might add a class to the option that should be "highlighted", then use CSS to style that class however you want. You would want to remove that class from all options on mouse move or keydown so the dual highlighting (native plus your CSS) isn't too confusing. I don't know if you can use CSS to remove the native highlighting altogether, but that would be nice. Then it's just a matter of setting the value correctly when the select element loses focus, which is trivial.
accepted answer of: http://stackoverflow.com/q/29937765
answers question: http://stackoverflow.com/q/29937765
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/a/29936285
score: 0
answers question: http://stackoverflow.com/q/29936008
type: Answer
has body: You can try some thing like this !!! < OPEN Hope this helps !!!

http://stackoverflow.com/q/29937183
has title: How do I disable text areas based on what radio button is checked when the page loads?
type: Question
has comment: http://stackoverflow.com/comment/47996062
possible better answer: http://stackoverflow.com/a/29937412
score: 0
answer count: 2
tagged with: radio-button
tagged with: javascript
tagged with: jquery
has body: I want to improve upon this script for disabling text areas by radio button selection. Currently when "yes" is selected the text areas should be disabled and enabled when "no" is selected. What do I need to change so the text areas are disabled when the page first loads and if the correct radio button is checked?(yes is checked by default if no change has been made) Please bare in mind this page will be refreshed and redirected to so I will need to check the actual selection on the radio buttons. I was just setting them to all be disabled on load before but this disabled text areas even when I had the correct radio button selected. HTML Yes No Yes No Yes No Javascript/JQuery $(function () { var $choices = $(".group").find(":radio"); $choices.on("change", function () { var $this = $(this); var choiceName = $this.attr('name'); var tarea = $('[data-trigger="' + choiceName + '"]'); if ($this.val() === "yes") { tarea.val(''); tarea.prop('readonly', true); tarea.css('background-color', '#EBEBE4'); } else { tarea.prop('readonly', false); tarea.css('background-color', '#FFFFFF'); } }); }); Hope that's clear enough.
has answer: http://stackoverflow.com/a/29937351
accepted answer: http://stackoverflow.com/a/29937351
has answer: http://stackoverflow.com/a/29937412
type: AnsweredQuestion

http://stackoverflow.com/q/29882361
tagged with: cross-browser
favorite count: 0
has answer: http://stackoverflow.com/a/79530601
has answer: http://stackoverflow.com/a/37116207
type: AnsweredQuestion
upvote count: 160
has answer: http://stackoverflow.com/a/51022521
possible better answer: http://stackoverflow.com/a/37116207
type: Question
has answer: http://stackoverflow.com/a/77834740
answer count: 8
has answer: http://stackoverflow.com/a/61328832
has answer: http://stackoverflow.com/a/67482795
has comment: http://stackoverflow.com/comment/48166294
has title: Show datalist labels but submit the actual value
has answer: http://stackoverflow.com/a/29882539
accepted answer: http://stackoverflow.com/a/29882539
tagged with: javascript
has body: Currently the HTML5 element is supported in most major browsers (except Safari) and seems like an interesting way to add suggestions to an input. However, there seem to be some discrepancies between the implementation of the value attribute and the inner text on the . For example: The answer This is handled differently by different browsers: Chrome and Opera: FireFox and IE 11: After selecting one, the input is filled with the value and not the inner text. I only want the user to see the text ("The answer") in the dropdown and in the input, but pass the value 42 on submit, like a select would. How can I make all browsers have the dropdown list show the labels (inner text) of the s, but send the value attribute when the form is submitted?
has comment: http://stackoverflow.com/comment/48180306
has answer: http://stackoverflow.com/a/55808183
score: 160
has comment: http://stackoverflow.com/comment/47891155
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
tagged with: html-datalist

http://stackoverflow.com/q/29960323
score: -2
tagged with: jquery-mobile
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
accepted answer: http://stackoverflow.com/a/29960525
has body: Service Strategies 50-Peer and/or Family Delivered 51-Psychcoeducation 52-Family Support 53-Supportive Education 54-Part W/Law Enforcement 55-Peer and/or Family Delivered 56-Psychcoeducation 57-Family Support 58-Supportive Education 59-Part W/Law Enforcement 60-Peer and/or Family Delivered I have a a select menu in my j query mobile site and i need to add scroll bar to select menu when it shows more number of options.how to do this..than x in advance
has title: how to add a scrollbar to jquery mobile select menu
has answer: http://stackoverflow.com/a/29960525
downvote count: 2
type: AnsweredQuestion
type: Question
upvote count: 0

http://stackoverflow.com/comment/48066099
has text: Yep. `Object.create` always returns an object, even if `obj`'s prototype was `Array`. Using `new obj.constructor` is a little bit less idiomatic and could cause errors, but creates a new array correctly.
type: Comment
comment on: http://stackoverflow.com/a/29972417
score: 0
type: AnswerComment

http://stackoverflow.com/comment/47980562
comment on: http://stackoverflow.com/a/29929028
type: AnswerComment
has text: @DanielBogart sounds like yes. Well, the naive approach would be to have a `while index < limit` loop maintaining the index manually in the loop, repeating `element.all` calls on every iteration and use `get(index)` to get the n-th element. Let me know if you need an example.
type: Comment
score: 1

http://stackoverflow.com/q/29877248
tagged with: innertext
has answer: http://stackoverflow.com/a/29877394
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47878674
has comment: http://stackoverflow.com/comment/47878725
downvote count: 1
type: Question
has body: I'm probably not using the correct term. What I want to achieve is to 'mirror' or 'sync' a variable in javascript. I have the following code: class myClass { constructor(elem) { this.text = elem.innerText; } } This doesn't change the innerText property of elem. How would I configure the variable[s] to make them 'mirror' each other? P.S I have had a hard time googling around on this one because I don't know the term for what I'm trying to achieve.
has answer: http://stackoverflow.com/a/29877358
accepted answer: http://stackoverflow.com/a/29877394
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/47878962
possible better answer: http://stackoverflow.com/a/29877358
answer count: 3
upvote count: 0
has answer: http://stackoverflow.com/a/29877372
favorite count: 0
has comment: http://stackoverflow.com/comment/47878809
has title: How to 'mirror' a property in JavaScript?

http://stackoverflow.com/a/29913773
downvote count: 0
has body: It could be some grammar mistakes on your part, but I assume you mean the three round page-indicators. add this css to hide them. .slider-pager{ display:none; }
type: Answer
answers question: http://stackoverflow.com/q/29913655
upvote count: 1
score: 1

http://stackoverflow.com/comment/47936938
has text: @SMcCrohan good catch, updated
comment on: http://stackoverflow.com/q/29906901
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29864903
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29864992
score: 0
has title: Slick 'autoplay' does not starts automatically
upvote count: 1
downvote count: 1
type: Question
tagged with: javascript
answer count: 1
has body: So I have site and I'm using Slick.js in the gallery to show images, I also use Angularjs. The problem is that 'autoplay' does not triggered when this function called when the controller loaded to the site. // Set up slick carousel. function setCarousel() { console.log( "carousel started" ); $('.single-item').slick( {, autoplay: true, slide: 'div', autoplaySpeed: 2000, dots : true }); }; So the function is called whenever the user selects the gallery site where the controller is: myApp.controller( 'pageController', ['$scope', '$http', function ($scope, $http ) { setCarousel(); } ] );
favorite count: 0

http://stackoverflow.com/q/30001620
has title: RaphaelJS animation loop
has comment: http://stackoverflow.com/comment/48143535
has comment: http://stackoverflow.com/comment/48134220
has comment: http://stackoverflow.com/comment/48143530
type: Question
has comment: http://stackoverflow.com/comment/48176756
accepted answer: http://stackoverflow.com/a/30053993
tagged with: raphael
score: 0
has comment: http://stackoverflow.com/comment/48124088
has body: I need help with adding a loop to my raphaelJS animation. The idea is to hit the button id="1" to rotate the purple square 120degrees. If you hit button id="2", the purple square will rotate 120degrees to the left instead. I've accomplished to add the function which they both rotates, though the problem is that you can only click the order of, button id="1", button ID="2", 1, 2, , 1, 2, etc. To clarify, you can't rotate the blue square twice the same direction, you'll have to alternate between button 1/2. Second, you can't start with rotate left function. To be able to use rotate left you'll first have to rotate it to the right. So what I need help with: Be able to use the function multiple times. To summarize the function: By hitting the button, the purple square transforms by rotating 120degrees to the right.The animation timer is set to happen over 2 seconds. Adding a bounce effect to it. Here is the rotate right function. The rotate left function is exactly the same except the transform part. And then I tried to solve this by adding ".repeat(Infinity)", but it had no effect. //Turn right p.rect(10, 80, 50, 25) .attr({ fill : "grey", "stroke-width" : 1 }).click(function(){ purpleRect.animate({ transform : "r120", }, 2000, "bounce").repeat(Infinity); }); }; The purple square itself: window.onload = function(){ var p = Raphael(0, 0, 240, 140); p.rect(0,0,240,70); var purpleRect = p.rect(10, 10, 50, 50) .attr({ fill : "#aaaaff", "stroke-width" : 3 });
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/30053993
has comment: http://stackoverflow.com/comment/48146549
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/48147237
type: AnsweredQuestion

http://stackoverflow.com/comment/47959199
type: AnswerComment
type: Comment
has text: You put into words what I felt and couldn't really find the right words to describe. The TypeScript code does compile and produces JavaScript output
score: 3
comment on: http://stackoverflow.com/a/29918884

http://stackoverflow.com/comment/48077488
score: 0
type: AnswerComment
has text: Yeah i know, but i wonder how i can display, everything the user typed in. and not the "done" word.
type: Comment
comment on: http://stackoverflow.com/a/29978911

http://stackoverflow.com/a/29967295
answers question: http://stackoverflow.com/q/29967257
type: Answer
has comment: http://stackoverflow.com/comment/48054984
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/48054846
has comment: http://stackoverflow.com/comment/48054319
has comment: http://stackoverflow.com/comment/48054221
has comment: http://stackoverflow.com/comment/48054564
downvote count: 0
has comment: http://stackoverflow.com/comment/48055121
has comment: http://stackoverflow.com/comment/48054993
has body: pop() does remove the last element, but it also returns the element which was removed. You just need to access the original array: $("button").on("mouseenter",function(){ var arr = $("div").attr('class').split(' '); // Split the class into the array arr.pop(); // Remove the last element // Make sure we're left with at least one class if(arr.length) console.log(arr[arr.length-1]); // Prints "second" }); Working Example
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29967257
has comment: http://stackoverflow.com/comment/48054751

http://stackoverflow.com/comment/48052709
score: 0
has text: try opening the same link from another browser too.
type: Comment
comment on: http://stackoverflow.com/q/29965394
type: QuestionComment

http://stackoverflow.com/comment/47907842
type: QuestionComment
type: Comment
has text: Define what you mean by *"the scrollOverflow option is not working properly"*.
comment on: http://stackoverflow.com/q/29882979
score: 0

http://stackoverflow.com/a/30818845
has comment: http://stackoverflow.com/comment/58410808
has body: Checkout the pdfmake Playground (It is supposed to work in the browser and is MIT-licensed.) Select TABLES in the top menu of the Playground. Scroll down the example pdf, there is a section illustrating Colspan-capabilities.
answers question: http://stackoverflow.com/q/29889781
score: 2
upvote count: 2
downvote count: 0
type: Answer

http://stackoverflow.com/a/29990758
type: Answer
accepted answer of: http://stackoverflow.com/q/29976787
has body: So the problem is for the url. Your url is improper when using chrome.tabs.create, because %22 indicates the character " in ASCII Encoding Reference. You should strip it off in the url when you get the element in html. Glad it helps!
score: 2
answers question: http://stackoverflow.com/q/29976787
type: AcceptedAnswer
downvote count: 0
upvote count: 2

http://stackoverflow.com/a/29864878
score: 2
upvote count: 2
has body: This validation schema should work: Joi.array().items(Joi.string().trim().lowercase()).unique().min(1).max(3).required();
accepted answer of: http://stackoverflow.com/q/29864727
type: AcceptedAnswer
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/29864727

http://stackoverflow.com/a/33492714
score: 0
type: Answer
has body: Instead of bundlePath use the bundle path "/Scripts/bundles/scripts" . it'll work.
answers question: http://stackoverflow.com/q/29942322

http://stackoverflow.com/comment/47854517
comment on: http://stackoverflow.com/a/29862039
type: AnswerComment
score: 0
has text: I am esentially doing it that way, but there is more than just one ajax request. I got multiple requests, tons of large images, complex SVGs which might take a while to construct the HTML code for and more. Thus it's a quite a lot of work to detect when everything is done, which is the reason why I am looking for a cleaner solution.
type: Comment

http://stackoverflow.com/comment/58999142
has text: @DanPantry In order for code within multiple promises to run asynchronously, the executor function of each promise would have to be called in succession synchronously, so that there's no waiting between the initiation of successive promises. Where is the official statement about when the executor function gets called? Is the executor function required to be called (synchronously) with the creation of a promise? I suspect that a clear answer won't use the words "synchronous" or "asynchronous" and will just tell exactly where the executor is called.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29963279
type: AnswerComment

http://stackoverflow.com/comment/48082764
comment on: http://stackoverflow.com/a/29981650
score: 0
type: AnswerComment
type: Comment
has text: The argument to slice is optional. `.slice()` will work as well.

http://stackoverflow.com/q/29889507
answer count: 1
tagged with: javascript
has body: Here is my code, &lt;svg height="210" width="400"&gt; &lt;path stroke="#C4C24A" fill="red" d="M50 50 L100 50 L100 100 L150 100" /&gt; &lt;/svg&gt; in this code i have used fill and stroke while run this the fill and stroke both's are applied. here i have used MoveTo LineTo LineTo... another one , &lt;svg height="210" width="400"&gt; &lt;path stroke="#C4C24A" fill="red" d="M50 50 L100 50 M100 50 L100 100 M100 100 L150 100" /&gt; &lt;/svg&gt; in this code i have used MoveTo LineTo MoveTo LineTo.. Same output displayed here but fill color was not applied.. why? and in first example i need to show the output without applying fill color what can i do without changing path and fill?
has title: how to solve path fill color
score: 0
tagged with: http://stackoverflow.com/tag/svg
has answer: http://stackoverflow.com/a/29889626
accepted answer: http://stackoverflow.com/a/29889626
type: AnsweredQuestion
type: Question

http://stackoverflow.com/q/29861922
downvote count: 0
tagged with: javascript
tagged with: jquery
has title: Catch element by class using index or eq in jquery
answer count: 3
has answer: http://stackoverflow.com/a/29861950
favorite count: 0
score: 2
has answer: http://stackoverflow.com/a/29861948
has body: HTML code: two demo last two three two sample two five two sample five quick nine jQuery code: $('.order').click(function(){ var index = $(this).index(); var text = $(".order:eq(index-1)").text(); alert(text); }); On clicking any order class I want to get previous or next element with same order class. What iswrong with my code. Here is my Fiddle Thank you.
upvote count: 2
possible better answer: http://stackoverflow.com/a/29861948
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29861967
accepted answer: http://stackoverflow.com/a/29861950
type: Question

http://stackoverflow.com/a/29957914
score: -1
type: Answer
has comment: http://stackoverflow.com/comment/48036954
upvote count: 0
has comment: http://stackoverflow.com/comment/48040043
answers question: http://stackoverflow.com/q/29957095
downvote count: 1
has body: There are many ways in which this problem can be handled, personally I have something like this in my controllers angular.module('something').controller('someCtrl', someFunc); function someFunc($injectables like $scope){ var vm = this; vm.blah = ...; .... //at the end $scope.$on('$destroy', function(){ vm = null; }); } Looking thorough the code on the angularjs.org site, i found this comment within the code When the new scope is not isolated or we inherit from this, and the parent scope is destroyed, the property $$destroyed is inherited prototypically. In all other cases, this property needs to be set when the parent scope is destroyed. From this I understand that angular is actually destroying your parent scope and you can see the $$destroyed set to true. Further looking at how the scope is being destroyed. There is one more comment before the $destroy function: Removes the current scope (and all of its children) from the parent scope. Removal implies that calls to {@link ng.$rootScope.Scope#$digest $digest()} will no longer propagate to the current scope and its children. Removal also implies that the current scope is eligible for garbage collection. So based on this I would say that as long as you destroy your scope properly it should no longer exist and will not cause any memory leaks.

http://stackoverflow.com/q/29914495
has comment: http://stackoverflow.com/comment/47950961
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/29915304
tagged with: arrays
tagged with: javascript
tagged with: jquery
has title: Java Script get result of all Selected options
possible better answer: http://stackoverflow.com/a/29915304
has body: I have this code for quiz app, i need to get all list of all options selected and need to display the most selected option at the end. Like option 3 is selected in most of question or option 2 is selected in most of questions.. here is the fiddle JS: $(document).ready(function(){ answers = new Object(); $('.option').change(function(){ var answer = ($(this).attr('value')) var question = ($(this).attr('name')) answers[question] = answer }) var item1 = document.getElementById('questions'); var totalQuestions = $('.questions').size(); var currentQuestion = 0; $questions = $('.questions'); $questions.hide(); $($questions.get(currentQuestion)).fadeIn(); $('#next').click(function(){ $($questions.get(currentQuestion)).fadeOut(function(){ currentQuestion = currentQuestion + 1; if(currentQuestion == totalQuestions){ var result = sum_values() //do stuff with the result alert(result); }else{ $($questions.get(currentQuestion)).fadeIn(); } }); }); }); function sum_values(){ var the_sum = 0; for (questions in answers){ the_sum = the_sum + parseInt(answers[question]) } return the_sum } HTML: What Type of Date Are You? (Dude Edition) 1. You see a girl waiting at the bus stop. She is exactly your type. How do you get her number? You walk right up to her, strike up a conversation, and ask for her number You wait a few days until you get the courage to go and talk to her You tell one of your mutual friends that you like her You wait for her to come to you 2. You guys decide to go out on a date. Where do you decide to take her? You take her out for a short coffee and talk about life and relationships You take her out on a creative date and ask her questions about her life and you respond in kind, tried-and-true interview-style You take her out to a nice restaurant and dress in your best clothes. You ask the same questions as above You take her to the best restaurant and hope that your clothes does most of the talking. If not, you've got great stories to tell up your sleeves 3. You think…
has answer: http://stackoverflow.com/a/29915264
accepted answer: http://stackoverflow.com/a/29915264
has comment: http://stackoverflow.com/comment/47950975
type: AnsweredQuestion
type: Question

http://stackoverflow.com/comment/65358981
comment on: http://stackoverflow.com/a/29981486
type: Comment
type: AnswerComment
score: 1
has text: @jamesemanon https://github.com/chenglou/react-motion#transitionmotion- allows for this behaviour. It looks complicated at first, but once you figure it out, it's very flexible.

http://stackoverflow.com/a/29887718
type: Answer
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/29887677
answers question: http://stackoverflow.com/q/29887677
has body: You can use .val() in any action with the selector to select the datepicker element to get its value. Also not that the after() method is a synchronous method so there is no need to use queue() $("#sample tr td").after('&lt;td&gt;&lt;input type="text" id="datepicker"/&gt;&lt;/td&gt;'); $('#datepicker').datepicker(); $('button').click(function(){ alert($('#datepicker').val()) }) Demo: Fiddle
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/comment/48075456
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29977892
has text: Only constructor functions do have a `.prototype` property. What are you actually trying to do?
score: 0

http://stackoverflow.com/a/29933990
answers question: http://stackoverflow.com/q/29933532
upvote count: 2
type: AcceptedAnswer
type: Answer
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/47990614
accepted answer of: http://stackoverflow.com/q/29933532
has body: You probably do not need that many operations to do that kind of wrapping or just to extract the hash tags. To get the hash tags you can use this one-liner: var arr = $.grep( $('.hashtag').text().split(' '), function( v, i ) { return v.charAt(0) === '#'; }); But if all you want is to wrap the tags here is the code: $(document).ready(function(event){ $('.hashtag').html(function(_,html) { return html.replace(/(\#[a-z]+)/gi, function(x) { return "" + x + ""; }); }); }); DEMO

http://stackoverflow.com/comment/51574711
has text: @Kaiido I would, but it doesn't actual solve the original problem.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29937306

http://stackoverflow.com/q/29910137
tagged with: document.write
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
has title: How to document.write() within an image src string? Doesn't get parsed
favorite count: 0
has answer: http://stackoverflow.com/a/29910205
answer count: 5
type: UnansweredQuestion
has body: This is for a Javascript application that is only intended to run on a local machine, accessing many large image files from local disk. Original code like this: <-- Then html stuff including some control buttons, each one like this --> <--then a chunk of javascript related to the buttons --> The thing works OK, see http://everist.org/NobLog/20150424_js_animated_gallery.htm Now I want to extend it, so all image pathnames are defined as js constants and vars. Some will remain fixed during lifetime of the browser page, others will change by user actions. I'm stuck with one part of this. How to get the html parser to pay attention to script blocks WITHIN statements? Specifically, I want to do a document.write() within the image src string. Like: This is for the initial page display. The images later get changed by scripts, and that's working OK. But the html parser doesn't seem to notice scripts inside html elements. I'm a javascript nubie, so I may have some stupid misconception of how it all works. Am I just doing it wrong, or is this fundamentally impossible due to reasons? Here's an example: <-- some html stuff --> <-- including some control buttons, each one like this --> <--then a chunk of javascript related to the buttons --> In debugger, the img element appears as: The intent was to get this: I could just give up with trying to have the page initially render with the correct buttons, and have js correct them afterwards. I'm just surprised... Isn't it possible to evaluate js constants during initial html parsing to construct the DOM, in this way? Edit to add: Sorry, I wasn't clear enough in the question. What I want is a way for js to make the html content/DOM correct (per js config values that get defined very early on) BEFORE the page first renders. To avoid any flicker or resizings after first render. So another solution would be to delay the first page render till after some scripts have run, so they can make initial DOM adjustments before the user sees anyth…
has answer: http://stackoverflow.com/a/29931314
score: 2
upvote count: 2
has answer: http://stackoverflow.com/a/29910185
has answer: http://stackoverflow.com/a/29910187
type: Question
has comment: http://stackoverflow.com/comment/47942775
has answer: http://stackoverflow.com/a/29910526
tagged with: javascript

http://stackoverflow.com/comment/48073343
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29976871
has text: They should all change at the same time. Changes to the DOM don't become visible until the function returns, and then the browser performs all updates.
score: 0

http://stackoverflow.com/a/29861832
answers question: http://stackoverflow.com/q/29856335
type: Answer
has body: As you want to execute php code then need call phtml This call phtml file as reference block of head. &lt;example_handle&gt; &lt;reference name="head"&gt; &lt;block type="core/template" template="page/myjavascript.phtml" name="myjavascript" /&gt; &lt;/reference&gt; &lt;/example_handle&gt; then on phtml(app/design/frontend/YOUR_PACKAGE/YOUR_TEMPATE/template/page/myjavascrpt.phtml) write php code: and put all code of myjavascript.js to this phtml. then call &lt;?php echo $this-&gt;getChildHtml('myjavascript');?&gt; in head.phtml
score: 0

http://stackoverflow.com/comment/48032797
has text: Yeah, was just wondering about the big families :P If you would have said "Yeah, most other languages do not misuse `NaN` for that" then that would have been quite an eye opener for me. Oh well, might go and try it myself next time I have my full dev environment up and running (instead of the cloud based IDE I work in lately).
comment on: http://stackoverflow.com/a/29955858
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/47898351
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29887195
has text: I have added the reference link. Re-usability is the best policy :)

http://stackoverflow.com/a/29868265
downvote count: 1
score: 2
has body: Here is the definition. The d.ts files describe the shape of 3rd party library, and make the TypeScript compiler know how to deal with this 3rd party code (supply type information to compiler)
has comment: http://stackoverflow.com/comment/86194206
answers question: http://stackoverflow.com/q/29868120
type: Answer
upvote count: 3

http://stackoverflow.com/q/29936379
has answer: http://stackoverflow.com/a/29936574
has answer: http://stackoverflow.com/a/29936437
type: Question
has body: I have a div called "panel" with multiple child elements, each with a class of poster. Each poster will be a card displaying restaurant information. I want to target the h2 for whichever poster the user clicks on, irrespective of which area of the poster they click. I'm using event delegation on the panel but I'm not sure how to target the h2. HTML: 6-7:30PM Restaurant A bla bla bla 2-4:30PM Restaurant B bla bla bla 1-5:30PM Restaurant C bla bla bla JS: var panel = document.querySelector(".panel"); panel.addEventListener("click", handleClick);
has answer: http://stackoverflow.com/a/29936409
tagged with: javascript
score: 0
has title: Selecting the h2 element based on a clicked parent
answer count: 4
has answer: http://stackoverflow.com/a/29978768
type: UnansweredQuestion

http://stackoverflow.com/comment/66800637
type: QuestionComment
comment on: http://stackoverflow.com/q/29962585
has text: http://s8.picofile.com/file/8268947992/bootstrap.css.html
score: 0
type: Comment

http://stackoverflow.com/q/29962949
answer count: 2
has body: I try to post a JSON Object with AngularJS $http service to an Express Server. But I get an empty object in the server : "{}" I see this topic but this not solve my issue : angular post json to express Here code of Angular client : self.postTicket = function(ticket){ $http({ url: baseUrl+"features/", method: "POST", body: ticket, headers: {'Content-Type': 'application/json'}}) } I check the "ticket" object and it isn't empty And here, the express server : var express = require("express"); var request = require("request"); var bodyParser = require('body-parser') var app = express(); app.use(bodyParser.json({})); app.post('*', function (req, res) { console.log(req.body); res.status(200).send('OK'); }); app.listen(9000); Thank you in advance for your help
linked to: http://stackoverflow.com/q/20675889
downvote count: 0
possible better answer: http://stackoverflow.com/a/29963537
tagged with: javascript
favorite count: 0
tagged with: express
upvote count: 3
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/29963080
has answer: http://stackoverflow.com/a/29963537
type: AnsweredQuestion
score: 3
has answer: http://stackoverflow.com/a/29963080
has title: Post JSON data from AngularJS Client to Express Server
tagged with: http://stackoverflow.com/tag/json
tagged with: post
type: Question

http://stackoverflow.com/q/29962702
has body: I am learning jquery/javascript through trial and error by myself with the help of different sites and video tutorials. I got a gig for a stand-up team. I made a loader because i want the site to load easily and with no lag, made some fadeIns for certain parts of the page, etc.. I got a problem with the nav bar, the site will have around 6-7 pages and i want to extract the id of every html page the user is on with $("html").attr("id");, put it in a var x and then ask something like if(x="1/2/3/4/5/6") $("header").css("border","blabla"). It seems that the browser has some problems with var x or the = token, i am continuously getting errors regarding those 2. Any ideeas? Also is it ok if i made something like this for the loader: $(window).load(function() { $("#loading").delay(2000).fadeOut("fast"); $("header").hide().delay(2050).fadeIn(500); $("footer").hide().delay(2050).fadeIn(500); $(".interior").hide().delay(2050).fadeIn(550); }); This is the part i wanted to use for highlighting a nav buton *$(document).ready(function(){ var x = $("html").attr("id"); if(var = "1") $("#buton1").css("border","2px solid #E80000").css("border-radius","20px"); }); Is it a productive way of working or there are other ways and easier ways of doing stuff. Ty.
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
answer count: 0
type: UnansweredQuestion
has title: jQuery/Javascript. Highlighting a certain something when on a certain page and general tips
has comment: http://stackoverflow.com/comment/48045927
has comment: http://stackoverflow.com/comment/48045733
tagged with: css
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/48046323
has comment: http://stackoverflow.com/comment/48046057
type: Question
tagged with: navigationbar
tagged with: javascript
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/48045850

http://stackoverflow.com/q/29881934
has answer: http://stackoverflow.com/a/29882189
has comment: http://stackoverflow.com/comment/47888218
accepted answer: http://stackoverflow.com/a/29882104
has comment: http://stackoverflow.com/comment/47888205
has body: What's the difference between these 2 implementations of prototypal inheritance, and considering that we're working with 2 different "prototypes" (the prototype property that's only on functions, and the internal prototype), and how do these implementations differ in their prototype chain lookup? Also, does the first implementation (using the prototype property) rely on our use of the new operator? Assigning to a functions's prototype property and using the new operator: function foo() {} foo.prototype.output = function(){ console.log('inherits from Function.prototype property'); }; bar = new foo(); bar.output(); Storing a function in an object literal and using the Object.create() method: var foo = { output: function(){ console.log('inherits from the internal prototype'); } }; var bar = Object.create(foo); bar.output();
linked to: http://stackoverflow.com/q/383402
has comment: http://stackoverflow.com/comment/47887980
possible better answer: http://stackoverflow.com/a/29882435
has answer: http://stackoverflow.com/a/29882435
type: AnsweredQuestion
tagged with: prototypal-inheritance
upvote count: 5
has comment: http://stackoverflow.com/comment/47888095
has comment: http://stackoverflow.com/comment/47888621
linked to: http://stackoverflow.com/q/4166616
tagged with: prototype
type: Question
has answer: http://stackoverflow.com/a/29882104
has comment: http://stackoverflow.com/comment/47888767
score: 5
answer count: 3
has comment: http://stackoverflow.com/comment/47888178
downvote count: 0
tagged with: javascript
tagged with: inheritance
favorite count: 0
has comment: http://stackoverflow.com/comment/47888504
has comment: http://stackoverflow.com/comment/47888249
has title: What's the difference between these 2 implementations of prototypal inheritance?
has comment: http://stackoverflow.com/comment/47888254

angularjs
tags question: http://stackoverflow.com/q/29982496
tags question: http://stackoverflow.com/q/29996501
tags question: http://stackoverflow.com/q/29876422
tags question: http://stackoverflow.com/q/29876443
tags question: http://stackoverflow.com/q/29930092
tags question: http://stackoverflow.com/q/29904635
tags question: http://stackoverflow.com/q/29994652
tags question: http://stackoverflow.com/q/30001143
tags question: http://stackoverflow.com/q/29943546
tags question: http://stackoverflow.com/q/29872404
tags question: http://stackoverflow.com/q/29956548
tags question: http://stackoverflow.com/q/29970358
tags question: http://stackoverflow.com/q/29995832
tags question: http://stackoverflow.com/q/29892842
tags question: http://stackoverflow.com/q/29944795
tags question: http://stackoverflow.com/q/29846657
tags question: http://stackoverflow.com/q/29992915
tags question: http://stackoverflow.com/q/29932153
tags question: http://stackoverflow.com/q/29923286
tags question: http://stackoverflow.com/q/29919245
tags question: http://stackoverflow.com/q/29900260
tags question: http://stackoverflow.com/q/29865717
tags question: http://stackoverflow.com/q/29931679
tags question: http://stackoverflow.com/q/29948902
tags question: http://stackoverflow.com/q/29959376
tags question: http://stackoverflow.com/q/29998033
tags question: http://stackoverflow.com/q/29852849
tags question: http://stackoverflow.com/q/29978696
tags question: http://stackoverflow.com/q/29957278
tags question: http://stackoverflow.com/q/29947468
tags question: http://stackoverflow.com/q/29880721
tags question: http://stackoverflow.com/q/29974234
tags question: http://stackoverflow.com/q/29869905
tags question: http://stackoverflow.com/q/29870081
tags question: http://stackoverflow.com/q/29931423
tags question: http://stackoverflow.com/q/29882401
tags question: http://stackoverflow.com/q/29864706
tags question: http://stackoverflow.com/q/29901357
tags question: http://stackoverflow.com/q/29929433
tags question: http://stackoverflow.com/q/29901854
tags question: http://stackoverflow.com/q/29921882
tags question: http://stackoverflow.com/q/29957263
tags question: http://stackoverflow.com/q/29883678
tags question: http://stackoverflow.com/q/29856573
tags question: http://stackoverflow.com/q/29941996
tags question: http://stackoverflow.com/q/29915223
tags question: http://stackoverflow.com/q/29897555
tags question: http://stackoverflow.com/q/29847563
tags question: http://stackoverflow.com/q/29911739
tags question: http://stackoverflow.com/q/29883537
tags question: http://stackoverflow.com/q/29918834
tags question: http://stackoverflow.com/q/30002316
tags question: http://stackoverflow.com/q/29941713
tags question: http://stackoverflow.com/q/29878980
tags question: http://stackoverflow.com/q/29883177
tags question: http://stackoverflow.com/q/29990393
tags question: http://stackoverflow.com/q/29973936
tags question: http://stackoverflow.com/q/29970372
tags question: http://stackoverflow.com/q/29971384
tags question: http://stackoverflow.com/q/30001152
tags question: http://stackoverflow.com/q/29969829
tags question: http://stackoverflow.com/q/29916932
tags question: http://stackoverflow.com/q/29869372
tags question: http://stackoverflow.com/q/29941868
tags question: http://stackoverflow.com/q/29976519
tags question: http://stackoverflow.com/q/29972011
tags question: http://stackoverflow.com/q/29918892
tags question: http://stackoverflow.com/q/29977735
tags question: http://stackoverflow.com/q/29894442
tags question: http://stackoverflow.com/q/29891031
tags question: http://stackoverflow.com/q/29990147
tags question: http://stackoverflow.com/q/29928647
tags question: http://stackoverflow.com/q/29879384
tags question: http://stackoverflow.com/q/29936502
tags question: http://stackoverflow.com/q/29966488
tags question: http://stackoverflow.com/q/29900450
tags question: http://stackoverflow.com/q/29891698
tags question: http://stackoverflow.com/q/29981446
tags question: http://stackoverflow.com/q/29978837
type: Tag

http://stackoverflow.com/q/29965704
tagged with: javascript
has title: Promise: What happens to other async request when errors are thrown?
has answer: http://stackoverflow.com/a/29967232
answer count: 2
downvote count: 0
favorite count: 0
tagged with: promise
has body: I am using Bluebird promise. This isn't really explicit in the documentation. Suppose the following, assuming all the instances are appropriate promises: FindSomeDBModel.then(function(model) { return [ model.getOtherModels(), aHTTPRequest('https://google.com') ]; }).spread(function(otherModels, httpResponse) { // some code }).catch(function(err) { res.status(500).send(err); }); If both model.getOtherModels and aHTTPRequest throws an error, what will be inside the err variable in the catch? Also, what if model.getOtherModels throws an error first, will it cause a response to be sent out to the client or will it wait for aHTTPRequest to complete? Subsequently, aHTTPRequest throws, then what happens? Can I respond back to the client as soon as one of the request throws an error? Because it is no longer material whether the other response completes and succeeds.
accepted answer: http://stackoverflow.com/a/29967232
has answer: http://stackoverflow.com/a/29965976
type: AnsweredQuestion
tagged with: bluebird
score: 1
upvote count: 1
possible better answer: http://stackoverflow.com/a/29965976
type: Question

http://stackoverflow.com/comment/49585554
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29989150
has text: Unfortunately, this only exposes the host name, not the full URL.

http://stackoverflow.com/q/29996519
score: 3
has title: Knockoutjs foreach with if inside table
tagged with: javascript
upvote count: 3
answer count: 1
accepted answer: http://stackoverflow.com/a/29997627
has body: I have a foreach creating a table in one of my pages. My goal is when they checked the checkbox I would show additional elements for that table My issue is when the table is first drawn everything works as expected. But if i check a checkbox after the table is drawn the ko if statement does not reevaluate. What is the best method to accomplish this goal? My current code is below. And my viewModel function AppViewModel() { var self = this; self.rootUrl = window.location.protocol + "//" + window.location.host + "/Certs/"; self.AvailableCerts = ko.observableArray([]); self.getAvailableCerts = function () { $.ajax({ url: self.rootUrl + "AvailableCerts", type: "GET", cache: false, dataType: "json", success: function (results) { if (results != null) { self.AvailableCerts(results); } else { self.AvailableCerts([]); } } }); }; self.getAvailableCerts(); } ko.applyBindings(new AppViewModel());
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/29997627
type: AnsweredQuestion
downvote count: 0
tagged with: knockout.js
type: Question

http://stackoverflow.com/q/29967542
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29967717
type: Question
answer count: 2
tagged with: javascript
tagged with: jquery
has body: My jquery for onclick, $(document).ready(function () { $("#submitSave").on("click", function () { var confirmPassword = $("#txtLgnPasswordConfirmReset").val(); var passwordReset = { UserName: $("#txtLgnUsername").val(), Password: $("#hdnOldPassword").val(), NewPassword: $("#txtLgnPasswordReset").val() } $.ajax({ type: "POST", url: "/Account/PasswordReset", data: passwordReset }); }); }); Below is my Controller action method which is called on 'ON CLICK' by above jquery, [HttpPost] public ActionResult PasswordReset(User user) { if (_lfAPI.PasswordReset(user)) { return RedirectToRoute(Constants.Login); } return View(); } If my, if(condition) in the above method returns true, I want to show a notify message... My notify message, notifyMessage.showNotifyMessage('info', 'Your password has been reset.Please login with your new password.', false) Thanks in advance...
has answer: http://stackoverflow.com/a/29967663
tagged with: ajax
score: 0
has title: Getting response from action method into jquery
has comment: http://stackoverflow.com/comment/48054813

http://stackoverflow.com/comment/47883210
type: QuestionComment
has text: Try the setTimeout version too. I'm just curious if it's a reference thing. It looks like, in line-by-line, the instance is reused over and over and the same field is set, so I'm wondering if it's getting blown away before you have a chance to write the error. I don't see any reason it would be related to scoping. I mean, it's in scope in both places, so _something_ is changing it's value.
comment on: http://stackoverflow.com/q/29871496
score: 0
type: Comment

http://stackoverflow.com/q/29988667
score: 1
tagged with: asynchronous
favorite count: 0
tagged with: promise
type: Question
has body: I have the following code: function doSomething() { //xhr here setTimeout(function() { var value = 42; }, 10); return { then: function(callback) { callback(value); } }; } doSomething().then(function(result) { log("got a result", result); }); And can't figure out how to access the value. I need this to be promise-based solution in order to use in multiple places JSFidle link Update: We are not using any libraries in that projects
answer count: 2
has answer: http://stackoverflow.com/a/29988847
has comment: http://stackoverflow.com/comment/48096678
upvote count: 1
has comment: http://stackoverflow.com/comment/48096858
accepted answer: http://stackoverflow.com/a/29988847
tagged with: javascript
possible better answer: http://stackoverflow.com/a/29988751
tagged with: callback
has answer: http://stackoverflow.com/a/29988751
has title: Resolve value in javascript
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/48096736
downvote count: 0

http://stackoverflow.com/q/29918498
has body: I am fetching value from database which append to radio button in jqgrid like formatter: function (cellValue, option){ return '&lt;input type="radio" name="subradio" id="subradio"/&gt;'; } beforeSelectRow: function (rowid, e) { getcurrpatta(rowid); }, Now, the radio button populates if I click a radio. One function has been called. But if I click the same radio button again it has to disable no function call again then i go for other click radio button the old one have to enable how to do this???
type: Question
has answer: http://stackoverflow.com/a/29918945
tagged with: jqgrid
tagged with: javascript
tagged with: jquery
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has title: Jquery Current radio button click it disable in jqgrid
type: UnansweredQuestion

http://stackoverflow.com/q/29993405
has body: Jquery: $("input[type='text']").blur(function () { var id = $(this).parentsUntil('.hi').attr("data-id"); console.log(id); }); HTML: 0 I want to get the data-id value, i.e. equal to 1 but my browser console says undefined. Please help!
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29993669
type: Question
answer count: 2
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/29993669
score: 0
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/29994060
has title: Why can't I access data in parent with jquery?
has answer: http://stackoverflow.com/a/29994060

http://stackoverflow.com/q/29895733
tagged with: shebang
has comment: http://stackoverflow.com/comment/47914409
score: 0
has comment: http://stackoverflow.com/comment/47914522
has comment: http://stackoverflow.com/comment/47916289
tagged with: seo
answer count: 1
has comment: http://stackoverflow.com/comment/47923441
tagged with: sitemap
tagged with: ajax
has answer: http://stackoverflow.com/a/29900816
has comment: http://stackoverflow.com/comment/47915489
has title: escaped_fragment in sitemap or shebang?
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47914071
has body: My site is a Single Page Application and uses alot of javascript. I've got my server setup to generate the site the user sees with javascript so Google sees the same content. Google knows about this via the fragment meta tag and converts links with the shebang to escaped_fragment to get that rendered site. Since I want Google to know about not-so-recent articles on my site that don't have a link from the mainpage anymore, I added a sitemap. The question is if I should add urls with or without the shebang or convert it to escaped_fragment. http://www.example.com/#!veryAwsomeDynamicPage or http://www.example.com/?_escaped_fragment=veryAwsomeDynamicPage My Goal: I want Google to get my content via escaped_fragment, but want the link that Google shows in its search result to be with the shebang (so that users don't get redirected)
type: Question
accepted answer: http://stackoverflow.com/a/29900816
tagged with: javascript

http://stackoverflow.com/q/29855123
accepted answer: http://stackoverflow.com/a/29855244
type: AnsweredQuestion
type: Question
has title: Return value of delete operator?
tagged with: javascript
linked to: http://stackoverflow.com/q/12145901
upvote count: 3
score: 0
answer count: 2
downvote count: 3
has answer: http://stackoverflow.com/a/29855314
has body: From the MDN delete documentation: The delete operator removes a property from an object. Return value: Throws in strict mode if the property is an own non-configurable property (returns false in non-strict). Returns true in all other cases. There are some things I don't understand: What is a non-configurable property? when I run this code in chrome console it return true: var a={'b':'b'}; delete a.b; //it return true I think the Chrome console runs code in non-strict mode. If that is the case, then according to MDN it should returns false. Why does it return true? According to MDN the delete operator returns true in all other cases. What are the other cases? I know one case (strict mode with a configurable property). Are there any other cases ?
has comment: http://stackoverflow.com/comment/47836204
favorite count: 0
possible better answer: http://stackoverflow.com/a/29855314
has comment: http://stackoverflow.com/comment/47836176
has answer: http://stackoverflow.com/a/29855244

http://stackoverflow.com/a/29945634
type: Answer
has comment: http://stackoverflow.com/comment/48030739
has body: This is why wrapping of vendor code is disabled by default in Brunch. Many vendor scripts have UMD or their own way of exposing their API that is incompatible with generic module wrapping, but they will work out of the box with your AMD structure if left alone. What you may want to do is organize your vendor scripts into separate directories by the ones that need wrapping by Brunch and the ones that don't; something like the vendor and vendor-wrapped. Using default conventions settings, Brunch will wrap the scripts in vendor-wrapped and not the ones in vendor. Then you can concatenate them both together (based on your prior question's example): joinTo: 'js/vendor.js': /^vendor(-wrapped)?[\\/](?!mocha|chai|sinon|sinon-chai)/ There is still the possibility that you'll encounter some vendor scripts that are structured in such a way as to just be incompatible with AMD, even when wrapped, and in those cases your choices are to either not use those libs, work with the authors to get them updated, or maintain your own modifications to make them compatible with your project.
score: 0
has comment: http://stackoverflow.com/comment/48015341
answers question: http://stackoverflow.com/q/29944509

http://stackoverflow.com/comment/47922411
type: Comment
comment on: http://stackoverflow.com/q/29899727
has text: Hello, we have several ng-include directives inside partials that are loaded based on url.
score: 0
type: QuestionComment

http://stackoverflow.com/q/29969043
type: UnansweredQuestion
has body: Hey I'm trying to validate a form, with Ajax. When the validation is correct, I want that the forms submits. Otherwise I want to show feedback ect. But sometimes I'm getting a endless loop or the form doesn't submit. How can I solve this behaviour? //Find Sign form var sign_form = $("#sign_form"); //User submits Sign form sign_form.submit(function(e) { e.preventDefault(); var $this = $(this); var form = $(this).serializeArray(); var formObj = {}; $.each(form, function(i, v) { formObj[v.name] = v.value; }); //Post Form data to Sign $.post("./ajax/sign.php", formObj, function(data, status) { var fdb = data.messages; if(data.status == "success") { console.log("validate is TRUE"); $this.submit(); return true; } else { if(fdb.emailaddress != null) { $("#fdb_emailaddress").html(fdb["emailaddress"]); } console.log("validate is FALSE"); return false; } }); console.log("validate ended: we should not see this"); });
type: Question
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: ajax
has title: jQuery validation before Form submit
score: 2
upvote count: 2
has answer: http://stackoverflow.com/a/29969410

http://stackoverflow.com/a/29857461
upvote count: 2
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/47849473
has body: You are calling either initialize or newmap in your onload function. newmap depends on initialized being run first to instantiate the geocoder and the map. This works for me: $(window).load(function() { var selectedregion = document.getElementById('region').value; var selectedcity = document.getElementById('city').value; initialize(); if(selectedregion == "" &amp;&amp; selectedcity == ""){ }else{ newmap(selectedregion, selectedcity); } }); proof of concept fiddle
accepted answer of: http://stackoverflow.com/q/29855261
type: Answer
answers question: http://stackoverflow.com/q/29855261
score: 2

google-chrome
tags question: http://stackoverflow.com/q/29928924
tags question: http://stackoverflow.com/q/29982568
tags question: http://stackoverflow.com/q/29914035
tags question: http://stackoverflow.com/q/29971982
tags question: http://stackoverflow.com/q/29994512
tags question: http://stackoverflow.com/q/29936845
tags question: http://stackoverflow.com/q/29905154
tags question: http://stackoverflow.com/q/29886495
tags question: http://stackoverflow.com/q/29910429
tags question: http://stackoverflow.com/q/29928734
tags question: http://stackoverflow.com/q/29986111
tags question: http://stackoverflow.com/q/29983786
tags question: http://stackoverflow.com/q/29896396
tags question: http://stackoverflow.com/q/29848459
tags question: http://stackoverflow.com/q/29869532
tags question: http://stackoverflow.com/q/29953109
tags question: http://stackoverflow.com/q/29878506
tags question: http://stackoverflow.com/q/29909459
tags question: http://stackoverflow.com/q/29946401
tags question: http://stackoverflow.com/q/29860342
tags question: http://stackoverflow.com/q/29911329
tags question: http://stackoverflow.com/q/29964035
tags question: http://stackoverflow.com/q/29957204
tags question: http://stackoverflow.com/q/29954054
tags question: http://stackoverflow.com/q/29936521
tags question: http://stackoverflow.com/q/29959936
tags question: http://stackoverflow.com/q/29923790
tags question: http://stackoverflow.com/q/29931183
tags question: http://stackoverflow.com/q/29922263
tags question: http://stackoverflow.com/q/29935216
tags question: http://stackoverflow.com/q/29944329
tags question: http://stackoverflow.com/q/29925640
tags question: http://stackoverflow.com/q/29865334
tags question: http://stackoverflow.com/q/29982254
tags question: http://stackoverflow.com/q/29856803
tags question: http://stackoverflow.com/q/29930070
tags question: http://stackoverflow.com/q/29989031
tags question: http://stackoverflow.com/q/29959719
tags question: http://stackoverflow.com/q/29944387
tags question: http://stackoverflow.com/q/29867722
tags question: http://stackoverflow.com/q/29966407
tags question: http://stackoverflow.com/q/29934813
tags question: http://stackoverflow.com/q/29845765
tags question: http://stackoverflow.com/q/29997428
type: Tag
tags question: http://stackoverflow.com/q/29941395
tags question: http://stackoverflow.com/q/29931944
tags question: http://stackoverflow.com/q/29945179
tags question: http://stackoverflow.com/q/29982764
tags question: http://stackoverflow.com/q/29889820
tag name: google-chrome
tags question: http://stackoverflow.com/q/29997440
tags question: http://stackoverflow.com/q/29861506
tags question: http://stackoverflow.com/q/29971990
tags question: http://stackoverflow.com/q/29990178
tags question: http://stackoverflow.com/q/29852786
tags question: http://stackoverflow.com/q/29878904
tags question: http://stackoverflow.com/q/29912933
tags question: http://stackoverflow.com/q/29985611
tags question: http://stackoverflow.com/q/29905794
tags question: http://stackoverflow.com/q/29980459
tags question: http://stackoverflow.com/q/29981363
tags question: http://stackoverflow.com/q/29922237
tags question: http://stackoverflow.com/q/29876326
tags question: http://stackoverflow.com/q/29882133
tags question: http://stackoverflow.com/q/29932393
tags question: http://stackoverflow.com/q/29868238
tags question: http://stackoverflow.com/q/29934688
tags question: http://stackoverflow.com/q/29856115
tags question: http://stackoverflow.com/q/29944880

http://stackoverflow.com/a/29983709
downvote count: 0
upvote count: 2
answers question: http://stackoverflow.com/q/29983631
type: Answer
has body: Specify all those characters in a character class, and don't forget to get the value returned by replace (strings in Javascript are immutable): paragraph = paragraph.replace(/["“‘”]/g, "'");
score: 2

http://stackoverflow.com/q/29988789
tagged with: asp.net-mvc-4
type: AnsweredQuestion
score: 0
has body: The basic idea is to have a grid where a user double-clicks the row and opens a modal window (Bootstrap panel) with a panel-body section to edit the data, and a panel-footer with a btn-group to "Save", "Cancel", or "Close" with some logic built in to handle the button's state and onclick events accordingly. Since there will be many grids and many modal windows throughout the project, and although the panel-body section will vary for each one of them, the panel-footer will likely be the same for them all and I would like to use only one panel-footer as a template, but I don't know how to. At the moment, here is how it works: In the project, there are two forms: frmCustomer and frmUnit. frmCustomer panel-footer has buttons #btnSaveCust, #btnCancelCust, and #btnCloseCust. The jQuery script has events hooked up to each of those IDs and works as expected $(document).on("click", "#btnSaveCust", function () { SaveCust(); }); frmUnit works the same way except with the name changed to #btnSaveUnit and the event changed to #btnSaveUnit and SaveUnti(). Now, if I do a template, the buttons' IDs would change to #btnSave, #btnCancel and #btnClose. How would I know how to call SaveCust() or SaveUnit()? UPDATE 1: I just realized that this is not going to work, since we cannot have duplicated id's, the btns in the shared view (template?) must have to be renamed every time they are used in another form
has answer: http://stackoverflow.com/a/29990552
has comment: http://stackoverflow.com/comment/48101340
has comment: http://stackoverflow.com/comment/48099220
type: Question
accepted answer: http://stackoverflow.com/a/29990552
has title: Is it possible to share one button click in different forms?
has comment: http://stackoverflow.com/comment/48101397
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/48097435
has comment: http://stackoverflow.com/comment/48098107

http://stackoverflow.com/q/29937919
type: Question
tagged with: angularjs-directive
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47997661
has comment: http://stackoverflow.com/comment/47997646
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29938014
answer count: 1
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/47997338
tagged with: angularjs
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47997731
has title: angularjs scope variable not updated outside directive
score: 2
tagged with: plunker
upvote count: 2
has comment: http://stackoverflow.com/comment/47997752
has answer: http://stackoverflow.com/a/29938014
has body: I'm learning directives and I have a scenario set up where I update a $scope value inside of my directive's controller. This works fine within the directive, however the $scope variable outside of the directive is not getting updated. I have created a plunk to illustrate this behavior. In the plunk you'll see that only the scope variable gets updated inside of the directive when clicking the reset button. Note: I tried using $scope.$apply(); as seen in another post but this does not work. It throws the apply already in progress error. I also read that this isn't a good way to do it. Could someone also mention why?

http://stackoverflow.com/comment/47953770
comment on: http://stackoverflow.com/a/29915967
type: Comment
type: AnswerComment
has text: Yes just put the code inside the callback or just create a function outside and call it from within the callback with param width
score: 0

http://stackoverflow.com/q/29889969
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/47927821
has answer: http://stackoverflow.com/a/29902579
has title: Creating dynamic html table without using 'table'
tagged with: css
score: 2
type: AnsweredQuestion
has body: I need to create an html tables without using the table tags or css display:table(and same) properties. I wrote this html code Creating div tables And this css: .tbl { background-color: yellow; display: flex; flex-flow:column; position: relative; width: 80%; left: 10%; } .rw { background-color: rgb(197, 253, 255); display: flex; flex-flow:row; resize:both; } .col { border-style: solid; border-color: black; overflow: hidden; display: inline-block; } Now, i need to do such, that if in a cell there is an overflow, the table perform a resizing of whole raw and/or column according to next scheme. At this moment only the raw resizing works. How to implement the whole column resizing? Can i perform it only using CSS? Or I have to use JavaScript/Jquery? Thanks.
upvote count: 3
has comment: http://stackoverflow.com/comment/47928046
accepted answer: http://stackoverflow.com/a/29902579
downvote count: 1
type: Question
tagged with: javascript
tagged with: jquery
tagged with: flexbox

http://stackoverflow.com/comment/47830234
comment on: http://stackoverflow.com/a/29851669
score: 0
type: AnswerComment
type: Comment
has text: You actually need to update your post @LeonardoFettucciari so the question and answers can be preserved for future visitors to SO.

http://stackoverflow.com/comment/48021037
score: 0
type: Comment
type: QuestionComment
has text: You should probably use `Number`s instead of `String`s.
comment on: http://stackoverflow.com/q/29950085

http://stackoverflow.com/a/29893274
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 1
accepted answer of: http://stackoverflow.com/q/29893208
has comment: http://stackoverflow.com/comment/47909743
score: 1
has body: The IE versions before IE9 does not support .indexOf() function for Array As an alternative you can use jQuery.inArray(). Something like this: if (!Array.prototype.indexOf) { Array.prototype.indexOf = function(val) { return jQuery.inArray(val, this); }; }
answers question: http://stackoverflow.com/q/29893208
has comment: http://stackoverflow.com/comment/47910131

http://stackoverflow.com/a/29852166
upvote count: 1
type: Answer
downvote count: 0
answers question: http://stackoverflow.com/q/29851018
score: 1
has body: RegExp As I suggested in the comments, use: /^[\S\s]+(&lt;\/body&gt;)/i How This will get all text (greedy) until the text &lt;/body&gt; the flag i means case-insensitive. This will work no matter how many body tags you have &lt;/body&gt; &lt;/BODY&gt; &lt;/BoDY&gt; &lt;/body&gt;&lt;!--This one's selected--&gt; You said you were using JavaScript which can be used as: yourString.match(/^[\S\s]+(&lt;\/body&gt;)/i)[1]; .match works fine when you don't have the g flag. To further explain this RegExp Explanation ^ Matches it at the beginning of the whole string because we don't have the m flag [\S\s]+ will match everything until the following. The + can be replaced by a * (&lt;\/body&gt;) will get the body tag after the previous (the last one) and add it as a match i the i flag makes the string case-insensitive (remove if you want it to be case sensitive) JavaScript appendChild If you have multiple body tags, you can still add an element before it. var elem = document.createElement('div'); elem.setAttribute('id', 'mydiv'); elem.innerHTML = 'Foo'; Now, elem can be added in multiple ways: 1: window.document.body.appenedChild(elem); 2: var body_elems = document.getElementsByTagName('body'); body_elems[body_elems.length - 1].appendChild(elem);

http://stackoverflow.com/q/29927803
has comment: http://stackoverflow.com/comment/47978514
has answer: http://stackoverflow.com/a/29930841
has body: Problem JSFiddle: http://jsfiddle.net/onlyandrewn/b18b4bza/ I'm making a bingo card and currently it keeps a count of every time a square has been clicked. However, I'm lost on how to make it so that when five squares in a row, column or on a diagonal are clicked for a Bingo, it knows that it's a win as opposed to any random five squares on the card. Would I have to give each square on the card an #id and then have arrays that say if squares 1,2,3,4,5 have been clicked = a Bingo? index.html Election Bingo Political Zinger Print Play again WINNER! Chrissy Teigen cries Host makes a quick change 'I love you!' 'Merci' or 'Gracias' Attempt at re-creating the 'Ellen selfie' A Weinstein is thanked Jennifer Lawrence trips Half-joking mention of nominee diversity 'This is heavy!' A shout-out for winner's kids (who should be sleeping) Joke about number of British nominees Award accepted posthumously Logo Joke about the Sony hack Winner mentions fellow nominees 'I'd like to thank the academy ...' 'Je Suis Charlie' The show goes over three hours Camera pans to George and Amal Winner talks over orchestra Winner thanks agent or manager Winner forgets to thank spouse Host makes a borderline-offensive joke Presenters have a scripted 'disagreement' NPH performs a music number scripts.js $(function() { // Play again, removes all previously clicked $('.again').click(function(){ $('.square').removeClass('clicked'); }); // var newNum = Math.floor(Math.random); // Toggle clicked and not clicked $('.square').click(function(){ $(this).toggleClass('clicked'); }); // Count the number of squares clicked $('.square').data('clicked', 0) .click(function(){ var counter = $(this).data('clicked'); $(this).data('clicked', counter ++); console.log(counter); }) });
favorite count: 0
has title: How to check all elements in row/column clicked, Bingo game
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47977761
has comment: http://stackoverflow.com/comment/47978612
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/47984064
score: 1
accepted answer: http://stackoverflow.com/a/29930841
has comment: http://stackoverflow.com/comment/47978119
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/a/29953486
answers question: http://stackoverflow.com/q/29953372
type: Answer
has comment: http://stackoverflow.com/comment/48030007
accepted answer of: http://stackoverflow.com/q/29953372
has comment: http://stackoverflow.com/comment/48031627
score: 0
type: AcceptedAnswer
has body: Set a default value : var userNetwork = ''; // could alternatively be any default value Then update your for loop to check for match for '': for (var c = 0; c &lt; cont.length; c++) { if (userNetwork === cont[c].network || userNetwork === "") { The main issue is that you never initialize userNetwork so userNetwork === "" doesn't match since there isn't a value. You could alternatively leave your variable userNetwork undefined and change your check to be: if (userNetwork === cont[c].network || userNetwork == null) { You also may wish to change your checkboxes to radio as a user might select multiple carriers, depending on how your UI looks.

http://stackoverflow.com/q/29865893
has title: Send data sensitive data to javascript
tagged with: javascript
has comment: http://stackoverflow.com/comment/47856856
has comment: http://stackoverflow.com/comment/47857267
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has body: I have this code: &lt;input type="button" value="Delete Group" class="followbt" name="delete" onclick="deleteGroupDialog(' . $group_row['ngroup'] . ');"&gt; The field 'ngroup' is the group number that i want to delete, and i am passing it to a javascript function that opens an jquery dialog window in order to ask if the user is certain of what is doing, the problem is that anyone can go on the browser and edit that number and go delete any group (that belongs to him). I have already made a search about this but i didn't find anything, is there a way to pass the argument more securely? PS: When i show the dialog window i don't want to reload the page a make a server request.
favorite count: 0
tagged with: php
has comment: http://stackoverflow.com/comment/47856944
type: AnsweredQuestion
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/29865998
accepted answer: http://stackoverflow.com/a/29865998
type: Question

http://stackoverflow.com/a/58518772
downvote count: 0
score: 1
has body: this works for me :D
upvote count: 1
answers question: http://stackoverflow.com/q/29881052
type: Answer

http://stackoverflow.com/comment/47866355
type: QuestionComment
comment on: http://stackoverflow.com/q/29870420
has text: Oh thank you. I got my map displayed. Now my markers are not working. I am trying to figure out what is going on.
score: 0
type: Comment

http://stackoverflow.com/comment/47910054
type: AnswerComment
comment on: http://stackoverflow.com/a/29893491
type: Comment
has text: What can be done if the object is dynamic
score: 0

http://stackoverflow.com/comment/72324637
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29924964
type: Comment
has text: Cool. I'm updating my open-source `deepCopy()` function and thinking I should use `Object.prototype.toString.call(o) == '[object Set]'`. I just commented about using `Object.prototype.toString` on Bergi's answer...

http://stackoverflow.com/a/29993756
type: Answer
score: 2
upvote count: 2
has body: With a little CSS maybe: .slick-prev { left: 10px } .slick-next { right: 10px }
answers question: http://stackoverflow.com/q/29993601
accepted answer of: http://stackoverflow.com/q/29993601
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/29976616
has body: I have an empty array that I want to push items onto, inside a loop. Once outside the loop, the array losses all information var result = []; users.find({}, {username: true, isOnline: true, uniq: true, _id: false}, function(err, cursor) { cursor.each(function(err, item) { result.push(item); console.log(result); //every iteration the array shows fine }); console.log(result); //array is empty }); console.log(result); //array is empty
type: AnsweredQuestion
tagged with: arrays
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/29976703
favorite count: 0
accepted answer: http://stackoverflow.com/a/29977082
type: Question
has comment: http://stackoverflow.com/comment/48072948
has comment: http://stackoverflow.com/comment/48073004
possible better answer: http://stackoverflow.com/a/29976703
has comment: http://stackoverflow.com/comment/48073251
tagged with: node.js
tagged with: mongoskin
upvote count: 2
answer count: 2
has comment: http://stackoverflow.com/comment/48104328
has title: Javascript Pushing elements inside a loop, doesn't affect the array outside the loop
has answer: http://stackoverflow.com/a/29977082
tagged with: loops
score: 2

http://stackoverflow.com/comment/47893708
has text: The URL you are requesting is apparently not sending back valid JSON.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/29884780
type: Comment

http://stackoverflow.com/a/29987365
type: Answer
upvote count: 6
has body: Consider this following Javascript snippet: for (var item in obj) { result.push({ name: item, total: obj[item] }); } Working DEMO Output: [ { "name":"ted", "total":501 }, { "name":"jeff", "total":40 }, { "name":"tony", "total":90 } ]
has comment: http://stackoverflow.com/comment/48112625
answers question: http://stackoverflow.com/q/29987238
score: 6
downvote count: 0

http://stackoverflow.com/comment/48367527
type: Comment
comment on: http://stackoverflow.com/a/29998623
score: 0
type: AnswerComment
has text: I did file a bug: https://developers.facebook.com/bugs/103854869948544/ It looks like the problem only happens when the query involves GeoPoint. Skip has its own limit (can't skip for more than 10000). So that doesn't work for me either. I did try Hector's suggestion of using orderBy + limit + skip. That's not working for me either (at least not yet, still debugging). Initial impression is that orderBy is applied after retrieving the records, not prior to applying the constraints so using the orderBy result as the delimiter for next batch didn't work.

http://stackoverflow.com/comment/47869042
type: Comment
comment on: http://stackoverflow.com/a/29871978
has text: `var arr2 = arr;` does not **create** a reference - `arr` already *is* a reference.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/68031921
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/30000775
type: Comment
has text: Newcomers: please refer to @N1mr0d's answer

http://stackoverflow.com/comment/59764634
type: AnswerComment
has text: Sadly that won't work if there are two or more Slick sliders on one page. If thats the case every one of those custom prev/next buttons will slide all sliders on that page. How is it possible to define only "that" one DOM element asprev/next button for THIS specific slider?
type: Comment
score: 2
comment on: http://stackoverflow.com/a/30107306

http://stackoverflow.com/comment/48001982
type: Comment
comment on: http://stackoverflow.com/a/29940512
score: 0
has text: @RaphaelMüller Thanks for your reply. In the real scenario , it already has an id attached to the form and input fields.But I missed out on the example code.Apologies.
type: AnswerComment

http://stackoverflow.com/q/29914362
type: Question
has comment: http://stackoverflow.com/comment/47950582
has comment: http://stackoverflow.com/comment/47950554
score: 0
has answer: http://stackoverflow.com/a/29914433
has body: I would like to convert the event handler to a jquery style click event but it doesnt seem to like passing the event through, perhaps its because its not an anonymous function anymore? // variables var faqOne = document.getElementById("faqOne"); var $hiddenOne = $(".faqOneHidden"); // javascript event handler works! faqOne.addEventListener("click", function(e){ showFaqOne.showClickedFaq(e); }, false); // javascript event handle - doesnt work! $("#faqOne").click(function(){ showFaqOne.showClickedFaq(e); }); // constructor function DisplayQFaqs(link, faq){ this.link = link; this.faq = faq; } // method prototype DisplayQFaqs.prototype.showClickedFaq = function(e){ var el = e.currentTarget; if(el === this.link) { this.faq.toggle("slow", function(){ }); } }; // new DisplayQFaqs Objects var showFaqOne = new DisplayQFaqs(faqOne,$hiddenOne);
tagged with: handler
has comment: http://stackoverflow.com/comment/47950682
tagged with: anonymous-function
answer count: 1
tagged with: javascript
tagged with: jquery
tagged with: events
has title: convert javascript event handler to jquery
type: UnansweredQuestion

http://stackoverflow.com/comment/48089443
score: 0
type: Comment
type: QuestionComment
has text: tried adding height: 100% to html in css?
comment on: http://stackoverflow.com/q/29985018

http://stackoverflow.com/a/46574933
answers question: http://stackoverflow.com/q/29921696
score: 0
has body: I found this question by @TimorEranAV HTML map that displays text instead of linking to a URL and was marked as duplicate, but i think what he was expecting is this, Program - Image Map Here the title tag gives the opportunity to add a hover text(tip) to the image map.
type: Answer

http://stackoverflow.com/q/29872035
duplicate of: http://stackoverflow.com/q/3618340
possible better answer: http://stackoverflow.com/a/29872051
has body: I was writing some calculations involving exponents in Javascript and due to my habit of using carets in Microsoft Excel, I typed x^2 in the code. It still gave me an answer but it wasn't what I wanted. What does ^ do in javascript? alert(Math.pow(3,2)); //result is 9 alert(3^2); //result is 1
has answer: http://stackoverflow.com/a/29872055
type: Question
has answer: http://stackoverflow.com/a/29872051
answer count: 2
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29872055
favorite count: 0
has title: What does (x^2) do in javascript?
upvote count: 2
linked to: http://stackoverflow.com/q/3618340
score: 2
type: AnsweredQuestion

http://stackoverflow.com/comment/47899697
has text: Thank you for answer, **The User.Identity.Name** is not personal info and is a **Integer number** that I converted to String. Please tell me more about how to use UserId as custom dimension and then see them
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29883835
type: AnswerComment

http://stackoverflow.com/q/29855241
has comment: http://stackoverflow.com/comment/47841307
tagged with: javascript
score: 0
has body: I'm trying to have a part of my Parse cloud code set the installation channel for push notification purposes. I want it to set the installation to two channels like so: var installationQuery = new Parse.Query(Parse.Installation); installationQuery.equalTo('userId', user); installationQuery.first().then(function(result) { result.set('channels', [user, "highPush"]); result.save(); }); What I'm doing here is finding the installation associated with a particular userId, then setting that installation object's 'channels' property to both the username ( the user variable) string, and the string "highPush". The problem is that running this code only seems to set it to "highPush", not both. When I try using an explicit user string like below, it successfully sets it to both, but not when I use the user variable which contains that same userId string. What could be causing this? result.set('channels', ["EG7Mf6mDkT", "highPush"]); Logging the user variable like below succesfully prints, so I know it exists. console.log('set it to high push, and the userId is' + user);
answer count: 1
tagged with: parse-platform
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29857779
has title: Unable to set Parse installation to two channels for push notification
type: Question

http://stackoverflow.com/comment/48092496
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29985991
has text: Can you please add the full code of the function that is saved into `$.fn.youamaAjaxLogin`?
score: 0

http://stackoverflow.com/q/29886134
upvote count: 2
score: -4
accepted answer: http://stackoverflow.com/a/29886154
has comment: http://stackoverflow.com/comment/47896392
downvote count: 6
linked to: http://stackoverflow.com/q/2035645
type: AnsweredQuestion
type: Question
has title: which functions in javascript (in browser) can run in async mode?
has body: As I know, JavaScript is single-threaded. Only a few functions can run in async mode such as setTimeout, setInterval, XHR, ... etc. Also all the event callback will be run in async mode. Is there any other JavaScript function can run in async mode?
tagged with: javascript
answer count: 1
has comment: http://stackoverflow.com/comment/48070040
tagged with: asynchronous
favorite count: 0
has answer: http://stackoverflow.com/a/29886154

http://stackoverflow.com/comment/56356996
has text: I'm using the same code, but some of the path segments still are under the ground. Does someone know the reason?
comment on: http://stackoverflow.com/q/29911691
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29971093
downvote count: 1
has title: Moving class names from div to div
tagged with: css
has answer: http://stackoverflow.com/a/29971930
has comment: http://stackoverflow.com/comment/48062083
possible better answer: http://stackoverflow.com/a/29971857
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29971857
has comment: http://stackoverflow.com/comment/48062016
type: Question
has comment: http://stackoverflow.com/comment/48062057
has comment: http://stackoverflow.com/comment/48063062
has comment: http://stackoverflow.com/comment/48062015
upvote count: 1
has answer: http://stackoverflow.com/a/29971649
accepted answer: http://stackoverflow.com/a/29971649
tagged with: javascript
tagged with: jquery
favorite count: 0
score: 0
has body: I am trying to move class names on div's after a short delay (possible 10 seconds or so). I want the 3 classes below to move through the div's and loop once it reaches the last one. For example: would turn to: I hope this makes sense, It is my first post on here so nothing like starting off with a complicated one. Appreciate any responses.
answer count: 3
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/a/29895756
score: 1
upvote count: 1
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/29895615
has body: Just use the class selector to select the serialize_1 elements, and the not() selector method to select the ones that are not: $('#myform_2 :input').not('.serialize_1').addClass('blue'); $('#myform_2 :input.serialize_1').addClass('red'); Here is a WORKING TEST

http://stackoverflow.com/a/33348794
type: AcceptedAnswer
downvote count: 0
upvote count: 2
type: Answer
accepted answer of: http://stackoverflow.com/q/29982629
has body: So I ended up with the following code: openWithSystemBrowser = function(url) { window.open(url, "_system"); location.href = "index.html"; }; shareOnWhatsapp = function(url) { openWithSystemBrowser(url); }; /** * Handles URL changes in in-app browser, e.g. to handle logouts or * unsuccessful logins */ urlChanged = function(event) { if(event.url.startsWith("http://whatsapp://")) { shareOnWhatsapp(event.url.substr("http://".length)); return; } if(event.url.startsWith("whatsapp://")) { shareOnWhatsapp(event.url); return; } }; This is of course slightly lame as you're always brought back to index.html, but for my purposes it was enough. Interested to see if anyone's found a more elegant solution. It also solved the 2-3 second delay before opening the system browser, but I don't have any clue why, frankly.
answers question: http://stackoverflow.com/q/29982629
score: 2

http://stackoverflow.com/comment/47983427
type: Comment
type: QuestionComment
has text: run the pusher node.js client... you can talk to it from php if needed.
comment on: http://stackoverflow.com/q/29930354
score: 0

http://stackoverflow.com/q/29893885
has comment: http://stackoverflow.com/comment/47911299
upvote count: 3
has title: Moving an HTML object seamlessly using Javascript
has comment: http://stackoverflow.com/comment/47911202
has answer: http://stackoverflow.com/a/45926209
type: AnsweredQuestion
score: 3
has comment: http://stackoverflow.com/comment/47911215
has comment: http://stackoverflow.com/comment/47911330
type: Question
possible better answer: http://stackoverflow.com/a/29894090
has answer: http://stackoverflow.com/a/29894090
has body: When I try to move a DIV using jquery with the help of setTimeout, it just works fine and is moving seamlessly like this: setTimeout("moveObject()", 10); function moveObject() { $('.object').css("left", parseInt($('#object').css("left")) + 1); } It's moving like it's moving in Flash, you know seamlessly.. But there are some issues with setTimeout which has 10 ms, when the browser tab is in blur, timeout stops and doesn't make the job it has to. Therefore, I thought it would be a good idea to use animate of JQuery to deal with this. I have changed the code to this: $("#object").animate({left: parseInt($('#object').css("left")) + 100}, 1000, "linear", function() {} ); In the first code, object is moving 1px in 10ms. In the second code, object is moving 100px in 1000ms. So I think these two codes should do the same but they don't. First code is moving object seamlessly, but the second is not that seamlessly. There are some corruptions in the movement. My question is: How can I move this object (without using timeout) seamlessly? and It would be great if I can set a speed to that. Note: I'm not using HTML5 so I'm looking for a solution which works with jquery &amp; HTML
downvote count: 0
accepted answer: http://stackoverflow.com/a/45926209
tagged with: javascript
has comment: http://stackoverflow.com/comment/47910912
tagged with: jquery
favorite count: 0
answer count: 3
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29895193

http://stackoverflow.com/q/29851873
linked to: http://stackoverflow.com/q/17242144
has answer: http://stackoverflow.com/a/29852062
has answer: http://stackoverflow.com/a/60418842
has title: Convert a number between 1 and 16777215 to a colour value
has comment: http://stackoverflow.com/comment/47833540
has answer: http://stackoverflow.com/a/29852285
type: Question
has comment: http://stackoverflow.com/comment/47830462
score: 5
downvote count: 2
has comment: http://stackoverflow.com/comment/47829784
tagged with: javascript
has answer: http://stackoverflow.com/a/29853152
has comment: http://stackoverflow.com/comment/47830132
has answer: http://stackoverflow.com/a/29851960
linked to: http://stackoverflow.com/q/2353211
has answer: http://stackoverflow.com/a/29853271
upvote count: 7
has answer: http://stackoverflow.com/a/29852144
linked to: http://stackoverflow.com/q/929103
answer count: 10
has answer: http://stackoverflow.com/a/29852103
has answer: http://stackoverflow.com/a/29851965
linked to: http://stackoverflow.com/q/57803
favorite count: 0
has answer: http://stackoverflow.com/a/29852333
has body: I'm trying to convert a number between 1 and 16,777,215 to any colour format (RGB/HSL/HEX) that increments through the colour spectrum using Javascript/jQuery. The number 16,777,215 is the total possible combinations of RGB(255,255,255) which is 32 bit colour. I initially thought converting the value to a hex value using toString(16) would increment through the spectrum, however as the number increases it seems to work through different lightness values instead and flashes. An example of this unwanted behaviour is here http://jsfiddle.net/2z82auka/ var colour = 16777215; window.setInterval(function(){ colour -= 1000; $('body').css({background:'#' + colour.toString(16)}); }, 50); How can I convert a value between 1 and 16777215 to a colour on the colour spectrum shown below?
has comment: http://stackoverflow.com/comment/47830085
has comment: http://stackoverflow.com/comment/47830666
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47832745

http://stackoverflow.com/comment/48068555
has text: @Hogan: `results[match] ?= [ ]` would probably be more idiomatic CoffeeScript. I suspect that any speed differences would be vanishingly small, no?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29972211

http://stackoverflow.com/a/29847690
has comment: http://stackoverflow.com/comment/47822362
upvote count: 2
has comment: http://stackoverflow.com/comment/47822259
accepted answer of: http://stackoverflow.com/q/29847657
answers question: http://stackoverflow.com/q/29847657
has comment: http://stackoverflow.com/comment/47821998
type: AcceptedAnswer
downvote count: 0
has body: var console = function() { $("#textinput").val(); if (console == "hi") {alert("#text input was also hi")} } console is a function, you can't test it against "hi". You want to retrieve the value of the textbox using another variable. You could also try to use the onKeyUp event directly on the textbox to avoid pushing the button everytime you modify the input. Try : $("#click").click(function() { var value = $("#textinput").val(); if (value == "hi") {alert("#text input was also hi")} }); And remove the onclick on the button. http://jsfiddle.net/j6nf2c4z/4/
type: Answer
score: 2

http://stackoverflow.com/q/29872412
tagged with: single-page-application
tagged with: ember.js
has title: Is this method of component communication an Ember anti-pattern?
downvote count: 0
type: UnansweredQuestion
type: Question
score: 1
has body: Take this html and JS: {{#main-view}} &lt;!-- page html - header, content, etc. --&gt; {{some-action tagName='button'}} Do it &lt;!-- more page html --&gt; {{/main-view}} // components/main-view.js Ember.Component.extend({ mainView: true, doSomething: function() { alert('doing something') } }) // components/some-action.js Ember.Component.extend({ mainView: null, configureMainView: function() { this.set('mainView', this.nearestWithProperty('mainView'); }.on('didInsertElement'), click: function() { this.get('mainView').doSomething(); } }) The idea so to have descendent components be able to interact with the interfaces of ancestors. A use case example could be you want the individual page content containers to be able to configure whether or not a hamburger menu is available on the page, like {{page-content show-menu='false'}}. This way you can simply define the menu at the top level and let children configure it as they need for their content. I'm coming from the angular world, but it seems the more preferred way to handle this kind of thing in Ember is to bind to controller properties or handle actions in routes/controller actions at any appropriate level in the action bubbling. I can't help but feel that in many cases the controllers and routes have no business worrying about UI configurations, and so the related UI components should be able to simply communicate with each other and leave the controllers out of it. Another pattern I've actually seen in ember-cli addons has been for children components to lookup and register themselves with a specific parent. And then the parent will call the interfaces of the children, or manipulate them however they see fit. Basically the same concept as above, just the opposite.
has answer: http://stackoverflow.com/a/29876964
upvote count: 1
answer count: 1
tagged with: javascript
favorite count: 0

http://stackoverflow.com/q/29868778
has body: I am having a hard time getting the Angular paging to work correctly. The number of pages seems to be off. For example, for one of my searches, the number of returned results is 1005. Displaying 16 results per page, should have 63 pages total. Instead it generates 101. I appreciate any suggestions on why this is happening and how to resolve. Thanks in advance! {{ x }} {{ x.name }} {{ x.city }} {{ x.state }} {{ x.zip }} {{ x.phone }} " last-text=">>" previous-text="<" first-text="<<"> JavaScript var app = angular.module('myApp', ['ui.bootstrap']); app.controller('formCtrl', function($scope, $http){ $(document).ready(function(){ $('.submit-search').click(function(){ $http.get('model/search_url.php', { params: { searchBy: $scope.user.searchBy, search: $scope.user.search } }).success(function (response){ $scope.json = response; $scope.filteredResults = []; $scope.currentPage = 1 $scope.numPerPage = 16 $scope.maxSize = 5; $scope.$watch("currentPage + numPerPage", function() { var begin = (($scope.currentPage - 1) * $scope.numPerPage); var end = begin + $scope.numPerPage; $scope.filteredResults = $scope.json.results.slice(begin, end); }); }); }); });
type: AnsweredQuestion
score: 2
downvote count: 0
has answer: http://stackoverflow.com/a/29868959
accepted answer: http://stackoverflow.com/a/29868959
type: Question
tagged with: pagination
tagged with: javascript
upvote count: 2
has comment: http://stackoverflow.com/comment/47862596
has comment: http://stackoverflow.com/comment/47862770
answer count: 1
favorite count: 0
tagged with: angularjs
has title: Angular paging generates wrong number of pages
tagged with: twitter-bootstrap
has comment: http://stackoverflow.com/comment/47862842

http://stackoverflow.com/comment/117159630
type: AnswerComment
comment on: http://stackoverflow.com/a/29988202
has text: six years later, the main reason to need this is because IE11 just won't effing die, and everything else has long since moved on to ES6 whereas IE11 is stuck in the now-dead ES5 era. Making IE11 pull special "for ie11 only" unoptimized ES5 versions of what every other browser is getting a modern, optimized ES6 js payload for has actually become more important, rather than less important =(
type: Comment
score: 0

http://stackoverflow.com/a/30073315
answers question: http://stackoverflow.com/q/29916030
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 1
has body: Confirmed: this will be part of mix-mode to be released.
score: 1
accepted answer of: http://stackoverflow.com/q/29916030

css
tags question: http://stackoverflow.com/q/29858721
tags question: http://stackoverflow.com/q/29990081
tags question: http://stackoverflow.com/q/29885227
tags question: http://stackoverflow.com/q/29888960
tags question: http://stackoverflow.com/q/29921683
tags question: http://stackoverflow.com/q/29976485
tags question: http://stackoverflow.com/q/29955604
tags question: http://stackoverflow.com/q/29949146
tags question: http://stackoverflow.com/q/29897717
tags question: http://stackoverflow.com/q/29980765
tags question: http://stackoverflow.com/q/29861511
tags question: http://stackoverflow.com/q/29907823
tags question: http://stackoverflow.com/q/29953281
tags question: http://stackoverflow.com/q/29878561
tags question: http://stackoverflow.com/q/29983315
tags question: http://stackoverflow.com/q/29947329
tags question: http://stackoverflow.com/q/30001862
tags question: http://stackoverflow.com/q/29946420
tags question: http://stackoverflow.com/q/29938409
tags question: http://stackoverflow.com/q/29865728
tags question: http://stackoverflow.com/q/29893390
tags question: http://stackoverflow.com/q/29886377
tags question: http://stackoverflow.com/q/29846642
tags question: http://stackoverflow.com/q/29909215
tags question: http://stackoverflow.com/q/29957903
tags question: http://stackoverflow.com/q/29989777
tags question: http://stackoverflow.com/q/29984341
tags question: http://stackoverflow.com/q/29947547
tags question: http://stackoverflow.com/q/29953628
tags question: http://stackoverflow.com/q/29983163
tags question: http://stackoverflow.com/q/29988477
tags question: http://stackoverflow.com/q/29959451
tags question: http://stackoverflow.com/q/29985022
tags question: http://stackoverflow.com/q/29947256
tags question: http://stackoverflow.com/q/29890460
tags question: http://stackoverflow.com/q/29933597
tags question: http://stackoverflow.com/q/29876010
tags question: http://stackoverflow.com/q/29869379
tags question: http://stackoverflow.com/q/29945470
tags question: http://stackoverflow.com/q/29942144
tags question: http://stackoverflow.com/q/29974201
tags question: http://stackoverflow.com/q/29934317
tags question: http://stackoverflow.com/q/29975948
tags question: http://stackoverflow.com/q/29962695
tags question: http://stackoverflow.com/q/29985360
tags question: http://stackoverflow.com/q/29853523
tags question: http://stackoverflow.com/q/29993223
tags question: http://stackoverflow.com/q/29894577
tags question: http://stackoverflow.com/q/29920351
tags question: http://stackoverflow.com/q/29982993
tags question: http://stackoverflow.com/q/29944552
tags question: http://stackoverflow.com/q/29936355
tags question: http://stackoverflow.com/q/29921951
tags question: http://stackoverflow.com/q/29909437
tags question: http://stackoverflow.com/q/29952248
tags question: http://stackoverflow.com/q/29857337
tags question: http://stackoverflow.com/q/29910022
tags question: http://stackoverflow.com/q/29904576
tags question: http://stackoverflow.com/q/29961236
tags question: http://stackoverflow.com/q/29929528
tags question: http://stackoverflow.com/q/29972009
tags question: http://stackoverflow.com/q/29901139
tags question: http://stackoverflow.com/q/29856201
tags question: http://stackoverflow.com/q/29864288
tags question: http://stackoverflow.com/q/29893569
tags question: http://stackoverflow.com/q/29985364
tags question: http://stackoverflow.com/q/29968883
tags question: http://stackoverflow.com/q/29857393
tags question: http://stackoverflow.com/q/29987154
tags question: http://stackoverflow.com/q/29918465
tags question: http://stackoverflow.com/q/29915144
tags question: http://stackoverflow.com/q/29856075
tags question: http://stackoverflow.com/q/29934522
tags question: http://stackoverflow.com/q/29903896
tags question: http://stackoverflow.com/q/29995241
tags question: http://stackoverflow.com/q/29876454
tags question: http://stackoverflow.com/q/29969529
tags question: http://stackoverflow.com/q/29884014
tags question: http://stackoverflow.com/q/29847452
tags question: http://stackoverflow.com/q/29871313

http://stackoverflow.com/a/29859297
has body: When you chain promises, you invoke the next function in the chain with the result of the previous function. However, you're invoking your function that returns a promise directly. So unless invoking that function returns a function that returns a Promise, you're not correctly chaining. So either of these would work: .spread(generator.playlist_manipulate) // returns Promise.resolve([data, anotherData]) .then(client.incrAsync) // this function will receive [data, anotherData] Or, as you used in your question, an anonymous function: .spread(generator.playlist_manipulate) // returns Promise.resolve([data, anotherData]) .then(function() { // this function receives [data, anotherData] but throws it away // this Promise is "subsumed" by the Promise chain. The outer Promise BECOMES this Promise return client.incrAsync(config.channel_name + ":ad_hits", "vdvd"); }) Because otherwise, what you've written is basically this: .then(function) .then(Promise) .then(function) But you need to pass functions to .then, not Promises, if you want them to be handled by your .catch block at the end.
has comment: http://stackoverflow.com/comment/47844695
type: AcceptedAnswer
upvote count: 3
has comment: http://stackoverflow.com/comment/47844473
has comment: http://stackoverflow.com/comment/47844750
type: Answer
answers question: http://stackoverflow.com/q/29859210
accepted answer of: http://stackoverflow.com/q/29859210
has comment: http://stackoverflow.com/comment/47844527
downvote count: 0
score: 3
has comment: http://stackoverflow.com/comment/47844673

http://stackoverflow.com/comment/48152559
type: AnswerComment
comment on: http://stackoverflow.com/a/29969523
type: Comment
has text: I have not had the time to resume this project. I'm hoping to jump back in tonight or tomorrow. I'll let you know what I end up doing. Thanks!
score: 0

http://stackoverflow.com/comment/47945349
type: Comment
has text: Felix Kling's answer on the duplicate is spot on for what you can do.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/29911623

http://stackoverflow.com/comment/48046998
has text: The mozilla version is easier to read though, as the official ones are in PDF
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29963279
type: Comment

http://stackoverflow.com/a/29951214
type: Answer
has body: You're overwriting your setTimeout by both assigning them to the variable timerId. Give them both unique names and they will be able to run simultaneously.
has comment: http://stackoverflow.com/comment/48023387
answers question: http://stackoverflow.com/q/29951131
score: 0

http://stackoverflow.com/q/29926387
tagged with: javascript
has comment: http://stackoverflow.com/comment/47974481
tagged with: ajax
has body: I have a PHP array which is created in the following way: $treearr = array( array("root","search","Search",false,"xpLens.gif"), array("root","hometab","Home Tab",false,"home.gif"), array("root","stafftab","Staff Tab",false,"person.gif"), array ("stafftab","newstaff","New Staff",false,"newperson.gif")); (it generates a tree view control) How do I convert this array into a javascript array which I can pass into a jQuery ajax call? I've looked at many similar questions but nobody seems to have an array in this same format. I've tried all kinds of combinations of json_decode, json_encode, JSON.stringify(), JSON.parse(),$.parseJSON, and nothing works.
has comment: http://stackoverflow.com/comment/47974760
favorite count: 0
has comment: http://stackoverflow.com/comment/47974717
has comment: http://stackoverflow.com/comment/47974608
type: UnansweredQuestion
downvote count: 2
tagged with: php
has title: How to pass array of arrays through jQuery ajax
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/29926587
type: Question
upvote count: 0
score: -2
answer count: 1

http://stackoverflow.com/comment/54351623
has text: `time` has no format. Only when you show (stringify) it, it will use the local timezone for formatting the string. If you explicitly use `time.toUTCString()`, it won't.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29923971

http://stackoverflow.com/comment/48118391
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29999602
has text: it says: "Scale the background image to be as large as possible so that the background area is completely covered by the background image. **Some parts of the background image may not be in view within the background positioning area**" so this part that is not visible is outside the box, then it's bigger than the box, so it's not the same size
score: 0

http://stackoverflow.com/comment/48009737
has text: The problem in my case is that console.log gives me message that i have scrolled to the particular point, but the content is not being loaded.
comment on: http://stackoverflow.com/a/29944064
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/comment/47982097
comment on: http://stackoverflow.com/q/29929851
type: QuestionComment
type: Comment
score: 1
has text: You need to use "_ $httpBackend _" for the $http object. There might be other things wrong as well. Should also point out that doing http calls inside a controller is frowned upon.

http://stackoverflow.com/comment/47833494
type: QuestionComment
has text: I looked around and was only able to find examples of extracting query string parameters within components, via `getCurrentQuery`
type: Comment
comment on: http://stackoverflow.com/q/29852998
score: 0

http://stackoverflow.com/q/29855832
answer count: 3
tagged with: javascript
possible better answer: http://stackoverflow.com/a/29855853
tagged with: jquery
favorite count: 0
tagged with: ajax
has title: Variable in AJAX url
has answer: http://stackoverflow.com/a/29855866
accepted answer: http://stackoverflow.com/a/29855866
has comment: http://stackoverflow.com/comment/47837683
type: AnsweredQuestion
upvote count: 0
type: Question
has body: How can I use a variable within an AJAX call URL? So far I have the following: id = $(this).children('span.title').attr('data-id'); $("#test").load("http://localhost:8888/projects/superfreerespo/ + id/ .gameBox-Ops"); There is something wrong with the way I have declared the url but being relatively knew to Ajax I am a little unsure where I am going wrong. Just to point out the .gameBox-Ops is not part of the URL, it is the class of the container I am trying to call with AJAX
has answer: http://stackoverflow.com/a/29855867
score: -2
has answer: http://stackoverflow.com/a/29855853
downvote count: 2

http://stackoverflow.com/q/29896322
has body: I am using express.js and I need to make a call to HTTP GET request ,to fetch JSON data .Please suggest me some good node js/express js modules/lib to perform get/post request .
has answer: http://stackoverflow.com/a/29896602
answer count: 2
score: 2
downvote count: 0
tagged with: javascript
has title: Node JS OR Express JS HTTP GET Request
tagged with: express
favorite count: 0
tagged with: node.js
has answer: http://stackoverflow.com/a/29896465
upvote count: 2
type: UnansweredQuestion
type: Question

http://stackoverflow.com/comment/47991068
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29933753
has text: In jquery code. `var cssClass = "selected";` `oBoxCollection.removeClass(cssClass).eq(displayBoxIndex).addClass(cssClass);`
score: 0

http://stackoverflow.com/comment/47975333
score: 0
has text: Use this function in addition to the first reverse function: `function removeContactIDByID(contactDocId, organisation) { var CurrDb = session.getCurrentDatabase(); var contact = CurrDb.getDocumentByUNID(contactDocId); if (contact != null && organisation != null) { removeContactID(contact, organisation); contact.save(); } }`
type: Comment
comment on: http://stackoverflow.com/a/29875345
type: AnswerComment

http://stackoverflow.com/q/29889998
tagged with: php
has comment: http://stackoverflow.com/comment/47903733
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/29890280
has answer: http://stackoverflow.com/a/29890479
has comment: http://stackoverflow.com/comment/47903542
has body: How can one make an HTML file to create a file or read/write to a file? Is it possible to do that? Or is it possible in any other scripting language like JavaScript, jQuery, PHP? I am trying to do this : User gives some information and that information is stored to a file.When user tries to read the information, information stored in the file is read. I'm trying to make these file operations on a local storage(Hard drive).Can a HTML file create a file in its folder ( HTML folder where HTML file is located ) on local storage ?
type: Question
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29890310
has answer: http://stackoverflow.com/a/29890131
accepted answer: http://stackoverflow.com/a/29890131
has answer: http://stackoverflow.com/a/29890280
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 4
has comment: http://stackoverflow.com/comment/47903751
linked to: http://stackoverflow.com/q/3665115
has comment: http://stackoverflow.com/comment/47904131
has title: How to do File I/O operations in HTML?

lodash
tags question: http://stackoverflow.com/q/29995232
tags question: http://stackoverflow.com/q/29951293
tags question: http://stackoverflow.com/q/29896225
tag name: lodash
tags question: http://stackoverflow.com/q/29919772
tags question: http://stackoverflow.com/q/29852361
tags question: http://stackoverflow.com/q/29880712
tags question: http://stackoverflow.com/q/29976138
tags question: http://stackoverflow.com/q/29906602
type: Tag
tags question: http://stackoverflow.com/q/29978007
tags question: http://stackoverflow.com/q/29872840
tags question: http://stackoverflow.com/q/29915540
tags question: http://stackoverflow.com/q/29978252
tags question: http://stackoverflow.com/q/29977400
tags question: http://stackoverflow.com/q/29955054

recursion
type: Tag
tags question: http://stackoverflow.com/q/29925948
tag name: recursion
tags question: http://stackoverflow.com/q/29882220
tags question: http://stackoverflow.com/q/29939567
tags question: http://stackoverflow.com/q/29982231
tags question: http://stackoverflow.com/q/29921701
tags question: http://stackoverflow.com/q/29927160
tags question: http://stackoverflow.com/q/29994249

http://stackoverflow.com/q/29930648
has comment: http://stackoverflow.com/comment/47984326
tagged with: jquery
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/47983585
has body: Let jQuery AJAX Change This Text Get External Content Hi, I am new to Javascript & Jquery so please forgive me for any newbie mistake. What I am trying to do here is send a get request to the mta api(http://bustime.mta.info/wiki/Developers/SIRIVehicleMonitoring ) and simply just print the json response once the user clicks a button. The code is not printing out anything when the button clicks. Can anyone detect the problem with the code above? I would appreciate it a lot.
has comment: http://stackoverflow.com/comment/47983814
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47983744
has comment: http://stackoverflow.com/comment/47983918
score: 1
has answer: http://stackoverflow.com/a/29930879
accepted answer: http://stackoverflow.com/a/29930879
has comment: http://stackoverflow.com/comment/47983593
type: Question
has comment: http://stackoverflow.com/comment/47983606
tagged with: http://stackoverflow.com/tag/json
tagged with: javascript
tagged with: get
upvote count: 2
has title: Jquery .ajax get request for a json response
answer count: 1
downvote count: 1

http://stackoverflow.com/comment/47881485
type: Comment
comment on: http://stackoverflow.com/a/29878697
score: 0
type: AnswerComment
has text: Let me clarify, I added return false, it worked. Hence answer, not comment. Appearing and vanishing immediately suggests a postback.

http://stackoverflow.com/comment/48061462
score: 0
type: AnswerComment
has text: I want to completely fill the circle. I suppose I could use this method to keep making smaller circles till I get to the center. I'll give it a go :)
type: Comment
comment on: http://stackoverflow.com/a/29914566

http://stackoverflow.com/a/29971701
score: 9
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/48071063
upvote count: 9
type: Answer
has body: You can add a property to the existing params object like this: $(function() { $('#name').editable({ url: '/echo/json/', pk: 123, params:{a:1,b:2} }) .on('shown', function(e, editable) { editable.options.params.c = 3; // editable.options.params is now {a: 1, b: 2, c: 3} }); }); Hope this helps.
downvote count: 0
answers question: http://stackoverflow.com/q/29969530
accepted answer of: http://stackoverflow.com/q/29969530

http://stackoverflow.com/q/29908223
has comment: http://stackoverflow.com/comment/47938933
has comment: http://stackoverflow.com/comment/47938862
has answer: http://stackoverflow.com/a/29908532
has comment: http://stackoverflow.com/comment/47939010
downvote count: 1
tagged with: object
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47939167
accepted answer: http://stackoverflow.com/a/29908532
type: Question
score: 5
answer count: 1
tagged with: javascript
favorite count: 0
has title: JavaScript object with multiple values
has body: I am trying to build a set of questions and answers for a questionnaire. Each instance has an id, a css class, a question, and at least one answer. Is it possible to have multiple values when there is more than one answer? var qa = [ {id: "0", css: "multiple", question: "Do you own a home?", answers: "Yes", "No"}, {id: "1", css: "input", question: "Who will live in your home?", answer: "&lt;textarea rows='5' class='textarea'&gt;&lt;/textarea&gt;"} ];
upvote count: 6

http://stackoverflow.com/a/30884113
downvote count: 0
answers question: http://stackoverflow.com/q/29920784
upvote count: 1
has body: Just test this swal.withForm({ title: 'Cool example', text: 'Any text that you consider useful for the form', showCancelButton: true, confirmButtonColor: '#DD6B55', confirmButtonText: 'Get form data!', closeOnConfirm: true, formFields: [ { id: 'name', placeholder:'Name Field' }, { id: 'nickname', placeholder:'Add a cool nickname' } ], function(isConfirm) { // do whatever you want with the form data console.log(this.swalForm); // { name: 'user name', nickname: 'what the user sends' } }) https://github.com/taromero/swal-forms
type: Answer
score: 1

http://stackoverflow.com/comment/47980678
comment on: http://stackoverflow.com/a/29927547
score: 0
type: Comment
has text: I'm also aware of Array.prototype.reduce(), but then this serves a specific purpose and I think that my example is best suited for reduce. But I wanted to see the choice of using map() and array()
type: AnswerComment

http://stackoverflow.com/a/30455153
has body: I was asking myself why it worked correctly the first time and not the following times...and i had this idea : maybe callback function is subscribed to plugin first time but not the next times. And this is exactly the source of my problem. I call "pushNotification.register" only one time to init plugin and get ids... But the next time I launch app, i don't instanciate again the plugin, so pushplugin don't know which method to call in callback request. So answer is : Call "pushNotification.register" in each application launch ! In my code, i have to call method below on each "deviceready" event : helper.init = function() { // Instanciate push plugin notification var pushNotification = window.plugins.pushNotification; var errorHandler = function(error) { logger.debug('errorHandler = ' + error); }; if ($rootScope.isAndroid()) { var senderId = CONFIG.NOTIFICATION_ANDROID_SENDER_ID; pushNotification.register(function(result) { logger.debug('successHandler = ' + result); }, errorHandler, { 'senderID' : senderId, 'ecb' : 'onNotificationGCM' }); } };
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29965115
score: 0
type: Answer
answers question: http://stackoverflow.com/q/29965115

http://stackoverflow.com/q/29990556
linked to: http://stackoverflow.com/q/1912501
type: Question
tagged with: encoding
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/29990632
has answer: http://stackoverflow.com/a/29990572
upvote count: 3
has body: I am returning special characters (specifically °) in JavaScript/jQuery, but it is not converting the entity to the desired character in the display. How can I display the degree sign correctly? It must be simple; what am I missing? I have checked decodeURL, but it does nothing. Demo fiddle The HTML: Try to give answer is: But should look like: 5 °C And the Javascript with jQuery: $('#target').text('5 °C'); Output:
accepted answer: http://stackoverflow.com/a/29990572
answer count: 2
has title: Appending a special character with jQuery not working
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
type: AnsweredQuestion
score: 3
downvote count: 0
has comment: http://stackoverflow.com/comment/48100697
has answer: http://stackoverflow.com/a/29990632

http://stackoverflow.com/comment/47860443
comment on: http://stackoverflow.com/q/29867722
type: QuestionComment
type: Comment
has text: Yes, there is. The direct successor is `Notification` API. It's slightly different, but it should not be hard to adapt code.
score: 0

http://stackoverflow.com/comment/47820882
type: Comment
has text: @vtz the alert displays taskName correctly.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/29847063

http://stackoverflow.com/comment/48030492
comment on: http://stackoverflow.com/a/29926280
type: Comment
has text: Glad to hear you figured it out.
type: AnswerComment
score: 0

http://stackoverflow.com/q/29955313
has body: These are my instructions: have four arguments that are all number return "correct" if the four numbers are a valid combination return "incorrect" if the 4 numbers aren't a valid combination a combination is valid if: the first number is a 3, 5, or 7 the second number is 2 the third number is between 5 and 100. 5 and 100 are both valid numbers the fourth number is less than 9 or greater than 20. 9 and 20 both invalid numbers This is my code: module.exports.checkLock = function(a, b, c, d) { if (a === 3 || 5 || 7, b === 2, c &gt;= 5 || c &lt;= 100, d &lt; 9 || d &gt; 20) { return "correct"; } else { return "incorrect"; } }; And this is the error I am getting: 1) checkLock should return 'incorrect' for the incorrect first number example: AssertionError: expected 'correct' to deeply equal 'incorrect' + expected - actual +"incorrect" -"correct" at Context.&lt;anonymous&gt; (spec.js:39:49) 2) checkLock should return 'incorrect' for incorect second number: AssertionError: expected 'correct' to deeply equal 'incorrect' + expected - actual +"incorrect" -"correct" at Context.&lt;anonymous&gt; (spec.js:43:49) 3) checkLock should return 'incorrect' for invalid third numbers: AssertionError: expected 'correct' to deeply equal 'incorrect' + expected - actual +"incorrect" -"correct" Any help would be appreciated. Also, sorry about formatting.
score: -1
has title: if/else statement is correct, but not returning incorrect
type: Question
downvote count: 2
upvote count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/48031592
favorite count: 0
has comment: http://stackoverflow.com/comment/48031675
has comment: http://stackoverflow.com/comment/48031641
has comment: http://stackoverflow.com/comment/48031467
answer count: 4
has answer: http://stackoverflow.com/a/29955400
has answer: http://stackoverflow.com/a/29956728
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29955379
tagged with: if-statement
has comment: http://stackoverflow.com/comment/48031390
has answer: http://stackoverflow.com/a/29955487

http://stackoverflow.com/q/29933794
has comment: http://stackoverflow.com/comment/47989845
answer count: 1
has answer: http://stackoverflow.com/a/29935302
has comment: http://stackoverflow.com/comment/47990502
tagged with: qml
tagged with: javascript
upvote count: 4
type: AnsweredQuestion
downvote count: 0
has comment: http://stackoverflow.com/comment/47991932
favorite count: 0
accepted answer: http://stackoverflow.com/a/29935302
type: Question
has title: How to add items to a QML Grid after creation?
tagged with: qt
has comment: http://stackoverflow.com/comment/47989995
score: 4
has body: I've done a bit of searching but I've failed to find an answer which must be so simple it hasn't warranted a question thus far. Anyway I'm new to QML and struggling to find a way to add items to a Grid dynamically post-creation. Basically I have a Flickable with a Grid inside it containing (by default) four instances of a custom class named ImageTile, and when the MouseArea detects there's a click it wants to add 2 instances of ImageTile to that grid. Here is a snippet of the code: Flickable { anchors.fill: parent contentWidth: 400 contentHeight: 800 clip: true MouseArea { id: mouseArea anchors.fill: parent onclicked: { /* ADD TWO ImageTile TO imageGrid */ } } Grid { id: imageGrid columns: 2 spacing: 2 Repeater { model: 4 ImageTile { } } } } As you can see I'm wondering what I should put inside the onClicked event to achieve adding two new instances of ImageTile to imageGrid. Thanks in advance for any help!

http://stackoverflow.com/comment/48048847
comment on: http://stackoverflow.com/a/29957147
score: 0
type: Comment
has text: @James Trust me, with regex, the simplest solution is always to break it down and not try to do too much at once ;)
type: AnswerComment

http://stackoverflow.com/q/29962982
favorite count: 0
accepted answer: http://stackoverflow.com/a/29977271
tagged with: yeoman
tagged with: node.js
type: AnsweredQuestion
score: 3
upvote count: 3
has body: I used yeoman yeogurt generator to kickstart my project. The grunt file generated uses (to the best of my knowledge) include-all and grunt-jit to load the modules. What I would like to do, is add the building of jekyll to this file. To do this I installed grunt-jekyll. Afterwards I created a simple config file in grunt/config/compile/ and added the following: // Configuration for jekyll task(s) // Compiles the blog 'use strict'; var taskConfig = function(grunt) { grunt.config.set('jekyll', { options: { // Universal options bundleExec: true, src : '&lt;%= jekyll %&gt;' }, dist: { // Target options: { // Target options dest: '&lt;%= dist %&gt;/blog', config: '_config.yml,_config.build.yml' } } }); }; module.exports = taskConfig; After creating this file, I tested if grunt was still working by running "grunt build" and as it turns out, it didn't. I get the following error: Running "useminPrepare:html" (useminPrepare) task Going through dist/index.html to update the config Looking for build script HTML comment blocks Fatal error: Maximum call stack size exceeded I have no idea why I get this error, as I did not tell grunt to do anything with jekyll (except load it), so I would not expect anything to have changed. Removing the file makes my grunt setup function without error. Adding jekyll:dist to grunt/tasks/build.js results in a similar error but in the correct module: Running "jekyll:dist" (jekyll) task Warning: Maximum call stack size exceeded Use --force to continue. I don't know if it helps, but here is some extra info about my setup: node v0.12.2 grunt: v0.4.5 grunt-cli: v0.1.13 using: jade, sass, dashboard gruntfile: https://gist.github.com/Boelensman1/95bb3ec7298377c8c4c9 package.json: https://gist.github.com/Boelensman1/1f0c97a7d7720f9e2be4 .yo-rc.json: https://gist.github.com/Boelensman1/cef88cb2cb925faa355d build.js: https://gist.github.com/Boelensman1/5f55c251648b881e3f2d I think I made an error in my jekyll config file, but I don't see where. If someone cou…
type: Question
downvote count: 0
tagged with: javascript
tagged with: gruntjs
has answer: http://stackoverflow.com/a/29977271
has title: Stack overflow after adding jekyll to the gruntjs setup generated by yeogurt
tagged with: jekyll
answer count: 1

http://stackoverflow.com/a/29927322
type: Answer
downvote count: 0
has body: MDN's compat table is wrong; I'll make sure it gets updated. As of Chrome 44.0.2376.0 dev, these methods are only available behind the "Enable Experimental Web Platform Features" flag.
score: 3
has comment: http://stackoverflow.com/comment/55504865
has comment: http://stackoverflow.com/comment/47978306
upvote count: 3
accepted answer of: http://stackoverflow.com/q/29912177
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29912177

http://stackoverflow.com/q/29878363
has body: I have a simple php library https://github.com/MonsterGfx/PHP-MPD-Client It's work fine with my symfony2, but until mpd server is offline. I want to check mpd status - static function checkSource(\MDS\SiteBundle\Entity\Source $source) { try { MPD::connect($source-&gt;getMpdpassword(), $source-&gt;getMpdhost(), $source-&gt;getMpdport()); } catch (MPDConnectionFailedException $e) { return false; } $ping = MPD::send("ping"); if ($ping['status'] == 'OK') { return true; } else { return false; } } Problem is when server is offline, I get throw Warning: fsockopen(): unable to connect to planeset.ru:6600 (Connection refused) 500 Internal Server Error - ContextErrorException But I have to catch error. I see the code in the library if(!static::$fp) { // no connection throw new MPDConnectionFailedException("$errstr ($errno)"); } Why I can't catch error and have a 500 error ? What I do wrong way ?
duplicate of: http://stackoverflow.com/q/8239994
score: 0
tagged with: exception
tagged with: symfony
downvote count: 1
tagged with: mpd
has comment: http://stackoverflow.com/comment/47880821
answer count: 0
has title: Why I Can not catch Exception
type: UnansweredQuestion
tagged with: php
has comment: http://stackoverflow.com/comment/47880881
type: Question
linked to: http://stackoverflow.com/q/8239994
upvote count: 1
tagged with: javascript
favorite count: 0

http://stackoverflow.com/a/29879693
answers question: http://stackoverflow.com/q/29879501
has comment: http://stackoverflow.com/comment/47885146
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/47885689
has body: You can split the string to an array, splice random items, and join back to a string: var arr = str.split(''); for(var i=0; i&lt;3; ++i) arr.splice(Math.floor(Math.random() * arr.length), 1); str = arr.join('');
upvote count: 1
type: Answer

http://stackoverflow.com/a/29955022
type: Answer
answers question: http://stackoverflow.com/q/29944754
score: 0
has body: Not sure I understand what you are trying to do. Are you trying to obfuscate your code before launching it in production ? Do you need to preserve the css associated with those elements ? Does something like this helps you ? https://jsfiddle.net/p36pre5o/6/ $('#btn').click(function(){ var guid = generateUUID(); $('.test').removeClass('test').addClass(guid); }); This code will find all elements with a class test and replace it with a random guid.

http://stackoverflow.com/a/29891150
answers question: http://stackoverflow.com/q/29891004
upvote count: 1
type: Answer
has comment: http://stackoverflow.com/comment/47905869
downvote count: 0
has body: I think the best way in context of this is to wrap your code like this function guess() { if(guess &gt; numberToGuess) { } if (guess &lt; numberToGuess) { } if (guess == numberToGuess) { ... return; } else guess(); }
score: 1

http://stackoverflow.com/q/29846401
has comment: http://stackoverflow.com/comment/47822099
has comment: http://stackoverflow.com/comment/47824520
has comment: http://stackoverflow.com/comment/47821933
has comment: http://stackoverflow.com/comment/47821606
answer count: 1
tagged with: javascript
upvote count: 1
tagged with: global
has title: JavaScript Faux Pas - Let me put global libraries on the window?
has body: I'm using RequireJS. I absolutely hate the double variable syntax of defining a dependency and passing it in as a variable in a callback function. I am therefore attempting the implement the 'Sugar' syntax available in RequireJS. However, I only want to 'import' global libraries like Backbone, jQuery, Underscore and Marionette once. jQuery and Backbone obviously assign themselves to the Window object but Underscore and Marionette do not. This is my main.js file: require.config({ paths: { "jquery" : "vendor/jquery.min", "underscore": "vendor/underscore-min", "backbone" : "vendor/backbone-min", "marionette" : "vendor/marionette", "app" : "app/app" } }); define(function(require, exports, module) { // Make these libraries available globally var jquery = require('jquery'); window.underscore = require('underscore'); var Backbone = require('backbone'); window.marionette = require('marionette'); // Require and start our own app var app = require('app'); app.start(); }); This obviously stops me from having to import/require each of these core libraries into every subsequent module/component for my application. Taking my code from potentially this (app.js file): define(function (require, exports, module) { var jquery = require('jquery'), underscore = require('underscore'), Backbone = require('backbone'), Marionette = require('marionette'), // module specific libs mymodule = require('../js/app/module'), logger = require('../js/app/logger'); return { start: function () { var testview = new mymodule(); logger.logme(); } } }); To this (better app.js): define(function (require, exports, module) { var mymodule = require('../js/app/module'), logger = require('../js/app/logger'); return { start: function () { var testview = new mymodule(); logger.logme(); } } }); Much cleaner IMO. So thoughts? Criticisms? Are these going to play well together? (two already do it themselves - why not for the other two if they are core to the app). In my head I don't think it will be a problem as long …
favorite count: 0
has comment: http://stackoverflow.com/comment/47823186
has comment: http://stackoverflow.com/comment/47894361
downvote count: 0
type: UnansweredQuestion
tagged with: requirejs
has comment: http://stackoverflow.com/comment/47822526
has comment: http://stackoverflow.com/comment/47822933
has comment: http://stackoverflow.com/comment/47820131
has answer: http://stackoverflow.com/a/29846908
score: 1
has comment: http://stackoverflow.com/comment/48002530
type: Question

http://stackoverflow.com/comment/47982908
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29928676
has text: Well, I was hoping to do it without using extra modules, but Ill give that a try.

http://stackoverflow.com/q/29847665
has answer: http://stackoverflow.com/a/29847711
upvote count: 48
has comment: http://stackoverflow.com/comment/47821126
favorite count: 0
score: 40
has answer: http://stackoverflow.com/a/29847727
type: Question
possible better answer: http://stackoverflow.com/a/29847711
downvote count: 8
accepted answer: http://stackoverflow.com/a/29847718
tagged with: object
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/29862710
answer count: 4
has comment: http://stackoverflow.com/comment/47837292
tagged with: javascript
has answer: http://stackoverflow.com/a/29847718
has body: [object Object] is the default string representation of a JavaScript Object. I would understand if it was just [Object] or [object], but why [object Object]? Why the first word is lowercase and the second one is uppercase? Is it part of JSON or JavaScript?
type: AnsweredQuestion
has title: Why [object Object] mentions "object" twice?

http://stackoverflow.com/a/29954336
has body: This will be a lot easier if each functional component was split out. function getTableRows() { var table = document.getElementById("table"); return table.getElementsByTagName("tr"); } function buildDataStringFromRow(row) { var result = row.cells[1].textContent; var plate = row.cells[6].textContent; var km = row.cells[7].textContent; return 'plate=' + plate + '&amp;km='+km + '&amp;res='+result; } function postData(dataString, callback) { $.ajax({ type: 'POST', url: 'km.php', async: true, data: dataString, cache: false, global: false, success: callback }); } function onRowClick() { $('#loading').show(); var dataString = buildDataStringFromRow(this); postData(dataString, function(result) { $('#loading').hide(); var answer = confirm(result); if (answer == true) { return test(); } } } function found(row) { var tableRows = getTableRows(); if (document.getElementById('ridee').checked) { for (var i = 0; i &lt; tableRows.length; i++) { tableRows[i].onclick = onRowClick.bind(tableRows[i]); } } else { alert("You are rider... So, You can't select"); } } Now that each function is very simple and easy to remove, now you may reason about which part is not working.
score: 0
answers question: http://stackoverflow.com/q/29943708
type: Answer
has comment: http://stackoverflow.com/comment/48644330

http://stackoverflow.com/comment/47969511
type: Comment
comment on: http://stackoverflow.com/a/29923507
has text: "[{\"userId\":\"jswjsjsj\"}]" undefined
type: AnswerComment
score: 0

onclick
tags question: http://stackoverflow.com/q/29963145
tags question: http://stackoverflow.com/q/29992822
tags question: http://stackoverflow.com/q/29853694
tags question: http://stackoverflow.com/q/30000021
tags question: http://stackoverflow.com/q/29959386
tags question: http://stackoverflow.com/q/29979252
tags question: http://stackoverflow.com/q/29952318
tags question: http://stackoverflow.com/q/29945150
tags question: http://stackoverflow.com/q/29980622
tags question: http://stackoverflow.com/q/29856105
tags question: http://stackoverflow.com/q/29902901
tags question: http://stackoverflow.com/q/29951517
tags question: http://stackoverflow.com/q/29921696
tags question: http://stackoverflow.com/q/29870456
tags question: http://stackoverflow.com/q/29877055
tags question: http://stackoverflow.com/q/29981446
type: Tag
tags question: http://stackoverflow.com/q/29936854
tags question: http://stackoverflow.com/q/29991473
tags question: http://stackoverflow.com/q/29900995
tags question: http://stackoverflow.com/q/29953357
tags question: http://stackoverflow.com/q/29845463
tags question: http://stackoverflow.com/q/29922682
tags question: http://stackoverflow.com/q/29859489
tags question: http://stackoverflow.com/q/29935278
tags question: http://stackoverflow.com/q/29925214
tags question: http://stackoverflow.com/q/29996059
tags question: http://stackoverflow.com/q/29906739
tag name: onclick
tags question: http://stackoverflow.com/q/29995426
tags question: http://stackoverflow.com/q/29902128
tags question: http://stackoverflow.com/q/29997650
tags question: http://stackoverflow.com/q/29866784
tags question: http://stackoverflow.com/q/29983886
tags question: http://stackoverflow.com/q/29996236

http://stackoverflow.com/a/29988202
has comment: http://stackoverflow.com/comment/109566042
accepted answer of: http://stackoverflow.com/q/29987969
has body: I'm curious why you specifically need to target IE browsers, but the following code should work if that really is what you need to do: &lt;script type="text/javascript"&gt; if(/MSIE \d|Trident.*rv:/.test(navigator.userAgent)) document.write('&lt;script src="somescript.js"&gt;&lt;\/script&gt;'); &lt;/script&gt; The first half of the Regex (MSIE \d) is for detecting Internet Explorer 10 and below. The second half is for detecting IE11 (Trident.*rv:). If the browser's user agent string matches that pattern, it will append somescript.js to the page.
has comment: http://stackoverflow.com/comment/109311569
score: 92
type: AcceptedAnswer
upvote count: 94
has comment: http://stackoverflow.com/comment/48096250
type: Answer
has comment: http://stackoverflow.com/comment/78848844
has comment: http://stackoverflow.com/comment/117159630
answers question: http://stackoverflow.com/q/29987969
downvote count: 2

http://stackoverflow.com/q/29990245
score: 2
type: AnsweredQuestion
upvote count: 2
has body: function truncate(str, num) { if(str.length &lt; num) { return str; } else { str = str.slice(0, num); return str; } } truncate('A-tisket a-tasket A green and yellow basket', 11); //truncate('A-tisket a-tasket A green and yellow basket', 'A-tisket a-tasket A green and yellow basket'.length) //truncate('A-tisket a-tasket A green and yellow basket', 'A-tisket a-tasket A green and yellow basket'.length + 2) I need to have the code return 'A-tisket...' if the length of the string is longer than my num argument. When I run this code, it slices to 'A-tisket a-', how can I remove " a-" and add periods to the end when the length of string is longer than my num argument? I tried using .replace() method after .split() but cannot figure a way to replace it.
has title: add periods to the end of string if it's longer than given argument
type: Question
accepted answer: http://stackoverflow.com/a/29990315
has answer: http://stackoverflow.com/a/29990302
possible better answer: http://stackoverflow.com/a/29990301
has answer: http://stackoverflow.com/a/29990315
downvote count: 0
tagged with: javascript
tagged with: string
has comment: http://stackoverflow.com/comment/48099848
favorite count: 0
tagged with: truncate
answer count: 3
has comment: http://stackoverflow.com/comment/48100552
has answer: http://stackoverflow.com/a/29990301

http://stackoverflow.com/comment/48069023
score: 0
comment on: http://stackoverflow.com/q/29974583
type: Comment
type: QuestionComment
has text: KJ Price, Yes, I want the separators in then reg `([\/\\ -.,\'":])` also be an element in the final array. The space `" "` in this case.

http://stackoverflow.com/comment/47835975
type: QuestionComment
has text: Not really clear as to what you're trying to do. You want controls that change the images? The "so whenever one is active corresponding carousel is active as well" part is where you lose me. Also - the buttons themselves are not visible in your jsfiddle.
comment on: http://stackoverflow.com/q/29855039
score: 0
type: Comment

http://stackoverflow.com/q/29896599
tagged with: javascript
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/47915777
upvote count: 21
tagged with: http://stackoverflow.com/tag/html
tagged with: datatables
downvote count: 1
has answer: http://stackoverflow.com/a/77340021
has answer: http://stackoverflow.com/a/55650238
linked to: http://stackoverflow.com/q/29841547
has answer: http://stackoverflow.com/a/29896756
linked to: http://stackoverflow.com/q/29823843
has comment: http://stackoverflow.com/comment/47916678
linked to: http://stackoverflow.com/q/42341158
has answer: http://stackoverflow.com/a/53984639
has title: How can I select all checkboxes from all the pages in a jQuery DataTable
type: Question
has comment: http://stackoverflow.com/comment/47915829
has comment: http://stackoverflow.com/comment/47918037
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29896701
possible better answer: http://stackoverflow.com/a/45883914
has body: I have HTML page which have multiple checkboxes and individually they can be checked. I have button for "Select All" and when I click on this button all the checkboxes should get selected, and when I click again on the same button all the checkboxes should get deselected from all pages. In my original program there are thousands of records, but at a time 10 records are getting display, but when user click on select it should select all thousands record. I am using jQuery Datatables plug-in for displaying the data. It provides pagination, searching, sorting etc. so at a time I am displaying only 10 records on my current page. if I click on next or page number which is provided by Bootstrap Datatable another 10 records will be displayed. As mention in the problem I want to select all check-boxes from all the pages. $(document).ready(function () { $('body').on('click', '#selectAll', function () { if ($(this).hasClass('allChecked')) { $('input[type="checkbox"]', '#example').prop('checked', false); } else { $('input[type="checkbox"]', '#example').prop('checked', true); } $(this).toggleClass('allChecked'); }) }); monitoring Select Name Company Employee Type Address Country varun TCS IT San Francisco US Rahuk TCS IT San Francisco US johm Doe TCS IT San Francisco US Sam TCS IT San Francisco US Lara TCS IT San Francisco US Jay TCS IT San Francisco US Tom TCS IT San Francisco US
has answer: http://stackoverflow.com/a/45883914
has answer: http://stackoverflow.com/a/29898352
accepted answer: http://stackoverflow.com/a/29898352
score: 20
has comment: http://stackoverflow.com/comment/47915702
has comment: http://stackoverflow.com/comment/47916408
has comment: http://stackoverflow.com/comment/47916227
answer count: 7

http://stackoverflow.com/comment/47863044
type: AnswerComment
has text: Thanks this looks really promising. I am looking into it for my situation.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29851593

http://stackoverflow.com/q/29926242
type: Question
has comment: http://stackoverflow.com/comment/47974238
has title: Multiple GET requests in Angular interfere the $scopes
has comment: http://stackoverflow.com/comment/47974353
tagged with: angularjs
has comment: http://stackoverflow.com/comment/47974609
score: 0
answer count: 2
has body: I´m building a MEAN Application. I´ve got the problem that in one view, my $scope gets disabled, when I write a second $http.get to my controller. Here are the not working scopes With this controller (the //GET Media part disables the scopes and causes the error) &lt;script&gt; var app = angular.module('myApp', []); app.controller('projectCtrl', function($scope, $http) { $scope.myVar = false; $scope.toggle = function() { $scope.myVar = !$scope.myVar }; $http.get('/profile/project/').then(function (res){ $scope.projects = res.data; }); //GET Media $http.get('/uploads/media/'+projectId).then(function(data){ console.log('Medien-Daten erhalten'); $scope.media = data; }); }); &lt;/script&gt; Best regards from Germany, David
has answer: http://stackoverflow.com/a/29926506
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47974392
tagged with: javascript
has answer: http://stackoverflow.com/a/29926564
has comment: http://stackoverflow.com/comment/47974523

http://stackoverflow.com/a/30002890
upvote count: 2
type: Answer
score: 2
has body: Several people already have the right answer here already, but to expand the explanation: What's a Reserved Word? Most programming languages set aside (or 'reserve') a short list of words and don't allow them to be used as variable names. Sometimes these are also called 'keywords'. Why Do They Exist? These have been given a special meaning in a programming language and the compiler or interpreter watches for specifically in order to parse your code. In addition, using these words as variable names would make code very hard to read for humans! (One could in theory design a language that required no reserved words, but it would complicate the implementation of the parser as well as making for some confusing code) Where CAN Reserved Words Be Used? In JavaScript, you can't use a keyword as a variable name, but you CAN use it as the name of an object property. So for instance, var delete = {foo: 3}; // Forbidden var foo = {delete: 3}; // Allowed What Are the Reserved Words in Javascript? As of the ECMAscript 6 spec, the reserved words (keywords) in JavaScript are: await break case class catch const continue debugger default delete do else enum export extends finally for function if import in instanceof let new return super switch this throw try typeof var void while with yield
downvote count: 0
answers question: http://stackoverflow.com/q/30002591

http://stackoverflow.com/q/29915144
has comment: http://stackoverflow.com/comment/47952922
upvote count: 4
answer count: 2
downvote count: 0
has title: How to detect overlapping (rotated) DOM elements given mouse coordinate?
tagged with: jquery
favorite count: 0
linked to: http://stackoverflow.com/q/22521982
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29920814
has comment: http://stackoverflow.com/comment/51328636
has comment: http://stackoverflow.com/comment/47952455
tagged with: css
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29915833
linked to: http://stackoverflow.com/q/11229040
possible better answer: http://stackoverflow.com/a/29915833
type: Question
has comment: http://stackoverflow.com/comment/47952216
accepted answer: http://stackoverflow.com/a/29920814
tagged with: javascript
has body: I use the following script in order to get a list of overlapping DIV elements at mouse click coordinates. In this example script works fine if the DIV are not rotated: http://jsfiddle.net/eyxt2tt1/2/ If I apply a rotation on a DIV and user click (near red mark in this example) http://jsfiddle.net/eyxt2tt1/3/ The script will always return two DIV when instead it should consider only one. I need to know: How to consider the rotation in my calculation? Do you know a better approach/alternatives? Notes: I cannot use Document.elementFromPoint() They are similar question on SO, but I consider this one different as I need to solve the "rotation issue" in particular. I would appreciate your ideas in the jsfiddle $(document).click(function (e) { var hitElements = getHitElements(e); var output = $('#output'); output.html(''); for (var i = 0; i &lt; hitElements.length; ++i) { output.html(output.html() + '&lt;br /&gt;' + hitElements[i][0].tagName + ' ' + hitElements[i][0].id); }; }); var getHitElements = function (e) { var x = e.pageX; var y = e.pageY; var hitElements = []; $(':visible').each(function () { console.log($(this).attr("id"), $(this).outerWidth()); var offset = $(this).offset(); console.log('+++++++++++++++++++++'); console.log('pageX: ' + x); console.log('pageY: ' + y); console.log($(this).attr("id"), $(this).offset()); console.log('+++++++++++++++++++++'); if (offset.left &lt; x &amp;&amp; (offset.left + $(this).outerWidth() &gt; x) &amp;&amp; (offset.top &lt; y &amp;&amp; (offset.top + $(this).outerHeight() &gt; y))) { console.log('included: ', $(this).attr("id")); console.log('from 0p far x: ', $(this).attr("id"), offset.left + $(this).outerWidth()); console.log('from 0p far y: ', $(this).attr("id"), offset.top + $(this).outerHeight()); hitElements.push($(this)); } }); return hitElements; }
score: 4

http://stackoverflow.com/q/29902281
has title: Node.js convert binary file to utf8
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29904711
has comment: http://stackoverflow.com/comment/131884128
has body: I have a jrmxl (Jasper report) file stored in a postgresql database in a binary format (bytea). I'm trying to read that file and convert it into a plain jrmxl (XML) file and save it on the disk. Here is what i've tried so far var fs = require('fs'); exports.saveFile = function (pg) { //pg is the postgres connection to query the db pg.query('Select data from data_file where id = 123', function (err, result) { if (err) { console.log(err); return; } var data = result.rows[0].data; //Buffer.isBuffer(data) === true // I can get the data here. Now I try to convert it into text var file = data.toString('utf8'); fs.writeFile('report.jrxml',file, function (er) { if (er) { console.log('an error occurred while saving the file'); return; } console.log('file saved'); }} }); } If i run the code above, the file is saved but it's somehow binary. How can i convert this to a plain xml file in text format that i can import in ireport for example?
has answer: http://stackoverflow.com/a/74715498
has comment: http://stackoverflow.com/comment/47927270
type: Question
tagged with: jasper-reports
answer count: 2
tagged with: javascript
has comment: http://stackoverflow.com/comment/47927433
tagged with: binary-data
score: 4
favorite count: 0
tagged with: postgresql
upvote count: 4
tagged with: node.js
downvote count: 0

http://stackoverflow.com/q/29864800
type: Question
score: 3
has answer: http://stackoverflow.com/a/51109277
tagged with: javascript
upvote count: 3
answer count: 2
tagged with: onchange
linked to: http://stackoverflow.com/q/29897809
has title: Using Excel VBA to select onchange value in JavaScript web
tagged with: vba
tagged with: web
has body: I am very new to VBA, I've been tried many times to use Excel VBA to select the value on a website, but it doesn't work. Below is the code I use. Actually I don't know how to get the elements since it has no "id" or "name" tag. Sub GetFinanceData() Dim URL As String URL = "http://stock.finance.sina.com.cn/hkstock/finance/00001.html" Set myIE = CreateObject("InternetExplorer.Application") With myIE .navigate URL .Visible = True Do While .Busy = True Or .readyState <> 4 Loop DoEvents .Document.parentWindow.execScript "selectData(zero);", "JavaScript" End With End Sub Below is the HTML code, I want to change the option value to "zero" when open the website, can anybody help to check and advise what VBA code I can use to get the value "zero"? Thanks a lot in advance! 重要财务指标 资产负债表 现金流量表 综合损益表 报表类型: 全部 年报 中报 一季报 三季报
favorite count: 0
has answer: http://stackoverflow.com/a/29865223
accepted answer: http://stackoverflow.com/a/29865223
possible better answer: http://stackoverflow.com/a/51109277
type: AnsweredQuestion
downvote count: 0
tagged with: excel

http://stackoverflow.com/a/29959549
has comment: http://stackoverflow.com/comment/48041439
has comment: http://stackoverflow.com/comment/48050989
has comment: http://stackoverflow.com/comment/48053511
upvote count: 5
answers question: http://stackoverflow.com/q/29958234
score: 5
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/48118081
downvote count: 0
has comment: http://stackoverflow.com/comment/48052018
accepted answer of: http://stackoverflow.com/q/29958234
has comment: http://stackoverflow.com/comment/48074740
has comment: http://stackoverflow.com/comment/48052379
has comment: http://stackoverflow.com/comment/48074802
has comment: http://stackoverflow.com/comment/48051623
has body: I measured the results from three different algorithms in three different browsers. Two things are true about all performance related questions: If you really want to know the answer, you've got to test your specific algorithm in several browsers to really answer the question. Many performance related questions are actually not material in the given context in which they are being used so worrying about them until you know you need to worry about them is nothing more than time wasted on premature optimization or even unnecessary optimization. So, before working on a specific area of performance, you should know that it matters and know that it's worth spending time on. That said, here are some measurements for three algorithms. This assumes you start with two arrays of objects, each sorted independently by one particular numeric property that is present in each object. Here's the jsperf: http://jsperf.com/concat-sort-vs-insert-sort/5 that has the code for each of the three algorithms. Algorithm 1 is concatenate and then sort the concatenated array. In JS, it's nothing more than: var result = arr1.concat(arr2); result.sort(sortByNum); Algorithm 2 is an attempt at an insertion sort. The basic idea is to loop through the second array and for each item in that array, find where to insert it into the first array. Since both arrays are sorted, we only have to start looking for a place to insert the next item into the first array at the place after where we inserted the last item. Algorithm 3 is a merge sort. The idea here is that you create an empty result array and two indexes, one for each of the two source arrays. For the value at each source index, you push into the result the lower of the two items and then increase its source index. When either source index is exhausted, you push in the rest of the other array. I was guessing that it would be more efficient than the insertion sort because it doesn't have to insert items into the middle of an array, just add onto the…
type: Answer
has comment: http://stackoverflow.com/comment/48128409

http://stackoverflow.com/comment/47847226
score: 1
comment on: http://stackoverflow.com/a/29859859
type: Comment
type: AnswerComment
has text: Thank you for the answers... I'm not saying that creating an online game is easy, I know it takes alot of planning and time..

http://stackoverflow.com/comment/48163134
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29887107
has text: @phil could please be kind and tell me how is gonna help me here ? I have wampserver installed in my laptop
score: 0

http://stackoverflow.com/comment/48004959
score: 0
has text: Remove `scrolling` and try.
comment on: http://stackoverflow.com/q/29941940
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47950464
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29914143
score: 0
has text: This is an interesting question, in fact, because the problem is related to other rules overriding this one.

http://stackoverflow.com/a/29878085
answers question: http://stackoverflow.com/q/29878084
type: Answer
has body: I can't find related documentation. Safari seem to have changed the implementation of XHR requests - although this does appear to be allowed by the http specification. Most browsers, when they send AJAX, they read the cookie value synchronously, and then send the request asynchronously. Safari however, even reads the cookie value asynchronously (ie. whenever it wants). Here is some code to demonstrate using createCookie from quirksmode.org: createCookie("TEST_COOKIE", "Before", 10); var x = new XMLHttpRequest(); x.open("GET", location.href); x.send(); createCookie("TEST_COOKIE", "After", 10); In Chrome (etc), the server will receive the "before" cookie. In Safari (tested on Windows, Mac &amp; iPad), the server will receive after!
score: 0

http://stackoverflow.com/comment/48047015
has text: I'll stick it in just in case, there might be some discrepancies especially to future readers (though the spec is on the final draft so it is unlikely)
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29963279

http://stackoverflow.com/comment/48045216
has text: Playing the devil's advocate I'd say that the real problem is not the memory leak, but the event handler that's still active. The memory leak is just a side effect. I guess it all comes down to your last statement. I wouldn't delete the question, though.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29957095
score: 0

http://stackoverflow.com/a/29977753
has body: you can redirect user using javascript. Use window.location=""; or window.location.href=""
type: Answer
answers question: http://stackoverflow.com/q/29977697
upvote count: 1
has comment: http://stackoverflow.com/comment/48075229
has comment: http://stackoverflow.com/comment/48075223
score: 1
has comment: http://stackoverflow.com/comment/48075125
has comment: http://stackoverflow.com/comment/48075107
downvote count: 0

http://stackoverflow.com/a/29946392
answers question: http://stackoverflow.com/q/29945181
has comment: http://stackoverflow.com/comment/48014023
type: AcceptedAnswer
downvote count: 0
score: 1
type: Answer
has body: The sort function was sorting alphabetically. Convert the totals to numbers first... dataset.sort(function(a,b) { return d3.descending(+a.counttotal, +b.counttotal); });
upvote count: 1
accepted answer of: http://stackoverflow.com/q/29945181

rubygems
tags question: http://stackoverflow.com/q/29916655
type: Tag
tags question: http://stackoverflow.com/q/29902249
tag name: rubygems

http://stackoverflow.com/comment/47922880
comment on: http://stackoverflow.com/q/29900011
type: Comment
type: QuestionComment
has text: What do you mean, "*can't pass args from outside the object*"? What you started with seemed fine.
score: 0

http://stackoverflow.com/a/29941291
has comment: http://stackoverflow.com/comment/48004726
type: Answer
has body: Add this to the top of your JavaScript file if (!window.console) { console = { log: function(){} }; }
has comment: http://stackoverflow.com/comment/48003862
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/48004264
accepted answer of: http://stackoverflow.com/q/29941156
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/48003618
has comment: http://stackoverflow.com/comment/48003608
answers question: http://stackoverflow.com/q/29941156

http://stackoverflow.com/q/29996655
tagged with: javascript
has body: I have worked with paypal standard, but the documentation for paypal payment pro is quite vague and I am not sure how to be address it. For you're information, this is PayPal Pro: https://www.paypal.com/ca/webapps/mpp/paypal-payments-pro Now I did search around, and came accross this tutorial: http://code.tutsplus.com/tutorials/how-to-process-credit-cards-with-paypal-payments-pro-using-php--net-25397 but its quite outdated, and I am not sure it's relevancy. The other thing is that this tutorial only deals with credit card payments, I would like to understand and have the whole workflow. I am quite lost, and would need guidance, if any examples on github are found or any support provided I would appreciated. I am quite accustom with javascript and php.
score: 3
has answer: http://stackoverflow.com/a/29997204
answer count: 1
downvote count: 0
favorite count: 0
tagged with: php
tagged with: paypal-sandbox
type: AnsweredQuestion
has title: working and integrating paypal payment pro
accepted answer: http://stackoverflow.com/a/29997204
upvote count: 3
tagged with: paypal
type: Question
tagged with: payment-gateway

http://stackoverflow.com/a/29998032
has comment: http://stackoverflow.com/comment/48115700
has comment: http://stackoverflow.com/comment/48115844
type: Answer
answers question: http://stackoverflow.com/q/29997705
has comment: http://stackoverflow.com/comment/48115725
accepted answer of: http://stackoverflow.com/q/29997705
has body: As already answered, you want a simple php proxy script. This way your server grabs the json file and you simply access your server from client side. . That way javascript is only dealing with the same domain. &lt;?php header('Content-Type: application/json'); echo file_get_contents('http://example.com/data.json'); ?&gt; Proxy.php &lt;?php header('Content-Type: application/json'); echo file_get_contents('http://example.com/'.$_REQUEST['file']); ?&gt; Another way also would be to send all of the request headers as a query string, this could be post/get as well if (isset($_REQUEST['query'])) { $sQuery = http_build_query($_REQUEST); header('Content-Type: application/json'); echo file_get_contents('https://www.example.com?'.$sQuery); exit; } ?&gt; Using the second example you can try something like http://localhost/proxy.php?file=somefile.json HTACCESS METHOD Refer the following page about using a htaccess file on the server htaccess Access-Control-Allow-Origin &lt;FilesMatch ".(json|js|jsn)"&gt; Header set Access-Control-Allow-Origin "*" &lt;/FilesMatch&gt;
score: 9
upvote count: 9
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/48115669
has comment: http://stackoverflow.com/comment/48115807

http://stackoverflow.com/q/29884182
has answer: http://stackoverflow.com/a/29884254
has title: Replacement for underscore's toArray
type: Question
has comment: http://stackoverflow.com/comment/47903819
tagged with: javascript
has body: I am working on a super simple meteor app and found some code that does almost exactly what I want, but has a dependency on underscorejs. I have never used underscorejs and prefer not to have that dependency (I have certainly heard that underscore is great, but I just don't want to deal with any unnecessary packages at this time). This is the only line that uses underscorejs: this.channels[name].args = _.toArray(arguments); Would rewriting the toArray function be trivial or is there some heavy lifting going on underneath the hood? The code came from this blog entry: http://www.manuel-schoebel.com/blog/meteorjs-package-only-app-structure-with-mediator-pattern and is located in the Mediator object example. Thanks!
upvote count: 2
possible better answer: http://stackoverflow.com/a/29884216
answer count: 3
has answer: http://stackoverflow.com/a/29884216
tagged with: meteor
favorite count: 0
accepted answer: http://stackoverflow.com/a/29884469
has comment: http://stackoverflow.com/comment/47928941
has answer: http://stackoverflow.com/a/29884469
type: AnsweredQuestion
score: 2
downvote count: 0
tagged with: underscore.js

http://stackoverflow.com/comment/48111226
score: 0
comment on: http://stackoverflow.com/q/29995298
type: Comment
type: QuestionComment
has text: I don't know much JavaScript, but shouldn't the `setTimeout` line come *inside* the function definition rather than after it?

http://stackoverflow.com/comment/89443685
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/29937844
type: Comment
has text: @TamásMárton That's not correct. "So, a valid unquoted attribute value in CSS is any string of text that is not the empty string, is not just a hyphen (-), consists of escaped characters and/or characters matching /[-_ -ჿFF]/ entirely, and doesn’t start with a digit or two hyphens or a hyphen followed by a digit." https://mathiasbynens.be/notes/unquoted-attribute-values#css

http://stackoverflow.com/a/69537100
score: 6
type: Answer
upvote count: 6
answers question: http://stackoverflow.com/q/29876185
downvote count: 0
has body: Add a value for prevArrow and nextArrow to change the standard arrows. Example: $('.members').slick({ slidesToShow: 1, slidesToScroll: 1, dots: true, arrows: true, prevArrow: '&lt;svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg"&gt;&lt;path fill-rule="evenodd" clip-rule="evenodd" d="M20 40C8.9543 40 -2.7141e-06 31.0457 -1.74846e-06 20C-7.8281e-07 8.9543 8.95431 -2.7141e-06 20 -1.74846e-06C31.0457 -7.8281e-07 40 8.9543 40 20C40 31.0457 31.0457 40 20 40ZM16.1206 13.5198C15.7554 13.1055 15.1632 13.1055 14.798 13.5198L9.58704 19.4308C9.22182 19.8451 9.22182 20.5168 9.58704 20.931L14.798 26.8421C15.1632 27.2563 15.7554 27.2563 16.1206 26.8421C16.4858 26.4278 16.4858 25.7561 16.1206 25.3418L12.4912 21.2248L29.6865 21.2248C30.2388 21.2248 30.6865 20.7771 30.6865 20.2248C30.6865 19.6725 30.2388 19.2248 29.6865 19.2248L12.4138 19.2248L16.1206 15.02C16.4858 14.6057 16.4858 13.934 16.1206 13.5198Z" fill="#7C8B9C"/&gt;&lt;/svg&gt;', nextArrow: '&lt;svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg"&gt;&lt;path fill-rule="evenodd" clip-rule="evenodd" d="M20 3.49691e-06C31.0457 5.4282e-06 40 8.95431 40 20C40 31.0457 31.0457 40 20 40C8.9543 40 1.56562e-06 31.0457 3.49691e-06 20C5.4282e-06 8.95431 8.95431 1.56562e-06 20 3.49691e-06ZM23.8794 26.4802C24.2446 26.8945 24.8368 26.8945 25.202 26.4802L30.413 20.5692C30.7782 20.1549 30.7782 19.4833 30.413 19.069L25.202 13.1579C24.8368 12.7437 24.2446 12.7437 23.8794 13.1579C23.5142 13.5722 23.5142 14.2439 23.8794 14.6582L27.5088 18.7752L10.3135 18.7752C9.7612 18.7752 9.31348 19.2229 9.31348 19.7752C9.31348 20.3275 9.76119 20.7752 10.3135 20.7752L27.5862 20.7752L23.8794 24.98C23.5142 25.3943 23.5142 26.066 23.8794 26.4802Z" fill="#7C8B9C"/&gt;&lt;/svg&gt;', });

http://stackoverflow.com/a/29928492
upvote count: 2
has comment: http://stackoverflow.com/comment/47979171
has body: var img = document.getElementsByTagName("img"); This returns a NodeList, or an array of elements. You need to access the index of this element with [0] Or better yet, use querySelector which returns the first element in a NodeList
type: Answer
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/47979383
answers question: http://stackoverflow.com/q/29928425

http://stackoverflow.com/comment/47990208
has text: It is because you render keypress and keyup both event. Just call keyup. Check http://jsfiddle.net/NjC58/13/
type: Comment
type: QuestionComment
score: 2
comment on: http://stackoverflow.com/q/29933753

http://stackoverflow.com/q/29941488
has answer: http://stackoverflow.com/a/60163831
tagged with: node.js
favorite count: 0
upvote count: 2
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/48033613
has title: Can I store a relational table in memory and query it in node.js?
downvote count: 1
has comment: http://stackoverflow.com/comment/48006437
has comment: http://stackoverflow.com/comment/48003864
score: 1
tagged with: mysql
type: Question
has comment: http://stackoverflow.com/comment/48004405
answer count: 1
tagged with: javascript
has body: when a node js program starts, i will read data from a table and store it in nodejs global memory.Once this is loaded, in the program, when traffic comes, select a row from the loaded table based on some parameters.
has comment: http://stackoverflow.com/comment/48006213

http://stackoverflow.com/a/29864419
type: Answer
has comment: http://stackoverflow.com/comment/47855517
has comment: http://stackoverflow.com/comment/47855849
has comment: http://stackoverflow.com/comment/47854808
score: 0
has body: If you go with your question, you need following Access JS variable in class file. To do that, you need to have a HiddenField and set the JS variable value to hiddenfiled. Make sure you have hidden field in &lt;form&gt;. Say it has name and id = "hdn" When postback will happend it will send that data to server. To get that value in class file you need to use Request.Form["hdn"].
has comment: http://stackoverflow.com/comment/47854632
answers question: http://stackoverflow.com/q/29863494

http://stackoverflow.com/a/29940705
upvote count: 1
type: AcceptedAnswer
downvote count: 1
answers question: http://stackoverflow.com/q/29916053
accepted answer of: http://stackoverflow.com/q/29916053
type: Answer
has body: I found the error thanks to this post : https://www.sencha.com/forum/showthread.php?246181-TypeError-el-is-null-el-el.dom-Ext.getDom(el)-in-ext-all-dev.js-(ligne-19839)
score: 0

http://stackoverflow.com/a/29847529
has body: Try Highcharts ng Here is Angular Highcharts Highchart bar-line chart example Bar-line
score: 1
accepted answer of: http://stackoverflow.com/q/29847196
type: AcceptedAnswer
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/29847196
upvote count: 1

http://stackoverflow.com/q/29970675
has answer: http://stackoverflow.com/a/29970969
accepted answer: http://stackoverflow.com/a/29970969
has title: How exactly does this JQuery script work? and how can I modify it to select a specific object?
type: Question
possible better answer: http://stackoverflow.com/a/29970788
has body: I am absolutly new in JavaScript and jQuery and I have the following problem. I have the following jQuery script: $(document).ready(function () { $("thead.opening").click(function () { $(this).next().slideToggle('slow', function () { $(this).prev("thead.opening").toggleClass("active"); $("thead.opening").find(".imgAccordion").attr("src", "img/arrow.gif"); $("thead.active").find(".imgAccordion").attr("src", "img/arrow_down.gif"); }); return false; }); }); and in my HTML I have something like this: Ricerca Flussi (la funzione e' consentita per flussi inferiori alle 300 fatture) SHOW SOMETHING ........................................................... ........................................................... ........................................................... Ricerca Fatture SHOW SOMETHING ELSE As you can see in my code there is 2 different tables both having the same classes (standard-table-cls table-header-cls). When I click on the thead of one of these table it seems to me that the previous script is perfromed (it is right or am I saying wrong assertion?). I think so because this statment: $("thead.opening").click(function () {....... means something like: perform the body of the defined function() when the user click on any thead element having class=opening. Is it my reasoning correct? No my doubt (and also the related problem) is: how jQuery know what is the specific thead.opening clicked by the user (the one related to the first table or the one related to the second table)? What exactly represent the $(this) element in the previous script? (it is the selected object or what?) And finally, how can I modify the previous script to obtain the reference of the inner tbody of the same table of the thead.opening clicked? Tnx
has answer: http://stackoverflow.com/a/29970907
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/48061245
score: 0
has answer: http://stackoverflow.com/a/29970788
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/1051782
answer count: 5
linked to: http://stackoverflow.com/q/2398947
has answer: http://stackoverflow.com/a/29971267
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29970983

http://stackoverflow.com/q/29970926
has answer: http://stackoverflow.com/a/29971167
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/3219758
accepted answer: http://stackoverflow.com/a/29971167
tagged with: dom-events
favorite count: 0
score: 6
has answer: http://stackoverflow.com/a/29974998
type: AnsweredQuestion
downvote count: 0
possible better answer: http://stackoverflow.com/a/29974998
type: Question
upvote count: 6
has body: I've got a problem with some Javascript-generated content : I use the onload() event of my html page to load HTML code from a server and inject it in the page. Since it already is html I use the innerHtml property of the nodes I want to fill with content. Once I've injected the HTML I call a handmade adjustHeights() function that normalizes the height of the elements I created this way to make them all match the height of the tallest element. All of this works perfectly unless the code inside innerHtml contains some sort of image or other media that takes time to load (particularly videos) because adjustHeights() is called between the injection of the code and the end of the loading time of the image/video/etc. Is there any way to wait for every element to be loaded before calling adjustHeights() ? I've already tried the document.onreadystatechange property but the state is already on 'completed' when I start to inject code. If it's possible I would rather not use time-based calls on adjustHeights(). To make it clearer here's an example : var mylist = document.getElementById('mycontent'); var li; for (var i = 0; i &lt; res.length; i++) { li = document.create('li'); li.innerHTML=res[i]; mylist.appendChild(li); } adjustHeights();
tagged with: javascript
answer count: 2
has title: Fire event when images in generated content are loaded

http://stackoverflow.com/q/29847657
type: Question
has title: Getting data from input to use as object in javascript
possible better answer: http://stackoverflow.com/a/29847808
has answer: http://stackoverflow.com/a/29847808
upvote count: 2
has answer: http://stackoverflow.com/a/29847825
answer count: 3
has answer: http://stackoverflow.com/a/29847690
has comment: http://stackoverflow.com/comment/47821235
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47821114
type: AnsweredQuestion
score: 2
has body: I'm not sure of how to create an event listener that takes text from an input and sends the input to a variable on javascript. Then, the variable will produce another output. For example, if you type "f" (forward) on the text box, the variable will have to make that input equal to a number. Try it var console = function() { $("#textinput").val(); if (console == "hi") { alert("#text input was also hi"); } }
downvote count: 0
accepted answer: http://stackoverflow.com/a/29847690
favorite count: 0

http://stackoverflow.com/comment/48053721
type: Comment
has text: Thanks for the extremely detailed response @Ken Fyrstenberg I think this is way over my head however, i'm guessing there isn't much of a simpler way either?
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29912287

http://stackoverflow.com/comment/48025270
type: Comment
comment on: http://stackoverflow.com/a/29951798
type: AnswerComment
score: 1
has text: @Werlang was also trying to teach a little bit about changing way of thinking which is a lot of the point of SO, not just providing code that does everything

http://stackoverflow.com/q/29858381
has answer: http://stackoverflow.com/a/29859623
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/29858403
tagged with: http://stackoverflow.com/tag/html
tagged with: css
answer count: 4
possible better answer: http://stackoverflow.com/a/29858431
has answer: http://stackoverflow.com/a/29858448
has comment: http://stackoverflow.com/comment/47842886
has comment: http://stackoverflow.com/comment/47842694
upvote count: 1
has body: With jQuery: How do I prevent the children () from inheriting the parents' ( ) attributes? I've been working on and researching this for 2+ hours; nothing has worked. Problem section: $("p").not("span").css("cursor", "pointer"); ...... Full code: Always shown | Show/Hide Always shown | Show/Hide
type: AnsweredQuestion
score: 1
type: Question
accepted answer: http://stackoverflow.com/a/29858403
has answer: http://stackoverflow.com/a/29858431
has title: jQuery: Prevent child from inheriting the parent's attributes?

http://stackoverflow.com/a/29890310
score: 1
upvote count: 1
downvote count: 0
type: Answer
has body: Do you mean local storage ? Hope will help you.
answers question: http://stackoverflow.com/q/29889998

http://stackoverflow.com/q/29939885
tagged with: jquery
has comment: http://stackoverflow.com/comment/132819544
has comment: http://stackoverflow.com/comment/48000832
score: 0
has answer: http://stackoverflow.com/a/29940077
tagged with: http://stackoverflow.com/tag/html
has title: How to fade image src attribute?
has comment: http://stackoverflow.com/comment/48000792
has body: I found that it can be done like this: $(".topImage img") .mouseover(function() { var src = $(this).attr("src").match(/[^\.]+/) + "-bw.png"; $(this).fadeOut("fast").attr("src", src).fadeIn("fast"); }) .mouseout(function() { var src = $(this).attr("src").replace("-bw.png", ".png"); $(this).fadeOut("fast").attr("src", src).fadeIn("fast"); }); }); but this makes it bad because it fades the previous src out completely. Is there a way I could transition that src change so that there is no "now it's a white background before the new src loads in" ? Edit &lt;div class="topImage"&gt; &lt;img src="&lt;?=$img[0]?&gt;"&gt; &lt;/div&gt; This is how it must remain - only one image in the topImage container so haveing two images that change opacity, is not an option.
has answer: http://stackoverflow.com/a/29940294
has comment: http://stackoverflow.com/comment/48000835
type: UnansweredQuestion
tagged with: css
type: Question
answer count: 2
tagged with: javascript

http://stackoverflow.com/a/30658032
has comment: http://stackoverflow.com/comment/94237231
score: 2
downvote count: 0
has body: In my case I have accidentally added multiple bluimp scripts. I removed the other and keep just one js file for the plugin then it fixed.
answers question: http://stackoverflow.com/q/29867101
upvote count: 2
type: Answer

http://stackoverflow.com/comment/83226200
type: AnswerComment
has text: The author does not do a good job of explaining where one can run JavaScript outside of the sandbox. It would be nice is the author explained a little about combining JavaScript with HTML using or an external script file. It's a mostly good book, but it is as if the author totally blanked that aspect of JavaScript as if it did not exist.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29955592

http://stackoverflow.com/comment/47837700
comment on: http://stackoverflow.com/q/29855880
has text: In the console, the one that shows undefined happens first, right? that should clue you in on what's going on.
type: Comment
type: QuestionComment
score: 1

forms
tags question: http://stackoverflow.com/q/29993725
tags question: http://stackoverflow.com/q/29858814
tags question: http://stackoverflow.com/q/29907619
tags question: http://stackoverflow.com/q/29881883
tags question: http://stackoverflow.com/q/29917949
tags question: http://stackoverflow.com/q/29985589
tags question: http://stackoverflow.com/q/29881396
tags question: http://stackoverflow.com/q/29956025
type: Tag
tags question: http://stackoverflow.com/q/29919145
tags question: http://stackoverflow.com/q/29876131
tags question: http://stackoverflow.com/q/29970938
tags question: http://stackoverflow.com/q/29991518
tags question: http://stackoverflow.com/q/29953781
tags question: http://stackoverflow.com/q/29974743
tags question: http://stackoverflow.com/q/29947773
tags question: http://stackoverflow.com/q/29892126
tags question: http://stackoverflow.com/q/29915863
tags question: http://stackoverflow.com/q/29953803
tags question: http://stackoverflow.com/q/29924585
tags question: http://stackoverflow.com/q/29940963
tags question: http://stackoverflow.com/q/29986538
tags question: http://stackoverflow.com/q/29872201
tags question: http://stackoverflow.com/q/29941338
tags question: http://stackoverflow.com/q/29894543
tags question: http://stackoverflow.com/q/29974088
tags question: http://stackoverflow.com/q/29855261
tags question: http://stackoverflow.com/q/29913997
tags question: http://stackoverflow.com/q/29868482
tags question: http://stackoverflow.com/q/29887089
tags question: http://stackoverflow.com/q/29885017
tags question: http://stackoverflow.com/q/29994821
tags question: http://stackoverflow.com/q/29969794
tags question: http://stackoverflow.com/q/29994397
tags question: http://stackoverflow.com/q/29898912
tags question: http://stackoverflow.com/q/29906261
tags question: http://stackoverflow.com/q/29882975
tags question: http://stackoverflow.com/q/29959376
tags question: http://stackoverflow.com/q/29992310
tags question: http://stackoverflow.com/q/29908008
tags question: http://stackoverflow.com/q/29867924
tags question: http://stackoverflow.com/q/29854846
tags question: http://stackoverflow.com/q/29869627
tags question: http://stackoverflow.com/q/29905055
tags question: http://stackoverflow.com/q/29966619
tags question: http://stackoverflow.com/q/29952978
tags question: http://stackoverflow.com/q/29868723
tags question: http://stackoverflow.com/q/29886470
tags question: http://stackoverflow.com/q/29901359
tags question: http://stackoverflow.com/q/29949178
tag name: forms
tags question: http://stackoverflow.com/q/29879310
tags question: http://stackoverflow.com/q/29987956
tags question: http://stackoverflow.com/q/29986695
tags question: http://stackoverflow.com/q/29960454
tags question: http://stackoverflow.com/q/29989893
tags question: http://stackoverflow.com/q/29871293
tags question: http://stackoverflow.com/q/29962978
tags question: http://stackoverflow.com/q/29976206
tags question: http://stackoverflow.com/q/29930741
tags question: http://stackoverflow.com/q/29859474
tags question: http://stackoverflow.com/q/29946117

http://stackoverflow.com/comment/47830530
type: Comment
comment on: http://stackoverflow.com/q/29852323
has text: have you thought of using ajax?
score: 0
type: QuestionComment

graphics
tag name: graphics
type: Tag
tags question: http://stackoverflow.com/q/29992594
tags question: http://stackoverflow.com/q/30002361
tags question: http://stackoverflow.com/q/29845531

http://stackoverflow.com/a/29897571
type: Answer
answers question: http://stackoverflow.com/q/29896906
score: 0
has body: If you need to integrate it into your build process then you could use this. https://www.npmjs.com/package/json-minify or this: https://github.com/shama/grunt-minjson

http://stackoverflow.com/q/29864623
downvote count: 0
score: 1
tagged with: dom-events
favorite count: 0
tagged with: myo
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/1601593
tagged with: http://stackoverflow.com/tag/html
answer count: 0
has comment: http://stackoverflow.com/comment/47854516
has comment: http://stackoverflow.com/comment/55622499
upvote count: 1
has comment: http://stackoverflow.com/comment/55623338
type: Question
has comment: http://stackoverflow.com/comment/47854494
tagged with: javascript
has title: Simulating keypress events to navigate a website
has body: I'm working with Myo. It's an armband which connects to the computer via Bluetooth. It can detect movement of hand and can detect several gestures, such as 'wave_left' , 'wave_right' , 'fingers_spread', 'fist' mainly. Now I've to write the Javascript so that disabled persons can navigate the website using Myo. To implement this, I want to map some key press events with Myo gestures. wave_left => Tab wave_right => Shift + Tab fingers_spread => Backspace fist => Enter Now here's the code: &lt;script src='http://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.6.0/underscore-min.js'&gt;&lt;/script&gt; &lt;script src="https://cdn.rawgit.com/stolksdorf/myo.js/master/myo.js" &gt;&lt;/script&gt; &lt;script src="https://cdn.rawgit.com/stolksdorf/myo.js/master/experimental/myo.experimental.js" &gt;&lt;/script&gt; Myo events are handled here like following: var myo = Myo.create(0); myo.on('arm_recognized', function(){ console.log('arm found!', this.id); }); myo.on('arm_lost', function(){ console.log('arm lost', this.id); }); myo.on('wave_left', function(){ console.log('wave Left!'); // Tab Key Press Event to be Triggered }); myo.on('wave_right', function(){ console.log('wave Right!'); // Shift + Tab key Press Event to be Triggered }); myo.on('fingers_spread', function(){ console.log('spread!'); // BackSpace key press to be triggered }); myo.on('fist', function(){ console.log('fist'); // Enter key press to be triggered }); myo.on('connected', function(){ }); myo.on('bluetooth_strength', function(BTS){ console.log(width); }); myo.on('double_tap', function(){ console.log('double tap') ; }); myo.on('gyroscope', function(data){ }); I've searched internet. For simulating Tab key press, people suggested to use $('some_element').next().focus() , but I want to get the native Tab key press. This post says it's not possible because of security issue. But the post is from 2009, and html5 has progressed a lot after then. Is it possible now to trigger keypress event of the special keys and g…
tagged with: keypress

http://stackoverflow.com/q/29900726
upvote count: 0
has comment: http://stackoverflow.com/comment/47924959
favorite count: 0
has comment: http://stackoverflow.com/comment/47924853
type: Question
has body: Question is I have a javascript that looks at my text field class 'setup' this field can contain any of the following letters A,B,C,D in any order or combination. I want to be able to set the value of each combination is their an easy way of doing it rather than hard coding all 340 combinations... please any help would be greatly appreciated!!!! Here is my code $(document).ready(function(){ $('.scrap').click(function() { var weld_scrap = $('.weld').val(); var dim_scrap = $('.dim').val(); var visual_scrap = $('.visual').val(); var adjust_scrap = $('.adjust').val(); var setup = $('.setup').val(); var A = '10'; var B = '10'; var C = '10'; var D = '10'; var AA = '20'; var AB = '20'; var AC = '20'; var AD = '20'; var BA = '20'; var BB = '20'; var BC = '20'; var BD = '20'; var CA = '20'; var CB = '20'; var CC = '20'; var CD = '20'; var DA = '20'; var DB = '20'; var DC = '20'; var DD = '20'; var AAA = '30'; var AAB = '30'; var AAC = '30'; var AAD = '30'; var ABA = '30'; var ABB = '30'; var ABC = '30'; var ABD = '30'; var ACA = '30'; var ACB = '30'; var ACD = '30'; var ADA = '30'; var ADB = '30'; var ADC = '30'; var ADD = '30'; var BAA = '30'; var BAB = '30'; var BAC = '30'; var BAD = '30'; var BBA = '30'; var BBB = '30'; var BBC = '30'; var BBD = '30'; var BCA = '30'; var BCB = '30'; var BCC = '30'; var BCD = '30'; var BDA = '30'; var BDB = '30'; var BDC = '30'; var BDD = '30'; var CAA = '30'; var CAB = '30'; var CAC = '30'; var CAD = '30'; var CBA = '30'; var CBB = '30'; var CBC = '30'; var CBD = '30'; var CCA = '30'; var CCB = '30'; var CCC = '30'; var CCD = '30'; var CDA = '30'; var CDB = '30'; var CDC = '30'; var CDD = '30'; var DAA = '30'; var DAB = '30'; var DAC = '30'; var DAD = '30'; var DBA = '30'; var DBB = '30'; var DBC = '30'; var DBD = '30'; var DCA = '30'; var DCB = '30'; var DCC = '30'; var DCD = '30'; var DDA = '30'; var DDB = '30'; var DDC = '30'; var DDD = '30'; if (setup == 'A') { setup = A; }else if (setup == 'B') { setup = B; }else if (setup == 'C') { …
score: -1
has title: Want to be able to get all of the possible combinations of ABCD for a javascript
has comment: http://stackoverflow.com/comment/47924528
has answer: http://stackoverflow.com/a/29900778
downvote count: 1
answer count: 1
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47924968

http://stackoverflow.com/comment/47837762
type: Comment
comment on: http://stackoverflow.com/q/29855803
has text: try this http://jsfiddle.net/gk05pkkh/7/
score: 0
type: QuestionComment

http://stackoverflow.com/comment/48082455
comment on: http://stackoverflow.com/q/29981456
score: 0
has text: You don't need to keep assigning variables. `return obj.key1.key2.key3....keyN`
type: QuestionComment
type: Comment

http://stackoverflow.com/q/29990911
tagged with: jquery
has comment: http://stackoverflow.com/comment/48102342
has body: How do I redirect all folders to my index.html and determine where users came from. Firstly I have only index.html and .htaccess files. Scenario: User click to link: mydomain.com/blabla (normally goes to 404) Web site redirect to user mydomain.com/index.html or mydomain.com/index.html?par=blabla in mydomain.com/index.html show alert "came from mydomain.com/blabla" Is this possible? Thanks. UPDATE********** I found solve like this. Firstly changed .htaccess file: https://stackoverflow.com/a/21663207/1173413 and use alert(window.location); as Polostor's said.
linked to: http://stackoverflow.com/q/979975
has comment: http://stackoverflow.com/comment/48101328
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
answer count: 1
linked to: http://stackoverflow.com/q/21662957
has answer: http://stackoverflow.com/a/29991619
favorite count: 0
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/14395090
has title: Redirect to all html page and folders to index.html
linked to: http://stackoverflow.com/q/12500216
score: 3
upvote count: 3
has comment: http://stackoverflow.com/comment/48101780
has comment: http://stackoverflow.com/comment/48101664
type: Question
has comment: http://stackoverflow.com/comment/48101989
tagged with: javascript

http://stackoverflow.com/comment/47972362
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29923776
has text: How? Can you please share code, I'm new to all this..
score: 0

http://stackoverflow.com/comment/47977928
type: QuestionComment
comment on: http://stackoverflow.com/q/29927158
has text: Thanks Hugues. I have Placed my code in plunker http://plnkr.co/edit/kXYTf1G6ZWhQJr7X0mCC?p=catalogue Reference graph:http://bl.ocks.org/mbostock/3886208
score: 0
type: Comment

http://stackoverflow.com/q/29858641
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
tagged with: twitter-bootstrap
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29858665
has answer: http://stackoverflow.com/a/29858714
type: Question
upvote count: 22
has title: How do I get selected value from a bootstrap select drop down
downvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47843244
score: 22
has answer: http://stackoverflow.com/a/39734476
has body: I'm trying to get the selected text, not value, from my bootstrap drop down, but my .text() statement is returning a string that contains all the values with a '\n' in between. Here is my rendered html 1-4 5-9 10-15 16-20 20+ Here is my javascript, but selectedText returns '5-9\n10-15\n16-20\n20+' I want it to return 5-9 or 10-15, etc.. $('#SpaceAccommodation').change(function () { var selectedText = $(this).text(); });
answer count: 3

http://stackoverflow.com/q/29974514
has answer: http://stackoverflow.com/a/29974550
favorite count: 0
has comment: http://stackoverflow.com/comment/48068938
has title: How To Call 'Name' Tag In JS With 'this'
upvote count: 1
has answer: http://stackoverflow.com/a/29975118
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29974550
possible better answer: http://stackoverflow.com/a/29975118
has body: I am very confused on how this works: $(this).val() It seems to be returning the value in a HTML tag. How could I make this return the name tag?
has answer: http://stackoverflow.com/a/29974571
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/48068993
has comment: http://stackoverflow.com/comment/48068822
tagged with: javascript
tagged with: jquery
score: 0
answer count: 3

http://stackoverflow.com/comment/48076639
type: Comment
has text: But what if its a div? forgot your password? what would the data_name be?
type: AnswerComment
comment on: http://stackoverflow.com/a/29978280
score: 0

http://stackoverflow.com/comment/47918723
comment on: http://stackoverflow.com/q/29892036
has text: which `js`?? I don't think adding `js` to html head creates any problem other than problem w.r.t performance!!
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/48084727
type: QuestionComment
type: Comment
has text: thanks for your help but i need another way not AJAX.
comment on: http://stackoverflow.com/q/29982229
score: 0

http://stackoverflow.com/comment/47962600
type: Comment
comment on: http://stackoverflow.com/a/29920670
score: 0
type: AnswerComment
has text: My big problem is I want to handle it inside of server side functions :(

http://stackoverflow.com/q/29983717
has body: I am very new to Angular Js, I am using a directive to render some HTML content on my index page App.directive('header', function() { return { restrict: 'A', replace: true, templateUrl: '/assets/shared/header.html' }; }); And I am using this on my index page like this #Other HTML It works fine and I am able to see my header on index page but after this when I modify some content on my 'header.html' then the my new changes are not appearing on index page header Can any one help me what to do? Thanks.
tagged with: javascript
score: 0
upvote count: 1
has comment: http://stackoverflow.com/comment/48086596
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
has title: How to modify template html content that is rendering through Directives
has comment: http://stackoverflow.com/comment/48086655
answer count: 0
downvote count: 1
type: Question

http://stackoverflow.com/q/29856379
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47893783
type: AnsweredQuestion
downvote count: 0
has body: My goal is to create an efficient game loop that uses requestAnimationFrame for updating the display canvas and setTimeout for updating the game logic. My question is should I put all the drawing operations inside the requestAnimationFrame loop or only the main drawing operation that updates the html canvas? What I mean by "all the drawing operations" is all of the buffering. For instance, I'd draw all my sprites to the buffer and then draw the buffer to the main canvas. On the one hand, if I put all the buffering into requestAnimationFrame I won't be wasting cpu drawing on each logic update, on the other hand, drawing is cpu heavy and could cause requestAniomationFrame to wait until all those operations are finished... The point of separating logic updates from drawing is so that requestAnimationFrame doesn't get bogged down by non-drawing processing. Does anyone have any experience with this approach to creating a game loop? And don't say "just put it all in requestAnimationFrame," because this does slow down rendering. I'm convinced that separating logic from drawing is the way to go. Here's an example of what I'm talking about: /* The drawing loop. */ function render(time_stamp_){//First parameter of RAF callback is timestamp. window.requestAnimationFrame(render); /* Draw all my sprites in the render function? */ /* Or should I move this to the logic loop? */ for (var i=sprites.length-1;i&gt;-1;i--){ sprites[i].drawTo(buffer); } /* Update the on screen canvas. */ display.drawImage(buffer.canvas,0,0,100,100,0,0,100,100); } /* The logic loop. */ function update(){ window.setTimeout(update,20); /* Update all my sprites. */ for (var i=sprites.length-1;i&gt;-1;i--){ sprites[i].update(); } } Thanks! Edit: I've decided to go with web workers to completely separate the game logic from the drawing, which from what I understand, must take place in the main script loaded by the DOM.
type: Question
tagged with: settimeout
has comment: http://stackoverflow.com/comment/47838819
possible better answer: http://stackoverflow.com/a/29863656
tagged with: requestanimationframe
tagged with: game-loop
answer count: 2
score: 5
has comment: http://stackoverflow.com/comment/47838963
tagged with: javascript
favorite count: 0
has title: How should I use requestAnimationFrame and setTimeout in parallel to make a better game loop?
upvote count: 5
has answer: http://stackoverflow.com/a/29863656
has comment: http://stackoverflow.com/comment/49317353
has answer: http://stackoverflow.com/a/30697161
accepted answer: http://stackoverflow.com/a/30697161

http://stackoverflow.com/a/29943190
score: 4
downvote count: 1
upvote count: 5
type: Answer
has body: Try this: This is just an example. You can loop it according to your requirements. var data = []; for(var i = 0;i&lt;4;i++) //your for loop starts here { var obj = {}; obj.y ='y'; obj.a='a'; obj.z='e'; data.push(obj); }
has comment: http://stackoverflow.com/comment/48009176
has comment: http://stackoverflow.com/comment/48007538
answers question: http://stackoverflow.com/q/29943061

http://stackoverflow.com/comment/48038222
has text: Might be you are not closing document ready function }).
comment on: http://stackoverflow.com/q/29958804
score: 1
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47950554
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29914362
has text: Do you know if the handler function is called? Maybe check it by putting an alert("a"); there?
type: Comment

http://stackoverflow.com/comment/47851323
score: 0
type: QuestionComment
has text: need more details... which version you are using... console errors?
type: Comment
comment on: http://stackoverflow.com/q/29859926

http://stackoverflow.com/comment/47849460
type: QuestionComment
comment on: http://stackoverflow.com/q/29861739
type: Comment
has text: We just need enough detail so we can try to reproduce the problem you're having.
score: 0

http://stackoverflow.com/comment/47903043
comment on: http://stackoverflow.com/q/29889361
score: 0
type: Comment
type: QuestionComment
has text: Possible duplicate with http://stackoverflow.com/questions/2157963/is-it-possible-to-listen-to-a-style-change-event

http://stackoverflow.com/comment/47964215
has text: Don't do password validation on the front-end, any user can edit Javascript on their end as they please and gain access to what ever it is you're working on.
score: 9
comment on: http://stackoverflow.com/q/29921455
type: QuestionComment
type: Comment

http://stackoverflow.com/q/29851298
score: 0
answer count: 2
linked to: http://stackoverflow.com/q/14070105
has comment: http://stackoverflow.com/comment/47862999
possible better answer: http://stackoverflow.com/a/29851651
tagged with: interactive
linked to: http://stackoverflow.com/q/5422265
accepted answer: http://stackoverflow.com/a/29851593
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/3779088
type: AnsweredQuestion
has body: I want to create a web page with selections then when a user inputs their selections I would like an output of a code (or even better a unique url) which can be copy-pasted to forums, e-mailed etc... Allowing their friends to click the link and retrieve the input selections associated with that link. A code would be fine where a link + a code that is copy/pasted into a text box then generated the shared entries. So for instance I have several drop down boxes: A drop down with 50 states, a drop down with gender, a drop down with ages 1-100, a drop down with number of kids. An end-user comes and selects whatever choices they want and the page produces the link or code allowing future end-users to either click the link (preferable) or paste the code into a text box which then selects all the appropriate selections wishing to be shared. This allows the second user to view exactly what the first user wanted to share with a simple short link/code. I am stuck and I know I don't have to create a unique webpage for each possibility but I'm not sure how to approach. How do I save the first users selections, then generate a unique code/link, and finally display the first users selections for a subsequent user?
type: Question
linked to: http://stackoverflow.com/q/17087636
has title: How do I save the first users selections, then generate a unique code/link, and finally display the first users selections for a subsequent user?
has answer: http://stackoverflow.com/a/29851593
tagged with: javascript
has comment: http://stackoverflow.com/comment/48816643
has answer: http://stackoverflow.com/a/29851651

http://stackoverflow.com/comment/47909380
has text: Add contents of your JSONdata.
score: 0
type: Comment
comment on: http://stackoverflow.com/q/29893098
type: QuestionComment

http://stackoverflow.com/comment/47882909
type: Comment
score: 0
has text: @LShetty, this was written a good while ago, maybe there is a jQuery method? - this also doesn't seem to work with `textrea`
type: QuestionComment
comment on: http://stackoverflow.com/q/29879268

http://stackoverflow.com/q/29895948
answer count: 2
tagged with: javascript
score: 0
has body: IE appears not to always respond to a keyup event in one of my scripts. I looked for an alternative way to detect if a key had been released. Given that a held down key repeats the keydown event at intervals (except modifier keys on Mac), I thought it would be possible to increment a variable and listen for the point at which it stopped incrementing. When it stops incrementing, the key has been released? Unfortunately, on occasions (not always), my script is detecting an end to the incrementing whilst the key is still held down. It tends to fail more if the key is held down for repeated short intervals. I have tested with IE and FF. I have allowed for 2 seconds between checking each increment. Setting my Windows Control Panel to the slowest keyboard settings, 1 second would probably be sufficient. Detect keyup not using keyup event using Javascript Hold down the alt key to start the counter, relese to reset. keyDownCount is: Matching next and last detected on key count of:
has title: Detect key released without using keyup event - Javascript
has comment: http://stackoverflow.com/comment/47914632
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/2353417
tagged with: keyup
has answer: http://stackoverflow.com/a/29902091
type: Question
has answer: http://stackoverflow.com/a/29896088

http://stackoverflow.com/comment/86828134
type: AnswerComment
score: 0
type: Comment
has text: @vlad-ardelean Actually the relation is artificial, ie. established dynamically by calling `classTwo`. Lacking a genuine class concept, JS has no _structural_ inheritance anyway. Offhand I cannot conceive a JS scenario where mixins behave differently from what you'd expect conceptualizing them as MI from the true OO world (apart from the defined 'super'-chain); maybe some person more knowledgeable than me can supply one.
comment on: http://stackoverflow.com/a/39765294

http://stackoverflow.com/comment/48029214
type: AnswerComment
comment on: http://stackoverflow.com/a/29953476
score: 0
type: Comment
has text: I like the CSS selector approach here, but keep in mind that the code above requires jQuery.

http://stackoverflow.com/a/29960940
has comment: http://stackoverflow.com/comment/48050171
has comment: http://stackoverflow.com/comment/48046629
has body: What you need is a empty container is each of the content element. You can use a script to add it //add an empty container to all content elements $('.container .content').append('&lt;div class="empty" style="display:none;"&gt;&lt;/div&gt;'); $("input.css-checkbox:checkbox").click(function () { var cval = $(this).val(); var $div = $(".div_box_" + this.value).slideToggle("fast"); $div.next()[this.checked ? 'slideUp' : 'slideDown']("fast"); }) Demo: Fiddle
answers question: http://stackoverflow.com/q/29960543
upvote count: 2
type: Answer
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/48046847

http://stackoverflow.com/q/29998162
favorite count: 0
has body: This answer by sg3s on how to use jQuery (from someone's question) to slide divs horizontally is exactly what I want to do. However, I can't for the life of me figure out the jQuery code. jQuery(function($) { $('a.panel').click(function() { var $target = $($(this).attr('href')), $other = $target.siblings('.active'); if (!$target.hasClass('active')) { $other.each(function(index, self) { var $this = $(this); $this.removeClass('active').animate({ left: $this.width() }, 500); }); $target.addClass('active').show().css({ left: -($target.width()) }).animate({ left: 0 }, 500); } }); }); I get stuck on the if statement and the reason for the active class and .animate on both statements within it. Can someone please run me through this bit of jQuery? Instead of just using the solution, I'd love to understand it. Thanks!
downvote count: 2
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/9864305
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/29998205
tagged with: javascript
tagged with: jquery
score: -1
has title: Please Explain This jQuery Function
accepted answer: http://stackoverflow.com/a/29998205
answer count: 1

http://stackoverflow.com/q/29981605
tagged with: arrays
tagged with: javascript
has answer: http://stackoverflow.com/a/29981650
score: 0
has body: I need to put an array, inside every object, then iterate through this recently added array to put an attribute of the object inside every instance on the array inside the object. like this: var answer = [];//with three objects in here var alternatives = [{id_alternative : 40},{id_alternative : 47},{id_alternative : 56}] $.each(alternatives, function(index, item){ item.answers = answer; $.each(item.answers, function(i, ans){ ans.alternative = item.id_alternative; } } But in the results I always get alternatives[ any index ].answers[ any index ].alternative to be always 56. I don`t know what exactly is happening. Would like some help, thanks! EDIT With "three objects inside" I mean an array of objects that have other types of data inside, each object inside the array "answer" will contain question_name a string and real_answer an integer. What I need to have in the end is something like: alternatives = [ {id_alternatives:40, answers:[{ alternative:40, question_name: "string", real_answer:489}, { alternative:40, question_name: "string", real_answer:548}, { alternative:40, question_name: "string", real_answer:40} ]},//with several other objects with this structure, but other data
has comment: http://stackoverflow.com/comment/48082731
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29981673
tagged with: each
has title: $.each inside $.each returning last value
type: Question
tagged with: object
answer count: 2

http://stackoverflow.com/comment/47940578
type: AnswerComment
has text: Putting things on the $rootScope is the same as putting things in a global scope. Fine if you have a handful of things, but be careful not to pollute it.
type: Comment
comment on: http://stackoverflow.com/a/29909045
score: 2

http://stackoverflow.com/comment/113694967
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/51002743
has text: This assumes the separator is fixed length. Using something like `theString.split(/\s+/, limit);` will cause this to break.

http://stackoverflow.com/a/29977865
upvote count: 1
has comment: http://stackoverflow.com/comment/48081846
has comment: http://stackoverflow.com/comment/48075405
has comment: http://stackoverflow.com/comment/48076301
downvote count: 1
answers question: http://stackoverflow.com/q/29977668
score: 0
has comment: http://stackoverflow.com/comment/48080671
has body: First, I would try to use the attribute routing feature of web.api like this: [RoutePrefix("api/titleestimate")] public class TitleEstimateController : ApiController { [HttpGet] public IHttpActionResult GetTitleEstimate([FromUri] EstimateQuery query) { // All the values in "query" are null or zero // Do some stuff with query if there were anything to do } } It would also be helpful to see the request in your dev tools. I disagree with Colin that you should make this a POST, because HTTP POST is supposed to be used to create new items. You are trying to get information so HTTP GET makes sense. I think Web.Api assumes methods are GETs by default, but declarating it with the HttpGet attribute will for sure take care of that.
type: Answer

cordova
tags question: http://stackoverflow.com/q/29991665
tags question: http://stackoverflow.com/q/29861875
tags question: http://stackoverflow.com/q/29890242
tags question: http://stackoverflow.com/q/29915128
tags question: http://stackoverflow.com/q/29907101
tags question: http://stackoverflow.com/q/29994453
tags question: http://stackoverflow.com/q/29966519
tags question: http://stackoverflow.com/q/29882683
tags question: http://stackoverflow.com/q/29856618
tags question: http://stackoverflow.com/q/29965115
tags question: http://stackoverflow.com/q/29940742
tags question: http://stackoverflow.com/q/29868997
tags question: http://stackoverflow.com/q/29930066
tags question: http://stackoverflow.com/q/29929664
tags question: http://stackoverflow.com/q/29991696
tags question: http://stackoverflow.com/q/29918509
tags question: http://stackoverflow.com/q/29912773
tags question: http://stackoverflow.com/q/29984219
tags question: http://stackoverflow.com/q/29935506
tags question: http://stackoverflow.com/q/29888185
tags question: http://stackoverflow.com/q/29870519
tags question: http://stackoverflow.com/q/29904260
tags question: http://stackoverflow.com/q/29897838
tag name: cordova
tags question: http://stackoverflow.com/q/29901083
tags question: http://stackoverflow.com/q/29892119
tags question: http://stackoverflow.com/q/29968081
tags question: http://stackoverflow.com/q/29936669
tags question: http://stackoverflow.com/q/29934054
tags question: http://stackoverflow.com/q/29904366
tags question: http://stackoverflow.com/q/29934317
tags question: http://stackoverflow.com/q/29935705
tags question: http://stackoverflow.com/q/29960066
tags question: http://stackoverflow.com/q/29940364
tags question: http://stackoverflow.com/q/29910478
tags question: http://stackoverflow.com/q/29865608
tags question: http://stackoverflow.com/q/29889087
tags question: http://stackoverflow.com/q/29982629
tags question: http://stackoverflow.com/q/29996851
tags question: http://stackoverflow.com/q/29924588
tags question: http://stackoverflow.com/q/29973181
tags question: http://stackoverflow.com/q/29966517
tags question: http://stackoverflow.com/q/29850805
tags question: http://stackoverflow.com/q/30000151
tags question: http://stackoverflow.com/q/29905394
tags question: http://stackoverflow.com/q/29928578
tags question: http://stackoverflow.com/q/29884635
tags question: http://stackoverflow.com/q/29918859
tags question: http://stackoverflow.com/q/29967999
tags question: http://stackoverflow.com/q/29856670
tags question: http://stackoverflow.com/q/29900887
tags question: http://stackoverflow.com/q/29897125
tags question: http://stackoverflow.com/q/29959598
tags question: http://stackoverflow.com/q/29922850
tags question: http://stackoverflow.com/q/29886352
tags question: http://stackoverflow.com/q/29983389
tags question: http://stackoverflow.com/q/29855014
tags question: http://stackoverflow.com/q/29965452
tags question: http://stackoverflow.com/q/29969349
type: Tag
tags question: http://stackoverflow.com/q/29985842
tags question: http://stackoverflow.com/q/29873355
tags question: http://stackoverflow.com/q/29980528

http://stackoverflow.com/comment/48070195
comment on: http://stackoverflow.com/q/29958804
score: 0
type: Comment
has text: @JonMarkPerry No reason. Was just trying to get the code to work. :)
type: QuestionComment

http://stackoverflow.com/q/29996432
has title: Parse.Query.each() not including all records
score: 3
has answer: http://stackoverflow.com/a/29998623
type: Question
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
has body: I've seeing a bug in the latest Parse javascript SDK (v 1.4.2) that Parse.Query.each() doesn't seem to go though all the matching records. It seems have stopped after certain point. I have a UserLocation class that stores user location GeoPoints (in column "geo"). I'm trying to find the list of user locations whose distance to a venue location is less than 10 miles. As I understand that Parse.Query.find() has a limit of 1000. According to this post, Parse.Query.each() doesn't have such limit: https://parse.com/questions/pfquery-setskip-does-not-skip-beyond-10000 But that doesn't seem to be the case judging from my test results: mylocation.get("deviceId") "fa72f38bc0af44f090824a38fd1963b4" venueGeo.milesTo(mylocation.get("geo")); 2.1965871191375173 As you see, my location is about 2 miles from the venue location. But if I run the distance query of 10 miles, the result doesn’t have my location: var locationQuery = new Parse.Query("UserLocation").withinMiles("geo", venueGeo, 10); results = [] ; locationQuery.each(function(location) {results.push(location.get("deviceId"))}) b.Promise {_resolved: false, _rejected: false, _resolvedCallbacks: Array[0], _rejectedCallbacks: Array[0], resolve: function…} results.length 107 results.indexOf("fa72f38bc0af44f090824a38fd1963b4") -1 But if I add extra constraint to the query to return records whose deviceId is equal to my location’s device it. Parse.Query.each() actually includes it. I’d image the new query would return only subsets of the previous query. But it’s actually returning a record that’s not in the previous query: var locationQuery = new Parse.Query("UserLocation").withinMiles("geo", venueGeo, 10).equalTo("deviceId", "fa72f38bc0af44f090824a38fd1963b4"); results = [] ; locationQuery.each(function(location) {results.push(location.get("deviceId"))}) b.Promise {_resolved: false, _rejected: false, _resolvedCallbacks: Array[0], _rejectedCallbacks: Array[0], resolve: function…} results.length 1 results.indexOf("fa72f38bc0af44f0…
tagged with: parse-platform
type: UnansweredQuestion
upvote count: 3

http://stackoverflow.com/comment/48059531
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29968966
type: Comment
has text: @Klelund, you can pass a custom variable in product scope in your transaction tracking code, but do you really want to put your margins where people can see it (i.e. the source code of your page) ? I would have assumed that this is confidential information.

http://stackoverflow.com/q/29988523
tagged with: javascript
has comment: http://stackoverflow.com/comment/48096456
has comment: http://stackoverflow.com/comment/48097449
upvote count: 1
answer count: 1
has title: need javascript or jquery for three word with tow speperated comma
tagged with: jquery
favorite count: 0
tagged with: regex
has answer: http://stackoverflow.com/a/29988571
accepted answer: http://stackoverflow.com/a/29988571
type: AnsweredQuestion
downvote count: 3
type: Question
score: -2
has body: My project requirement for regex search string are as following 1) there are three words allow with two comma (e.g - DivisioName,StoreName,CameraName) 2) allow (,,*) means all Division, all store and all camera 3) Word conatains only (-) character but always starts with alfabetic character 4) if i put * then no other word or character allowed- whole word becomes (*) and initialy comma should apply. Allowed Text Cases are as following... text1,text2 text-1,text-2,text-3 text-1 text1, text1,text2 text1,text2, text1,, , ,, ,text, *,*,* *,* * *,*, Not Allowed Text Cases are as following... -text1,text2,text3, text-1,text2,text3,text4 ,,, a,a,, -text1,text2 -text-1,text-2,text-3 - -,- Please help me for this solution. Thanks in advance

http://stackoverflow.com/comment/48028613
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29953865
has text: You can simply escape the apostrophe with a backslash if you like.
type: AnswerComment

http://stackoverflow.com/comment/47852673
type: AnswerComment
has text: @user3201500, what is the problem with `ons-navigator`? But you should probably ask a separate question
type: Comment
comment on: http://stackoverflow.com/a/29863721
score: 0

http://stackoverflow.com/a/29935725
answers question: http://stackoverflow.com/q/29935649
has body: In order to use $http you first need to inject it into your controller var module = angular.module('putNameHere', []) module.controller('myCtrl', ['$http', function($http){ //injection here $http({ url: url, method: "GET", data: data }).success(function(data, status, headers, config) { resData = data; }).error(function(data, status, headers, config) { resData = data; }); }])
has comment: http://stackoverflow.com/comment/47993388
upvote count: 3
has comment: http://stackoverflow.com/comment/130985596
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47993368
type: Answer
has comment: http://stackoverflow.com/comment/47994922
downvote count: 0
has comment: http://stackoverflow.com/comment/47994647
has comment: http://stackoverflow.com/comment/47993394
accepted answer of: http://stackoverflow.com/q/29935649
score: 3

http://stackoverflow.com/a/29968627
score: -1
has comment: http://stackoverflow.com/comment/48088692
downvote count: 2
upvote count: 1
has comment: http://stackoverflow.com/comment/48056917
has comment: http://stackoverflow.com/comment/48057026
answers question: http://stackoverflow.com/q/29968566
has body: If you know wich exactly mail vendor you want to check, then try this one: if (mailingVal.length &amp;&amp; mailingVal.indexOf('@gmail.com') &gt; -1 ) console.log('that is gmail!'); You also may need to put your string to lover case to be sure that 'Gmail' is also valid mailingVal = mailingVal.toLowerCase() UPD: as metioned in comments, this case will make mails like 'wut@gmail.commadot' also valid. To prevent that you can try this check: mailingVal = mailingVal.split['@']; if (mailingVal.length &gt; 2) { console.log('not Valid email'); } else { if (mailingVal[1].toLowerCase() === 'gmail.com') console.log('Bingo!'); }
type: Answer

http://stackoverflow.com/q/29906113
downvote count: 1
has title: node.js / jQuery cross domain: ERR_CONNECTION_REFUSED
type: Question
tagged with: javascript
tagged with: express
has comment: http://stackoverflow.com/comment/47935553
upvote count: 4
has comment: http://stackoverflow.com/comment/47935594
answer count: 2
has comment: http://stackoverflow.com/comment/47935281
has body: I'm new to Node.js. I'm creating a simple node/express application that serves a single web page containing one button that when clicked makes a jQuery ajax request to an Express route. The route callback makes an http.get request to openexchangerates.org for some json data containing foreign exchange rates. The JSON is then output to the Developer Tools console window. The application works on the first button click, but on any subsequent clicks the console window displays: GET http://127.0.0.1:3000/getFx net::ERR_CONNECTION_REFUSED A screen grab of the Developer Tools console window shows the result of the first click, and then the second click when the connection is refused. The error detail is as follows: GET http://127.0.0.1:3000/getFx net::ERR_CONNECTION_REFUSED jquery-2.1.3.min.js:4 n.ajaxTransport.k.cors.a.crossDomain.send jquery-2.1.3.min.js:4 n.extend.ajax (index):18 (anonymous function) jquery-2.1.3.min.js:3 n.event.dispatch jquery-2.1.3.min.js:3 n.event.add.r.handle My simple Node/Express application is as follows: var express = require('express'); var app = express(); var http = require("http"); var data = ""; var json; console.log( "__dirname", __dirname ); app.use( express.static( __dirname + '/') ); var options = { host:"openexchangerates.org", path:"/api/latest.json?app_id=<get free ID from openexchangerates.org>" }; app.get("/", function( req, res ) { res.sendFile('index.html', { root: __dirname }); }) app.get("/getfx", function(req, res) { console.log("Route: getFx"); getFx(res); }) function getFx(res) { console.log("http getFx"); http.get(options, function (response) { response.on("data", function (chunk) { //console.log("data:\n"+chunk); data += chunk; }); response.on("end", function () { json = JSON.parse(data); console.log("http response end:"); res.end( data ); }); response.on("error", function (e) { console.log("error:\n" + e.message); }); }) } app.listen(3000); My html index page is: Get FX Get foreign exchange rates For openexchangerates.o…
possible better answer: http://stackoverflow.com/a/29906623
favorite count: 0
has answer: http://stackoverflow.com/a/29906623
has comment: http://stackoverflow.com/comment/47935731
has answer: http://stackoverflow.com/a/29906674
tagged with: node.js
type: AnsweredQuestion
score: 3
accepted answer: http://stackoverflow.com/a/29906674
has comment: http://stackoverflow.com/comment/47935645
has comment: http://stackoverflow.com/comment/47935652

http://stackoverflow.com/q/29935506
tagged with: phonegap-plugins
tagged with: jquery
type: Question
has answer: http://stackoverflow.com/a/29935633
type: AnsweredQuestion
has title: cordova SMS plugin -- javascript error
tagged with: cordova
answer count: 1
accepted answer: http://stackoverflow.com/a/29935633
score: 0
has body: I am using cordova 3.6.3. I am using following SMS plugin. http://plugins.cordova.io/#/package/com.rjfun.cordova.sms https://github.com/floatinghotpot/cordova-plugin-sms/tree/master/docs I have added plugin in following way :-- cordova plugin add com.rjfun.cordova.sms My cordova app when loaded calls the following function doc_onload(). &lt;body onload="doc_onload()"&gt; Then this register the handler for "deviceready". When the device is ready this device ready function is called. Now the problem inside the initApp() handler is that SMS plugin check does not display any alert message. I am able to get the alert --> "kk" . But in the following check if (! SMS ) I did not get any display message. Neither if nor else got satisfied. Even alert("end"); Does not get displayed inside initApp() event handler. Please suggest why it is failing ? function initApp() { alert("initApp"); // attach Fastclick handler FastClick.attach(document.body); alert("kk"); if (! SMS ) { alert( 'SMS plugin not ready' ); return; } else { alert( 'SMS plugin Ok ' ); } alert("end"); //add SMS arrive listner handler document.addEventListener("onSMSArrive", processSMS(), false); } //function doc_onload(page_type) function doc_onload() { // Do some task alert("doc_onload"); // add event handler for deviceready function document.addEventListener("deviceready", initApp(), false); }
tagged with: javascript

http://stackoverflow.com/q/29870934
has body: I am trying to achieve that after user logs in to my app, I will have to send get request to my servlet, which will respond with servletOutputStream with some sound message like ('Hello User, how are you'). But I want it to be only once, not after the logged user refreshes the page and hears it again.
linked to: http://stackoverflow.com/q/16742973
accepted answer: http://stackoverflow.com/a/29871059
type: Question
has comment: http://stackoverflow.com/comment/47866832
tagged with: javascript
possible better answer: http://stackoverflow.com/a/29870993
has answer: http://stackoverflow.com/a/29870993
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/29871059
has title: How to run javascript only once after every login?
type: AnsweredQuestion

http://stackoverflow.com/comment/48005299
comment on: http://stackoverflow.com/q/29942231
score: 1
has text: You can try http://openexchangerates.github.io/accounting.js/
type: Comment
type: QuestionComment

global
type: Tag
tags question: http://stackoverflow.com/q/29846401
tags question: http://stackoverflow.com/q/29875113
tag name: global
tags question: http://stackoverflow.com/q/29933544

http://stackoverflow.com/comment/77262769
has text: I think a more practical approach is to go through the geometry UV coordinates and flip them.
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/29974791
score: 0

http://stackoverflow.com/a/29932974
score: 1
answers question: http://stackoverflow.com/q/29932937
upvote count: 1
downvote count: 0
has body: I would like something like this using split. var url = 'spotify:album:1jcYwZsN7JEve9xsq9BuUX'.split(':'); var part = url[url.length-1]; // alert(part); return "https://open.spotify.com/album/" + part;
type: Answer

http://stackoverflow.com/q/29914371
type: Question
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/47950877
favorite count: 0
answer count: 3
has answer: http://stackoverflow.com/a/29917576
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47952530
tagged with: css
has answer: http://stackoverflow.com/a/30865793
has comment: http://stackoverflow.com/comment/47951155
type: UnansweredQuestion
score: 1
has title: Centering responsive video background on website in css3
upvote count: 1
has body: I'm trying to center video background on website. On 1920x1080 size everything is ok, but on smaller devices, video isn't centered. How can i fix this ? My index.html: video web <!--[if IE]> <![endif]--> <!--[if lt IE 9]> <![endif]--> My CSS: video#bgvid { position: absolute; right: 0; bottom: 0; left:0; top: 0; z-index: -100; background: url(../images/intro.jpg) center no-repeat; width: 100%; height: 100%; margin: auto; } video { display: block; display: block; margin: 0 auto;} video#bgvid { transition: 1s opacity; } .stopfade { opacity: .5; } /* mobile */ @media screen and (max-device-width: 800px) { body { background: url(../images/intro.jpg) #000 no-repeat center center fixed; } #bgvid { display: none; } } How I can fix this to get responsive video background ? Is it possible to get this result in pure css3 without writing javascript ? Thanks for help.
has answer: http://stackoverflow.com/a/29917651
has comment: http://stackoverflow.com/comment/47951030

http://stackoverflow.com/q/29988569
downvote count: 0
tagged with: javascript
tagged with: passport.js
tagged with: express
accepted answer: http://stackoverflow.com/a/29989918
tagged with: passport-local
tagged with: node.js
favorite count: 0
has body: I'm trying to call the passport.authenticate function as response to post request for my registration view. I've been following this tutorial here to get my head around passport.js and express but having completed the first page of instructions and making the necessary changes for express.js 4.0 every page I try to access returns error 500 and displays the following stacktrace: TypeError: Object #&lt;serverResponse&gt; has no method 'authenticate' at module.exports (/home/myUserName/Desktop/manufacturing/routes/index.js:66:37) at Layer.handle [as handle_request] (/home/myUserName/Desktop/manufacturing/node_modules/express/lib/router/layer.js:82:5) at trim_prefix (/home/myUserName/Desktop/manufacturing/node_modules/express/lib/router/index.js:302:13) at /home/myUserName/Desktop/manufacturing/node_modules/express/lib/router/index.js:270:7 at Function.proto.process_params (/home/myUserName/Desktop/manufacturing/node_modules/express/lib/router/index.js:321:12) at next (/home/myUserName/Desktop/manufacturing/node_modules/express/lib/router/index.js:261:10) at /home/myUserName/Desktop/manufacturing/node_modules/connect-flash/lib/flash.js:21:5 at Layer.handle [as handle_request] (/home/myUserName/Desktop/manufacturing/node_modules/express/lib/router/layer.js:82:5) at trim_prefix (/home/myUserName/Desktop/manufacturing/node_modules/express/lib/router/index.js:302:13) at /home/myUserName/Desktop/manufacturing/node_modules/express/lib/router/index.js:270:7 Here is the code for /routes/index.js: var express = require('express'); var bodyParser = require('body-parser'); var router = express.Router(); module.exports = function(app, passport) { /* GET home page. */ router.get('/', function(req, res, next) { res.render('index', { title: 'Home Page' }); }); /* GET about page */ router.get('/about', function(req, res, next) { res.render('about', { title: 'About Us' }); }); /* GET contact page */ router.get('/contact', function(req, res, next) { res.render('contact', { title: 'Contac…
upvote count: 1
possible better answer: http://stackoverflow.com/a/29989879
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29989879
score: 1
has answer: http://stackoverflow.com/a/29989918
type: Question
has title: How do I correctly call passport.js functions with express router?
answer count: 2

http://stackoverflow.com/comment/47999431
score: 0
comment on: http://stackoverflow.com/a/29937057
type: Comment
has text: @user2568960:- You can make changes in the CSS and HTML only like this: http://jsfiddle.net/kaf4j/9/
type: AnswerComment

http://stackoverflow.com/a/29911763
upvote count: 15
has comment: http://stackoverflow.com/comment/116333301
type: AcceptedAnswer
downvote count: 0
score: 15
has comment: http://stackoverflow.com/comment/52334949
has comment: http://stackoverflow.com/comment/52362590
type: Answer
has body: So I got it to work as follows: I created a private CallbackContext object in my plugin: private CallbackContext callbackContext; and stored the CallbackContext supplied in the execute() method in it: public boolean execute(final String action, JSONArray args, CallbackContext callbackContext) throws JSONException { this.callbackContext = callbackContext; } Elsewhere in my Java code, I can access this callback and send plugin results to it. This callback will become invalid, however, after it's first triggered, unless keepCallback is set to true: PluginResult pluginResult = new PluginResult(PluginResult.Status.OK, "WHAT"); pluginResult.setKeepCallback(true); callbackContext.sendPluginResult(pluginResult); This made me a happy camper. I hope it helps someone else!
accepted answer of: http://stackoverflow.com/q/29910478
answers question: http://stackoverflow.com/q/29910478

http://stackoverflow.com/comment/47833854
type: Comment
type: AnswerComment
has text: Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/76198/discussion-between-diogo-cunha-and-edson-rodrigues).
score: 0
comment on: http://stackoverflow.com/a/29850646

http://stackoverflow.com/comment/48020855
type: Comment
has text: Well, that looks like it is returning the correct selector. Can you verify that the element doesn't have the class added? (in Chrome, F12, click the magnifying glass and then the link on screen that should have the `active` class)
comment on: http://stackoverflow.com/a/29949101
type: AnswerComment
score: 0

http://stackoverflow.com/a/29969410
type: Answer
has body: Of course the submissionn runs into an endless loop - because you trigger the submit() inside the function that's bound to submit()... ;-) You'll have to save the information "validation has already been made" somehow, for example via a data-attribute or data(), and then react to that. e.g.: //Find Sign form var sign_form = $("#sign_form"); //User submits Sign form sign_form.submit(function(e) { var $this = $(this); if($this.data("validated") === true) return true; e.preventDefault(); var form = $(this).serializeArray(); var formObj = {}; $.each(form, function(i, v) { formObj[v.name] = v.value; }); //Post Form data to Sign $.post("./ajax/sign.php", formObj, function(data, status) { var fdb = data.messages; if(data.status == "success") { console.log("validate is TRUE"); $this.data("validated", true); $this.submit(); return true; } else { if(fdb.emailaddress != null) { $("#fdb_emailaddress").html(fdb["emailaddress"]); } console.log("validate is FALSE"); return false; } }); console.log("validate ended: we should not see this"); });
answers question: http://stackoverflow.com/q/29969043
score: 0

http://stackoverflow.com/q/29981401
tagged with: mysql
type: Question
has comment: http://stackoverflow.com/comment/48084200
has title: Im trying to populate a dropdowm menu with a database column in php
has answer: http://stackoverflow.com/a/29981502
tagged with: arrays
answer count: 1
tagged with: javascript
has body: I am trying to make a dropdown menu from a database. I am returning nothing right now. For the menu, I need to choose a object then run a SQL query on it. This query will populate a table and will be dynamic. Here is the code, please help. <?php include('header.php'); ?> Chemicals Search <br/ > <br/ > Chemical Search Search By Product: <?php //making the chemical array $con = mysqli_connect("..."); if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } $p = mysqli_query($con, "SELECT product_name FROM product"); $products = mysqli_fetch_array($p); echo ' '; foreach ($product as $key => $value) { echo " $value \n"; } echo ' '; echo " "; ?>
score: 0
type: UnansweredQuestion
tagged with: php

http://stackoverflow.com/q/29985907
has answer: http://stackoverflow.com/a/29987386
type: AnsweredQuestion
has body: I have a Highchart in which we can click on the points and then some information is shown using the Highslide html expand method. Here I give user an option to post some data. point: { events: { click: function (e) { hs.htmlExpand(null, { pageOrigin: { x: e.pageX || e.clientX, y: e.pageY || e.clientY }, headingText: this.series.name, maincontentText: Highcharts.dateFormat('%A, %b %e, %Y', this.x) + ':&lt;br/&gt; ' + this.y + ' visits ' + '&lt;div&gt;'+'&lt;button onclick="posting('+this.y+')"&gt;'+'send report' +'&lt;/button&gt;'+'&lt;/div&gt;', width: 200 }); } } } I want only admin user can see the button to send report and rest of the users should not see that option. for an example if(this.y != null){ maincontentText: Highcharts.dateFormat('%A, %b %e, %Y', this.x) + ':&lt;br/&gt; ' + this.y + ' visits ' + '&lt;div&gt;'+'&lt;button onclick="posting('+this.y+')"&gt;'+'send report' +'&lt;/button&gt;'+'&lt;/div&gt;' } else{ SOMETHING ELSE..... } Here is the the working fiddle link. I don't have any data setup for admin see if you can check if y axis value is not null then show send report button else don't show it or come up with some condition.
type: Question
has comment: http://stackoverflow.com/comment/48093520
has comment: http://stackoverflow.com/comment/48093662
accepted answer: http://stackoverflow.com/a/29987386
has title: Highslide HTML expand method with conditional statement
tagged with: highcharts
answer count: 1
tagged with: javascript
tagged with: highslide
score: 0

http://stackoverflow.com/comment/47994718
type: Comment
comment on: http://stackoverflow.com/a/29935526
score: 0
type: AnswerComment
has text: when I put 'document.getElementById('errorPage').innerHTML +='image load error';' replacing the alert, it dosen't write to the that has the id.

http://stackoverflow.com/q/29957856
upvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/48036612
tagged with: jquery
has comment: http://stackoverflow.com/comment/48036905
favorite count: 0
has title: Trigger events with JS generated input elements
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/48036835
has comment: http://stackoverflow.com/comment/48036748
has answer: http://stackoverflow.com/a/29958171
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/48036588
downvote count: 1
has comment: http://stackoverflow.com/comment/48036402
type: Question
has comment: http://stackoverflow.com/comment/48036387
has body: When using onclick or onkeypress, how can I pass a variable as parameter from a button such as below? I am trying to prepend rows into an HTML table with jquery. The prepended row should be able to delete/edit said row but the id of the element cannot trigger the event. What is the best way to do this? var myBtn = ' save '; Call a function onclick of btn_save or onkeypress of a textbox and maybe pass anotherVal as parameter.
has comment: http://stackoverflow.com/comment/48036524
has comment: http://stackoverflow.com/comment/48037164
tagged with: javascript
score: -1
accepted answer: http://stackoverflow.com/a/29958171
has comment: http://stackoverflow.com/comment/48036555

http://stackoverflow.com/comment/48058884
has text: Thanks for your answer, it's pretty clear to me now :)
comment on: http://stackoverflow.com/a/29969248
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/39003781
has comment: http://stackoverflow.com/comment/113911317
has comment: http://stackoverflow.com/comment/72975234
upvote count: 4
has body: Check out React-Motion https://www.youtube.com/watch?v=1tavDv5hXpo Cheng Lou is a developer on the React team. He talks about the issues with the current ReactCSSTransitionGroup. He has developed React-Motion for fixing this issue. Although it doesn't use css transitions , it seems to perform well and is very deterministic. Where as ReactCSSTransitionGroup seems to be finicky as you cannot interrupt transitions.
type: Answer
answers question: http://stackoverflow.com/q/29977799
has comment: http://stackoverflow.com/comment/76004239
downvote count: 1
score: 3

http://stackoverflow.com/comment/48089939
comment on: http://stackoverflow.com/q/29985235
type: Comment
type: QuestionComment
has text: `true || false && false`
score: 4

http://stackoverflow.com/comment/47915565
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29896315
has text: Hum... I'll try something like this: http://stackoverflow.com/questions/2568966/how-do-i-pass-the-value-not-the-reference-of-a-js-variable-to-a-function

http://stackoverflow.com/a/29867758
accepted answer of: http://stackoverflow.com/q/29867315
has body: The problem was here: var activeItem = $(this).find("li.active") it should have been var activeItem = $(t.find("li.active")) I don't get why a simple this.find("li.active") didn't work, as Shaunak D suggested Thanks for your help! EDIT: It seems that when the event "click #menu-items" is raised the active li found is the previous one. Do you guys know what event I should hook to display the currently active link? EDIT ANSWER Session.set ("pageTitle",$(e.target).text());
score: 0
has comment: http://stackoverflow.com/comment/47864594
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29867315
type: Answer

http://stackoverflow.com/comment/48118571
score: 0
has text: I think your first method generate different things as 2 and 3. First method is a list of list. As for the performance, method 2 will have less operations since you manually put the 5 items in each iteration, this can be a bit faster. However, method 2 has the limitation that if the total length is not dividable to 5, you have extra items been inserted. In javascript is ok, in Java you get exception.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29999657

http://stackoverflow.com/comment/117925192
has text: I couldn't figure out how to add some space between the default label and search box, so I used this method to change it to "Search:&nbsp&nbsp" and it worked!
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/38133762
type: Comment

http://stackoverflow.com/q/29925656
type: Question
tagged with: charts
has answer: http://stackoverflow.com/a/29928662
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29928662
tagged with: highcharts
downvote count: 0
answer count: 1
favorite count: 0
type: AnsweredQuestion
score: 1
upvote count: 1
has body: I am experimenting with highcharts and there is one thing that many charts have as a functionality and that is to rescale the current view to show only the datapoints that currently are in view to fit the chart. For instance, given these datapoints on a large time period, : [1, 50, 100, 1, 50, 100, 200 ] The chart will show up initially with a scale of say 1 - 200. When you then move the chart left to view older data, 200 gets out of the view, and the graph gets rescaled into 1 - 100, then 1 - 50, then 1 - 1, then it grows again to 1 - 100. The problem with this should be obvious. If you are trying to get any sense of the data by scrolling back in history, you can't really. Although I do agree that sometimes it is desirable to rescale, it isn't always the case. Sometimes you just want to view the graph as is, using a large range around large discrepancies in the data, without rescaling to try to fit all datapoints. I have tried to set reflow: false but this did not work. Any ideas on wether this is possible or not? Edit: Here is a fiddle that attemps to show some of these problems in example: https://jsfiddle.net/3Ld2zmum/1/ If you just scroll on the default zoom, then you will suddenly see there is a datapoint that in my case should be ignored. I would like to see the data around it. I do not want it to affect the zoom level. Right now, I am prevented from effeciently analyzing data around this point because the graph keeps scaling up and down. The problem with rescaling is that a high/low datapoint will automatically zoom all other data out so it becomes really small when there are hugh sudden variances in the dataset. I can choose a small timeperiod, but then it becomes really difficult to analyze huge amounts of data with such a small range. After having thought about this, i understand that the only way to solve this issue would be to introduce some kind of scroll on the y axis, so that when you move left, you will actually see only white space. You would have …
has title: highstock, how to prevent chart rescaling

http://stackoverflow.com/q/29855092
has body: Single click inline row editing started from beforeSelectRow is not working in latest free jqgrid from github master. Clicking in row to start inline edit causes now exception Uncaught TypeError: Cannot read property 'rows' of undefined Line 16181 Column 45TypeError: Cannot read property 'rows' of undefined at showHideEditDelete Open this page in chrome and press Kohe button so that it is in pressed state. After that click in some line to start inline editing. This exception occurs. How to use single click inline row editing in latest free jqgrid ?
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29855739
type: Question
tagged with: jqgrid
tagged with: javascript
has title: How to use single click line editing in latest jqgrid
has answer: http://stackoverflow.com/a/29855739
tagged with: free-jqgrid
score: 0
answer count: 1
tagged with: jquery
tagged with: css

http://stackoverflow.com/q/29918892
has body: I am trying to make an ionic app with angularjs in the front end and node.js in the back end. I get the front end part and I have done it in angularjs. But I am not sure how to work with node.js as a back end. For example I need to make a GET request to a web api with nodejs and use angular to show it in my view. How to make the request with node.js and send it to the angular controller. I was searching online but I did not see any example or tutorial that could show how angular and node work together. Any website, tutorial or code snippet in this regard will be very helpful
upvote count: 3
downvote count: 0
answer count: 1
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
tagged with: node.js
score: 3
has answer: http://stackoverflow.com/a/29918964
tagged with: ionic-framework
type: Question
has title: How does angular work with the node in an Ionic app?
tagged with: javascript

http://stackoverflow.com/comment/48033713
type: AnswerComment
has text: @DylanWatt I think avoiding scanning is kinda impossible, isn’t it (if the product IDs are in unpredictable order, that is…)?
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29956385

http://stackoverflow.com/q/29957278
favorite count: 0
score: -1
has comment: http://stackoverflow.com/comment/48035415
tagged with: angularjs
type: Question
upvote count: 1
accepted answer: http://stackoverflow.com/a/29957868
linked to: http://stackoverflow.com/q/18287482
has answer: http://stackoverflow.com/a/29957295
has body: I am having a problem with Angular JS receiving an error Uncaught Error: [$injector:modulerr].... this my javascript and html code.. what's wrong there? (function(){ var app = angular.module('store', []); app.controller('tes', function($scope) { }); })(); Angular {{ 4 + 4 }}
downvote count: 2
has title: Angular - Uncaught Error: [$injector:modulerr]
tagged with: javascript
has comment: http://stackoverflow.com/comment/48036479
has answer: http://stackoverflow.com/a/29957710
answer count: 4
has answer: http://stackoverflow.com/a/29957868
has answer: http://stackoverflow.com/a/29960098
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/29957710

http://stackoverflow.com/comment/48122564
type: QuestionComment
comment on: http://stackoverflow.com/q/29992561
has text: So after more debug I can say that the result.php doesent load in on the mobile. I added an echo but that did't run so none of the result.php code works in the phone. So what ca nbe the problem? Why doesent it run on the mobile? @Sushil
score: 0
type: Comment

http://stackoverflow.com/comment/48005104
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29938900
has text: yeah, you almost did it, if you didn't forget the test! ;)
type: AnswerComment

http://stackoverflow.com/q/29930464
tagged with: angularjs
has title: Mean.js Node.js background processes
tagged with: node.js
type: AnsweredQuestion
downvote count: 0
score: 1
has body: I've got a mean.js app I'm writing and I am conceptually confused about background processes. I need to have some processes that run continuously in the background that operate on the mongodb database and do stuff like cleanup, email, tweets, etc. I need a lot of the same functionality and libraries I have in my web app available to these background procs. What is the best way to do this? Do I start with a brand new source base and treat these worker procs like a separate app? Or do I create, say, a daemon folder and fork the background procs when I start the server.js with grunt? I think I am confusing myself and probably making this more complicated than it should be. I have looked at node daemon and child_processes and simple_daemon. But I'm not sure what path to take. Thanks for your help.
favorite count: 0
type: Question
tagged with: mongodb
accepted answer: http://stackoverflow.com/a/29930764
has comment: http://stackoverflow.com/comment/47983269
linked to: http://stackoverflow.com/q/14795145
tagged with: javascript
has answer: http://stackoverflow.com/a/29930764
upvote count: 1
answer count: 1
tagged with: meanjs

http://stackoverflow.com/q/29911950
tagged with: c#
tagged with: asp.net-mvc
tagged with: .net
tagged with: javascript
linked to: http://stackoverflow.com/q/18873098
has body: I'm following js snippet to grab value dynamic number of input elements. I then use that values as a property inside js object which I later sent to mvc controller. Since I already using Model inside razor which already has necessary properties to send to the mvc controller I wonder how can I grab those dynamic input elements values without using javascript object. var myArr= []; for (var i = 1; true; i++) { var pTxtBox = $('#PCaption' + i); var nTxtBox = $('#PWinners' + i); if ((pTxtBox).length) { var myObj = {}; myObj.Name = pTxtBox.val(); myObj.NWinners = nTxtBox.val(); myArr.push(myObj); } else { break; } }
has title: using razor form and model values instead of current js object
score: 2
has comment: http://stackoverflow.com/comment/47946158
answer count: 1
downvote count: 0
favorite count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29913623
upvote count: 2
type: Question
has comment: http://stackoverflow.com/comment/47946124

http://stackoverflow.com/a/29930022
downvote count: 0
has comment: http://stackoverflow.com/comment/48023206
answers question: http://stackoverflow.com/q/29929066
has comment: http://stackoverflow.com/comment/47982391
accepted answer of: http://stackoverflow.com/q/29929066
has comment: http://stackoverflow.com/comment/47982541
has body: groupBy isn't the right tool for this job, objects aren't ordered in JavaScript so there's no guarantee that you'll get your chunks in the right order. Yes, this means that the canonical answer for chunking is wrong. So your first problem is to properly chunk the data. If you're using lodash, you could use its _.chunk. If you're using plain Underscore, you could mixin your own _.chunk and the lodash version can be easily adapted: _.mixin({ chunk: function(a, n) { // Based on lodash's var i = 0, length = a.length, ri = -1; var result = Array(Math.ceil(length / n)); while(i < length) result[++ri] = a.slice(i, i += n); return result; } }); Now you can chunk your data into fours and get an array-of-arrays out with everything in the right order: var chunks = _(data).chunk(4); Then you want to hand the chunks to your template: var rendered = Mustache.render(template, { chunks: chunks }); And finally, your template needs to iterate over the chunks to produce the s and then iterate over each chunk to produce the s inside the s. That would look like this: {{#chunks}} {{#.}} {{location}} {{/.}} {{/chunks}} Demo: http://jsfiddle.net/ambiguous/b2te16pj/
upvote count: 3
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/48015911
has comment: http://stackoverflow.com/comment/48019833
has comment: http://stackoverflow.com/comment/48007548
type: Answer
has comment: http://stackoverflow.com/comment/48022914
has comment: http://stackoverflow.com/comment/48021788
score: 3

http://stackoverflow.com/comment/107652706
has text: One minor adjustment: it should be if (location.hash == '#popup')
comment on: http://stackoverflow.com/a/38031996
type: Comment
score: 2
type: AnswerComment

http://stackoverflow.com/a/54860851
downvote count: 0
has body: As I understand from your code here, you wish to specify two categories with names 1 and 2 but you are not specifying any data for second category, So the only category that is showing on your chart is 1. Your data array for each series must have elements per each category. For example if you have two category you should consider having two data elements in each series. In this line data: [data.score] you are just specifying one element in data array. Your code should be something like this: (make it dynamic per your need) $.each(results, function(i, data){ categories.push(data.name); detailchart.addSeries({ name: data.name, data: [data.score, 40], //40 is some data for your second category. }); }); Demo: http://jsfiddle.net/u6crkatv/
type: Answer
has comment: http://stackoverflow.com/comment/96498240
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/29948363
has comment: http://stackoverflow.com/comment/96497935
has comment: http://stackoverflow.com/comment/96503408

http://stackoverflow.com/q/29929841
has body: Hopefully I can explain this so you can understand. I just finished up a question getting help with angular's $interval functionality. Let's start from the basics first: I have a dropdown where a user selects an option. That action calls a select method which makes a $http.get( ) request. The resulting data is then placed into a list using mg-repeat. The data can be updated from another service, so I need this list to periodically poll and refresh the list, enter $interval In this code below, I am close, but not quite there. Say I want to refresh the list once every 10 seconds, if I choose option 1 from the start, it will refresh option 1's list every 10 seconds. Great right? Now if I choose option 2, in terms that I understand, it seems like it creates another thread. It changes the $http.get( ) where it goes from option 1 to option 2, but it keeps option 1's $interval thread open. So it pings option 2's $http.get( ) twice in 10 seconds. Once following the time interval of the first request ever(for option 1) and once in the interval of me selecting option 2. Here is the JS code for the select function. This happens when a user selects something from the dropdown: $scope.select = function() { $scope.searchText = ''; $scope.selectedItem = null; var url = 'http:xxxxxxxxxxxx.com'; url += $scope.selectModel.name; console.debug("GOING TO: " + url); $http.get(url).success(function(data2) { $scope.records = []; data2.forEach(function(r) { $scope.records.push(r); }); }); $interval(function() { $http.get(url).success(function(data2) { $scope.records = []; data2.forEach(function(r) { $scope.records.push(r); }); }); }, 30000); }; And here is the section of html in question: Search Choose Model # Name Score {{$index+1}} {{item.name.slice(5)}} {{item.score.toFixed(3)}} Let me know if i need to clarify some. Thanks.
tagged with: angularjs
has comment: http://stackoverflow.com/comment/47981916
has title: $interval happening too many times
type: Question
type: AnsweredQuestion
score: 1
accepted answer: http://stackoverflow.com/a/29929933
upvote count: 1
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/29929933

http://stackoverflow.com/q/29912829
accepted answer: http://stackoverflow.com/a/29912851
answer count: 1
downvote count: 0
favorite count: 0
has body: I use /^[a-zA-Z]+$/ to check if a string is alphabetic and /^((?!some|words|in|blacklist).)*$/ to validate if it does not contain some specific words. How can I check for both conditions in a single regex pattern?
has title: Check if string is alphabetic and does not contain some specific words
score: 5
tagged with: regex
type: AnsweredQuestion
type: Question
upvote count: 5
has answer: http://stackoverflow.com/a/29912851
tagged with: javascript

http://stackoverflow.com/comment/47949835
type: QuestionComment
comment on: http://stackoverflow.com/q/29914035
score: 0
has text: The disable cache checkbox does exactly what it says - when you refresh the page with it checked it will request all supplementary files from the server again, instead of reading the previous version of them from the cache.
type: Comment

http://stackoverflow.com/q/29925753
has body: I have set up typeahead.js version 0.11.1 to pull cities from the geobytes API. Here is a codepen that does just that: http://codepen.io/jeremeevans/pen/OVPram var cities = new Bloodhound({ datumTokenizer: Bloodhound.tokenizers.obj.whitespace(), queryTokenizer: Bloodhound.tokenizers.whitespace, remote: { url: "http://gd.geobytes.com/AutoCompleteCity?callback=?&amp;template=&lt;geobytes%20city&gt;,%20&lt;geobytes%20code&gt;&amp;filter=US&amp;q=%QUERY", wildcard: "%QUERY", dataType: "jsonp", transform: function (response) { return response; } }, limit: 10 }); $("#city").typeahead({ minLength: 3, highlight: true, hint: true }, { name: "US-Cities", source: cities }); The bizarre behavior I'm seeing is that when I start typing Seattle, when I get to "Seat" it's only listing two results, "Seaton, IL" and "Seatonville, IL". I know there are a lot more results being returned by the API, including "Seattle, WA." Also, if you start searching for "Everett" all results drop off at "Everet" and stay invisible until you get to "Everett," - at which point it shows "Everett, MA" and "Everett, PA" but not "Everett, WA". The documentation for options and such pertaining to version 0.11.1 is pretty terrible over at https://github.com/twitter/typeahead.js - I would really appreciate some insight on how to use this and not have it butcher which results it shows.
has comment: http://stackoverflow.com/comment/52887540
type: Question
tagged with: javascript
upvote count: 3
tagged with: typeahead.js
has answer: http://stackoverflow.com/a/33139159
answer count: 1
has title: Strange behavior from typeahead.js
favorite count: 0
tagged with: typeahead
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/31007825
score: 3
downvote count: 0

http://stackoverflow.com/comment/47850823
score: 0
type: AnswerComment
type: Comment
has text: Hi Thank you for you reply. I tried like below script am getting [object, Object],[object, Object] message. var object1 = [{ "id": 1, "name": "Vasanth", "username": "Vasanth.Rajendran", "email": "vasanth@mail.com" }]; var object2 = [{ "id": 2, "name": "Raju", "username": "Raju.Rajendran", "email": "Raju@mail.com" }]; var newObj = object1.concat(object2); alert(newObj); </script
comment on: http://stackoverflow.com/a/29862592

http://stackoverflow.com/q/29977287
has title: How to pass an object to AngularJS factory?
tagged with: javascript
favorite count: 0
score: 0
tagged with: angularjs
has comment: http://stackoverflow.com/comment/48074226
possible better answer: http://stackoverflow.com/a/29977639
has body: I am in edit state i am trying to update riskDto but i am getting an error about some object i dont know what i am doing wrong please help. Code tried so far... ctrl.js RiskService.saveAllignRiskToProcess($scope.riskDTO,$stateParams.processKey).then(function (response) { if ($scope.editMode) { $scope.hideYesBtn = true; $scope.hideNoBtn = true; $scope.showOkBtn = true; $scope.messageText = 'Updated Risk Within Process successfully'; $scope.confirmationWin.open().center(); $scope.okCallback = $scope.riskAlignToProcessBack; } } }); facotry.js saveAllignRiskToProcess: function(processKey) { return $http.post('app/risk/rest/riskTocontrol/saveCreateAndAlignNewRiskToProcess/' + processKey); } state.js .state('createAndAlignRisk', { url: '/risk/cnaRsk/:processKey', templateUrl: 'views/risk/createNewRisk.html', controller: 'RiskCtrl', data: { authenticate: true } }) consoleError /riskTocontrol/saveCreateAndAlignNewRiskToProcess/[object%20Object]
has comment: http://stackoverflow.com/comment/48074153
has answer: http://stackoverflow.com/a/29977639
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/48074245
type: Question
has comment: http://stackoverflow.com/comment/48074225
answer count: 2
upvote count: 1
has answer: http://stackoverflow.com/a/29977361
accepted answer: http://stackoverflow.com/a/29977361
downvote count: 1

http://stackoverflow.com/q/29912646
score: -3
accepted answer: http://stackoverflow.com/a/29913345
type: AnsweredQuestion
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/47947410
upvote count: 0
tagged with: arrays
tagged with: javascript
tagged with: jquery
tagged with: string
has comment: http://stackoverflow.com/comment/47948446
favorite count: 0
has answer: http://stackoverflow.com/a/29912708
has answer: http://stackoverflow.com/a/29913345
has title: Compare strings in array to other strings array
has body: I'm looking for a good way to compare strings in one array to strings in another array. If one or more strings match the strings in the other array, do something with this element where the matched string is = element attr + other element attr. Help much appreciated! EDIT: var cSC = $('.cpa'); var existingSel = cSC.map(function () { return $(this).attr("data-fd") + $(this).attr("data-t"); }).get(); console.log(existingSel); if (sessionStorage.trueDates) { var oldArr = JSON.parse(sessionStorage.trueDates); } else { var oldArr = JSON.parse(sessionStorage.calDT); } var uiSel = $(".class"); var calDataStore = uiSel.map(function(){ return $(this).attr("data-fd") + $(this).attr("data-t"); }).get(); sessionStorage.setItem("calDT", JSON.stringify(calDataStore)); console.log(JSON.parse(sessionStorage.calDT)); var newArr = JSON.parse(sessionStorage.calDT); var trueArr = newArr.concat(oldArr); sessionStorage.setItem("trueDates", JSON.stringify(trueArr)); }); if (sessionStorage.trueDates) { console.log(JSON.parse(sessionStorage.trueDates)); } I want to compare these arrays (existingSel &amp; oldArr) for(var ii=0; ii &lt; existingSel.length; ii++){ if(existingSel[ii] == oldArr[ii]){ console.log('Match found!'); } } But they return nothing (no console message) I have a reset button that does this on click: sessionStorage.removeItem("trueDates"); sessionStorage.setItem("calDT", "0");
possible better answer: http://stackoverflow.com/a/29912708
downvote count: 3

http://stackoverflow.com/a/29949183
accepted answer of: http://stackoverflow.com/q/29948929
has body: Don't rely on Date to know timezone names Don't mix a date with a time; the year should be before the time, the timezone should be the very last thing Putting these together var timezone_map = { 'BST': 'GMT+0100' }; function re_order(str) { var re = /^(\w+) (\w+) (\d\d) (\d\d:\d\d:\d\d) (\w+) (\d\d\d\d)$/; return str.replace(re, function ($0, day, month, date, time, zone, year) { return day + ' ' + month + ' ' + date + ' ' + year + ' ' + time + ' ' + (timezone_map[zone] || zone); }); } new Date(re_order('Tue Apr 28 16:15:22 BST 2015')); // Tue Apr 28 2015 16:15:22 GMT+0100 (GMT Daylight Time)
type: Answer
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/29948929
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/47972596
score: 0
type: AnswerComment
has text: Thank you Shomz! this is what i wanted and it works fine. Thanks for quick reply. Hope all the best for you
type: Comment
comment on: http://stackoverflow.com/a/29908875

http://stackoverflow.com/comment/48048247
has text: Thanks, that works! Is there any advantage on using angular.element over wrapping the element between $() ?
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29963970
type: Comment

http://stackoverflow.com/a/29870321
accepted answer of: http://stackoverflow.com/q/29869437
type: Answer
has comment: http://stackoverflow.com/comment/47868523
answers question: http://stackoverflow.com/q/29869437
has comment: http://stackoverflow.com/comment/47868144
type: AcceptedAnswer
has body: PointCloud.sortParticles was removed in three.js r70; see this commit. In your original example (without transparency), you can get your desired behavior by enabling the depth test for your material: var shaderMaterial = new THREE.ShaderMaterial({ ... depthTest: true }); In your updated example (with transparency), it's necessary to sort the particles yourself in three.js r70. Note that three.js still handles z-sorting when rendering THREE.Sprite objects. That could be worth investigating.
has comment: http://stackoverflow.com/comment/47896554
score: 0
has comment: http://stackoverflow.com/comment/47868940

http://stackoverflow.com/a/78978434
answers question: http://stackoverflow.com/q/29863011
has body: My tr gets added twice.Means if there are 3 rows(A,B,C) then. 6 rows will be added like (A,A,B,B,C,C) var html1 = ' ' + ` Save ` + ' '; i++; $("#Create tbody").append(html1);
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/139277433

http://stackoverflow.com/a/29902376
score: 3
has body: Just listen to change and update it. http://plnkr.co/edit/NuSOA64QJ5Qro3L72zzZ?p=preview link: function($scope, $element, $attr) { console.log('loaddirective link'); var value = $scope.loaddirective; function update (value) { $element.html("&lt;div " + value + " directivedata='directivedata'&gt;&lt;/div&gt;"); $compile($element.contents())($scope); } if (value) { update (value); } $scope.$watch('loaddirective', update); },
accepted answer of: http://stackoverflow.com/q/29902165
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29902165
upvote count: 3
type: Answer
downvote count: 0

http://stackoverflow.com/comment/48054224
type: Comment
has text: Thanks for the answer! I understand the problem now. But I have a problem with this approach. I don't want this action to be done unless the conditions above are met. I only want it do be executed if page is_single(). Do you know how to achieve this? Can I simply put the add_action in there?
score: 0
comment on: http://stackoverflow.com/a/29967234
type: AnswerComment

http://stackoverflow.com/a/29977932
has body: Set the target's text() with the full text; so your HTML tags will be encoded. Then do the BBCode replacement on the encoded HTML: $('#posttextareadisplay').text( $('#textareainput').val() ); var replacebbcode = $('#posttextareadisplay'). html(). replace(/(\[((\/?)(b|u|i|s|sub|sup))\])/gi, '<$2>'); $('#posttextareadisplay').html( replacebbcode ); [b]bold[/b] bold
upvote count: 1
has comment: http://stackoverflow.com/comment/48076065
score: 1
has comment: http://stackoverflow.com/comment/48076216
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29977772
downvote count: 0
has comment: http://stackoverflow.com/comment/48075736
has comment: http://stackoverflow.com/comment/48075939
answers question: http://stackoverflow.com/q/29977772
type: Answer

http://stackoverflow.com/comment/47865224
has text: Could you include your html as well please?
score: 0
comment on: http://stackoverflow.com/q/29870081
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/47969408
comment on: http://stackoverflow.com/a/29923852
has text: I think your explanation is spot on. However, I don't think the fix is right.
score: 0
type: Comment
type: AnswerComment

http://stackoverflow.com/a/29974867
accepted answer of: http://stackoverflow.com/q/29973426
type: Answer
answers question: http://stackoverflow.com/q/29973426
upvote count: 5
has comment: http://stackoverflow.com/comment/115706937
downvote count: 0
score: 5
type: AcceptedAnswer
has body: Yes, you can do this using Google Places API. I'll use JavaScript API as it seems you're using JS. As said in documentation: The Places service is a self-contained library, separate from the main Maps API JavaScript code. To use the functionality contained within this library, you must first load it using the libraries parameter in the Maps API bootstrap URL: After this, by using JavaScript Places API, you can request places by type and radius (in meters). The maximum allowed radius is 50.000 meters. Here is a piece of code that demonstrates this: var request = { location: sydney, radius: 5000, types: ['church'] }; var service = new gm.places.PlacesService(map); service.nearbySearch(request, handlePlaceResponse); Obs.: In this example, handlePlaceResponse is a callback to handle the response and create the markers. See in the complete example how it works. This will request the churches in a 5km radius from Sydney point (lat: -33.8670522, lng: 151.1957362). To overlay markers you'll need to handle the response. In the example, I'm using only the place's name as the content of InfoWindow. You can see details about the response here: Place Details Responses So, a function to create markers looks like this: /** * Creates marker with place information from the response */ function createMarker(place) { var marker = new google.maps.Marker({ map: map, position: place.geometry.location }); var infowindow = new google.maps.InfoWindow(); google.maps.event.addListener(marker, 'click', function() { infowindow.setContent(place.name); infowindow.open(map, this); }); } For the types supported by the API, have a look at this link: Place Type Here is an example using the point you have in your question as the center point and 5000 meters for radius: Google Maps - Places Sample P.S.: make sure to replace ${YOUR_API_KEY} with your own key.

http://stackoverflow.com/comment/48024087
has text: How do you want to display the information inside the polygon? A label, info window?
comment on: http://stackoverflow.com/q/29938041
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29969694
answers question: http://stackoverflow.com/q/29969529
has body: With JQuery you can use $("#ElementID").css("display", ""); to clear the display attribute. If it needs to be something else, just change the second parameter in the css() function. More info here: http://api.jquery.com/css/
score: 0
type: Answer

meteor
tags question: http://stackoverflow.com/q/29949762
tags question: http://stackoverflow.com/q/29938992
tags question: http://stackoverflow.com/q/29967752
tags question: http://stackoverflow.com/q/29975316
tags question: http://stackoverflow.com/q/29985690
tags question: http://stackoverflow.com/q/29917173
tags question: http://stackoverflow.com/q/29952791
tags question: http://stackoverflow.com/q/29964554
tags question: http://stackoverflow.com/q/29945611
tags question: http://stackoverflow.com/q/29996461
tags question: http://stackoverflow.com/q/29881428
tags question: http://stackoverflow.com/q/29883931
tags question: http://stackoverflow.com/q/29870586
tags question: http://stackoverflow.com/q/29896775
tags question: http://stackoverflow.com/q/29904768
tags question: http://stackoverflow.com/q/29924588
tags question: http://stackoverflow.com/q/29875229
tags question: http://stackoverflow.com/q/29938436
tags question: http://stackoverflow.com/q/29876429
tags question: http://stackoverflow.com/q/30000151
tags question: http://stackoverflow.com/q/29863572
tags question: http://stackoverflow.com/q/29870127
tags question: http://stackoverflow.com/q/29850336
tags question: http://stackoverflow.com/q/29951068
tags question: http://stackoverflow.com/q/29968394
tags question: http://stackoverflow.com/q/29977285
tags question: http://stackoverflow.com/q/29905317
tags question: http://stackoverflow.com/q/29848021
tags question: http://stackoverflow.com/q/29940156
tags question: http://stackoverflow.com/q/29867315
tags question: http://stackoverflow.com/q/29957005
tags question: http://stackoverflow.com/q/29861482
tags question: http://stackoverflow.com/q/29862115
tags question: http://stackoverflow.com/q/29951579
type: Tag
tags question: http://stackoverflow.com/q/29886550
tags question: http://stackoverflow.com/q/29854661
tags question: http://stackoverflow.com/q/29892101
tags question: http://stackoverflow.com/q/29881958
tags question: http://stackoverflow.com/q/29973207
tags question: http://stackoverflow.com/q/29993454
tags question: http://stackoverflow.com/q/29923441
tags question: http://stackoverflow.com/q/29911723
tags question: http://stackoverflow.com/q/29923360
tags question: http://stackoverflow.com/q/29928676
tags question: http://stackoverflow.com/q/29971737
tags question: http://stackoverflow.com/q/29976152
tags question: http://stackoverflow.com/q/29922708
tags question: http://stackoverflow.com/q/29856249
tags question: http://stackoverflow.com/q/29987028
tags question: http://stackoverflow.com/q/29896776
tags question: http://stackoverflow.com/q/29877254
tags question: http://stackoverflow.com/q/29853528
tags question: http://stackoverflow.com/q/29860271
tags question: http://stackoverflow.com/q/29910358
tags question: http://stackoverflow.com/q/29890608
tags question: http://stackoverflow.com/q/29944108
tags question: http://stackoverflow.com/q/29998893
tag name: meteor
tags question: http://stackoverflow.com/q/29935705
tags question: http://stackoverflow.com/q/29905199
tags question: http://stackoverflow.com/q/30002443
tags question: http://stackoverflow.com/q/29967248
tags question: http://stackoverflow.com/q/29900541
tags question: http://stackoverflow.com/q/29900221
tags question: http://stackoverflow.com/q/29970680
tags question: http://stackoverflow.com/q/29884182
tags question: http://stackoverflow.com/q/29916651

http://stackoverflow.com/q/29917438
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29917463
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/47958140
answer count: 3
has answer: http://stackoverflow.com/a/29917457
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47998972
has title: jquery .on click not detected on dynamically added content
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47956023
duplicate of: http://stackoverflow.com/q/203198
has answer: http://stackoverflow.com/a/29917453
score: -1
type: Question
has body: I'm using an ajax call to insert a menu.html inside my index.html, the call for the jquery script menu-script.js which handles the hide\show feature of this nested menu is properly loaded and executed into the index.html(indeed the menu is all closed), however the on.('click', function(){.. etc is not fired when menu items are clicked. This is the script: $(function() { $('body').addClass('js'); var menu = $('#menu'), menulink = $('.menu-link'), menuTrigger = $('.has-subnav > a'); menulink.on('click', function(e) { console.log('menulink cliked'); e.preventDefault(); menulink.toggleClass('active'); menu.toggleClass('active'); }); menuTrigger.on('click', function(e) { console.log('menutrugger cliked'); e.preventDefault(); $(this).toggleClass('active').next('ul').toggleClass('active'); }); $('a[href*=#]:not([href=#])').on('click', function() { console.log('ahref?'); if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) { var target = $(this.hash); target = target.length ? target : $('[name=' + this.hash.slice(1) +']'); if (target.length) { $('html,body').animate({ scrollTop: target.offset().top }, 600); return false; } } }); And the menu.html (part of it): Manuale Base Per iniziare Razze Classi Abilitàs
downvote count: 2
upvote count: 1

http://stackoverflow.com/a/29943511
type: Answer
answers question: http://stackoverflow.com/q/29943122
has body: The best solution is to pass reference to angular method into scope $scope.isString = angular.isString then in partial you can just use ng-if="isString(item)" http://plnkr.co/edit/5keCUQrHQnbl4Wg0oKp1?p=preview
score: 2
downvote count: 0
upvote count: 2

http://stackoverflow.com/comment/47964375
type: Comment
comment on: http://stackoverflow.com/a/29863619
type: AnswerComment
has text: `if (confirm("succ: " + result)) { anotherFunction(result)); }`
score: 0

http://stackoverflow.com/q/29863742
tagged with: firefox-addon
tagged with: firefox-addon-sdk
upvote count: 1
answer count: 1
has title: Sending current tab's URL to plugin content
has body: I'm making a add-on for Firefox using the Add-on SDK and I need to somehow get the active tabs URL to the add-on's content, whenever the tab is created or switched to. My main.js looks like this: var { ToggleButton } = require('sdk/ui/button/toggle'); var panels = require("sdk/panel"); var self = require("sdk/self"); var button = ToggleButton({ id: "my-button", label: "my button", icon: { "16": "./img/icon-16.png", "32": "./img/icon-32.png", "64": "./img/icon-64.png" }, onChange: handleChange }); var panel = panels.Panel({ width: 640, height: 400, contentURL: self.data.url("index.html"), onHide: handleHide }); function handleChange(state) { if (state.checked) { panel.show({ position: button }); } } function handleHide() { button.state('window', {checked: false}); } The index.html that's loaded into the panel has some embedded JavaScript and that's where I need to send the current URL to. I've looked at the documentation here but it speaks of "content-scripts", something I'm unsure of if I even use, or need to use. So which is the quickest way of doing this? Thanks.
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29883481
tagged with: firefox
downvote count: 0
tagged with: javascript
score: 1
favorite count: 0
type: Question

http://stackoverflow.com/a/30057601
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/48484670
type: Answer
has body: Given your circumstances, I think you are going to have to duplicate some of your custom marker logic in something that extends from L.Marker to be able to use it outside of the Leaflet.draw context...because L.Draw.Marker extends from L.Draw.Feature(https://github.com/Leaflet/Leaflet.draw/blob/master/src/draw/handler/Draw.Marker.js#L1), while Leafet's Marker extends from L.Layer(https://github.com/Leaflet/Leaflet/blob/master/src/layer/marker/Marker.js#L5)..So that's not exactly a clear inheritance tree to be overriding things with between those two.
has comment: http://stackoverflow.com/comment/48494074
downvote count: 0
answers question: http://stackoverflow.com/q/29939434

http://stackoverflow.com/q/29902394
has body: I have this function executed in a script $(document).ready(documentReady); function documentReady(){ console.log("Ready"); $(".loadMore").on("click",loadMoreClicked(this.id)); } function loadMoreClicked(elementID){ //do something with elementID } However, everytime the document loads up, it executes instantly the loadMoreClicked function - thus giving an error. It seems that if I just want to assign a function to the click event without it being executed directly, I have to remove any argument. Why does it happen, and how can I avoid it?
accepted answer: http://stackoverflow.com/a/29902420
type: Question
has answer: http://stackoverflow.com/a/29903183
has title: Avoid immediate executing of a function in Jquery
has answer: http://stackoverflow.com/a/29903250
upvote count: 1
has answer: http://stackoverflow.com/a/29902476
answer count: 5
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29902417
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29902420
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
score: 1
favorite count: 0
possible better answer: http://stackoverflow.com/a/29902417

http://stackoverflow.com/q/29868238
favorite count: 0
has comment: http://stackoverflow.com/comment/47863187
has body: Forgive me if this has been asked, but I've been searching all day on here and have not seen any question relating to my specific problem. I'm building a one page parallax-style website with a navigation bar utilizing a fixed position to allow users to quickly jump to different sections of the page. Currently I'm trying to implement the scrollTo jQuery plugin (flesler/jquery.scrollTo - Github) to give a nice smooth animated scroll. This is the 5th or 6th different jQuery method I've implemented to make this effect work with no success. The scrollTo method seems to be the closest to working, but it still won't work. It does not work at all on Chrome 42.0.2311.90 It does not work at all on Firefox 37.0.2 It does work on Safari 5.1.10, but I haven't been able to check on the newest version of Safari. Also the site doesn't render right on Safari 5.1.10 yet. I also have not had access to a computer with IE. The test site is located at http://revolt-designs.com/parallax/ Here is how I'm calling the script: $(document).ready(function(){ $('#nav-links li a').click(function() { $.scrollTo($(this).attr('href'), {duration: 3000}); }); }); And the links are formatted this way: About News Events Contact For the sake of simplicity, the anchors are pointing to divs located on the page, ie: Lorem Ipsum Hopefully someone will catch something small and easy that I'm missing. Thanks. To be clear, I'm not asking for an alternative to the script I'm using. I'm asking for help finding the underlying issue that's preventing any smooth scrolling scripts from working on my site.
has comment: http://stackoverflow.com/comment/47863616
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29869277
tagged with: google-chrome
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29870373
accepted answer: http://stackoverflow.com/a/29870373
tagged with: javascript
score: 4
has title: jQuery scrollTo not working Chrome/Firefox
possible better answer: http://stackoverflow.com/a/29869277
upvote count: 4
answer count: 2
has comment: http://stackoverflow.com/comment/47863509
tagged with: scrollto
downvote count: 0
tagged with: jquery

http://stackoverflow.com/comment/47991421
type: QuestionComment
comment on: http://stackoverflow.com/q/29934688
has text: What does this have to do with the title of your post? I don't see where you are trying to send a comma to anything.
score: 0
type: Comment

http://stackoverflow.com/q/29976561
tagged with: momentjs
has title: Using moment.js to convert time (HH:mm:ss) to (HH:mm)
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/60075663
score: 7
has comment: http://stackoverflow.com/comment/48076196
has comment: http://stackoverflow.com/comment/48102365
upvote count: 8
type: Question
has comment: http://stackoverflow.com/comment/48097270
has answer: http://stackoverflow.com/a/29976638
accepted answer: http://stackoverflow.com/a/29976638
has body: I was wondering if I could use moment.js to convert an sql TIME (HH:mm:ss) to just HH:mm. Or maybe there is a simple JavaScript/jQuery solution to this?
tagged with: javascript
possible better answer: http://stackoverflow.com/a/60075663
answer count: 2
downvote count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/106249957
favorite count: 0

http://stackoverflow.com/comment/47849386
type: Comment
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/29861786
has text: thanks. I added ` ` and it worked .. Thanks for the idea.

http://stackoverflow.com/a/29895294
answers question: http://stackoverflow.com/q/29895263
has body: Wrap it in self-executing anonymous function for (var i = 0; i &lt; 10; i++) { (function (i) { procedures[procedures.length] = function () { alert("You are now " + i + " years old"); } })(i); }
has comment: http://stackoverflow.com/comment/47913699
has comment: http://stackoverflow.com/comment/47914810
upvote count: 1
type: AcceptedAnswer
type: Answer
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/29895263

http://stackoverflow.com/comment/48059296
type: Comment
comment on: http://stackoverflow.com/q/29965562
score: 0
has text: @kiwi1342 Yes, and you had to change the css for the absolutely positioned one, because it wouldn't behave the same as the other one...
type: QuestionComment

http://stackoverflow.com/q/29977772
linked to: http://stackoverflow.com/q/3964710
score: 2
upvote count: 2
has body: I am currently writing my own BBCode parser. Now what I would like to do is allow the user to enter BBCode, and then it will write it into HTML and display it has HTML. Yet if they enter HTML it will just show it as plain old HTML. Here is what I have so far: var replacebbcode = $('#textareainput').val().replace(/(\[((\/?)(b|u|i|s|sub|sup))\])/gi, '&lt;$2&gt;'); $('#posttextareadisplay').html(replacebbcode); In the above I am just replacing all BBCode with HTML tags. Problem is if a user directly enter HTML it will use that as well. So basically, how can I display BBCode as HTML, but actual HTML as text?
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/64212144
has answer: http://stackoverflow.com/a/64212144
tagged with: javascript
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/29977932
downvote count: 0
tagged with: jquery
favorite count: 0
accepted answer: http://stackoverflow.com/a/29977932
has title: Display HTML As Text, Change BBCode to Display as HTML JQuery/JS
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/48006892
comment on: http://stackoverflow.com/a/29943023
type: AnswerComment
has text: i think this is what i mean.. is there a way to make it add `,` if two values are set?or i need to add condition for that like and `if statement`?
score: 0
type: Comment

http://stackoverflow.com/comment/47977522
type: Comment
has text: That did the trick! I guess it's time to really start learning some JS and not relying on everyone else's plugins. You the man! Thanks Tech Chaos
comment on: http://stackoverflow.com/a/29927761
score: 0
type: AnswerComment

http://stackoverflow.com/comment/48012461
comment on: http://stackoverflow.com/q/29945447
score: 0
type: Comment
type: QuestionComment
has text: I suppose inheritance goes from parents to children. If you have two functions, one in the prototype and another in an object which inherits from it, the function in the object (the child) overrides the one in the prototype. So: you are overriding the function in the prototype, but not in the object.

http://stackoverflow.com/a/53191870
type: Answer
upvote count: 1
score: 1
downvote count: 0
answers question: http://stackoverflow.com/q/29941208
has body: This error comes when you forgot to export the module which uses the Router. Your mentioned code works perfectly with some tweaks. if your app.js is main/starting point of the app. it should have const port = process.env.PORT || 3000; app.listen(port, () =&gt; console.log(`Listening on port ${port}...`)); instead of module.exports = app; (optional)Generally index.js is used for starting point of app. Rename index.js as helloworld.js and change same at require statement var routes = require('./routes/index'); to var routes = require('./routes/helloworld'); run this app using the following command node app.js

http://stackoverflow.com/q/29954094
tagged with: http-post
has comment: http://stackoverflow.com/comment/48029159
has answer: http://stackoverflow.com/a/29982411
has body: I'am new with node.js.I Need to save data from HTML page use - form (user name, password, email e.t.c)in Mongodb. I have this code: var Schema = new mongoose.Schema({ _id : String, name: String, age : Number }); var user = mongoose.model('emp', Schema); app.post('/new', function(req, res){ new user({ _id : req.body.email, name: req.body.name, age : req.body.age }).save(function(err, doc){ if(err) res.json(err); else res.send('Successfully inserted!'); }); }); Email: Name: Age: When I run server. Trying to save some data. I see message "Cannot read property 'email' of undefined" "TypeError: Cannot read property 'email' of undefined" Somebody help me please with this misunderstood. Thans a lot!
has comment: http://stackoverflow.com/comment/48037722
has comment: http://stackoverflow.com/comment/48028948
favorite count: 0
upvote count: 2
has title: Save POST data To MongoDB: Node.js
type: UnansweredQuestion
tagged with: node.js
score: 2
type: Question
tagged with: mongodb
answer count: 1
downvote count: 0
tagged with: javascript

http://stackoverflow.com/comment/48116040
has text: Sam... simply learn what is a answer worthy content vs a comment worthy content.... thats all i am going to say on this,.
comment on: http://stackoverflow.com/a/29997920
score: 1
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/48121983
type: QuestionComment
type: Comment
has text: of course - it is only a variable. But the constructor after the variable is important. You have written var data=new formData(); but it should be var data = new FormData();. If you have tried all this and still not working i have no idea anymore - sry. If no one answers you anymore you should really try the plugin i recommended you. Makes things a lot easier.
score: 0
comment on: http://stackoverflow.com/q/30001197

http://stackoverflow.com/comment/47830296
has text: interesting I tried that and upon submit it does not forward the value.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29851978

http://stackoverflow.com/q/29912198
has comment: http://stackoverflow.com/comment/47946995
type: Question
upvote count: 5
accepted answer: http://stackoverflow.com/a/29912225
downvote count: 5
tagged with: javascript
linked to: http://stackoverflow.com/q/17354864
has answer: http://stackoverflow.com/a/29912248
answer count: 4
favorite count: 0
tagged with: ruby
has body: I'm looking for a quick way to filter an array in Ruby and am wondering whether the language has a counterpart to the filter method native to the JavaScrpt array object.
possible better answer: http://stackoverflow.com/a/29912234
has comment: http://stackoverflow.com/comment/47946659
has answer: http://stackoverflow.com/a/29912234
score: 0
tagged with: ruby-on-rails
has answer: http://stackoverflow.com/a/29912225
has comment: http://stackoverflow.com/comment/47947102
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29912990
has comment: http://stackoverflow.com/comment/47946528
has title: Does Ruby have a counterpart to the JavaScript array's filter method?

http://stackoverflow.com/a/29900733
type: AcceptedAnswer
has body: Your rootProperty needs to be: rootProperty: 'data[0].list' instead of: rootProperty: 'list'
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29900426
upvote count: 2
answers question: http://stackoverflow.com/q/29900426
type: Answer
score: 2

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

http://stackoverflow.com/a/29873028
has body: You are not passing your buttons sButton or iButton into test2.php because your second and third form do not have them as input. Only inputs inside each particular form will be submitted. and your form that has the buttons has no action only the buttons call the JS function. What I suggest you do is to add hidden fields for each form that you are submitting to test2.php as follows: This way your test2.php should work.
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/29872986
type: Answer
score: 1
upvote count: 1
accepted answer of: http://stackoverflow.com/q/29872986

http://stackoverflow.com/comment/47950322
comment on: http://stackoverflow.com/a/29900282
score: 0
type: Comment
type: AnswerComment
has text: I updated my answer, added a simplified description of what happens under the hood of my websocket parser, after reading this explanation I would recommend you to take a look at the link on github that I provided with a working prototype were all kind of aspects are taken in count.

http://stackoverflow.com/comment/48067869
comment on: http://stackoverflow.com/q/29973681
type: Comment
type: QuestionComment
has text: @user3283304 ok but again I ask, are you trying to search **html** or **text**?
score: 0

http://stackoverflow.com/comment/48082741
comment on: http://stackoverflow.com/q/29979812
type: Comment
type: QuestionComment
has text: Have you looked at their example config with handling non-angular pages (I would treat the step above as if angular didn't exist)? I use this to handle a non-angular login page that does also do a redirect. Note it has to be in the onPrepare: https://github.com/angular/protractor/blob/master/spec/withLoginConf.js
score: 1

http://stackoverflow.com/q/29990583
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/18638507
has body: var x=ko.observableArray([....]); x.removeAll(); Situation is 'x' is holding the selected values from dropdowns which are dynamically generated using knockout. I want to clear all the selections made by the user. The above code is not working in my situation, so i have to 'undefine' each element in the array using a for loop - which is a very bad way(i feel). i want to know if there any better way of doing this? I also tried this: x([]); Which didn't work either. My code Looks something like this var data_Main = [ {[a,b,c] },{[d,e,f]},{[g,h,i]} ]; var selectedKoArray= ko.observableArray([]); var Lst=ko.observableArray([ {Txt: 'aaa', Val: 'a'}, {Txt: 'bbb', Val: 'b'}, {Txt: 'ccc', Val: 'c'} ]); var dataArray = ko.observableArray([Lst:Lst(), Lst:Lst1(), Lst:Lst2()]); var selectedHFilters = ko.observableArray([]); for (var i = 0; i &lt; dataArray.length - 1; i++) { if (selectedKoArray[i]) selectedKoArray[i] = undefined; } -----------------------------------------------------HTML------------------------------- &lt;div data-bind="foreach:dataArrayKO "&gt; &lt;select class="select2-offscreen filter-select" data-bind="options:Lst, optionsText: 'Txt', optionsValue: 'Val', optionsCaption: '-Select-', value:$root.selectedHFilters[$index()]"&gt;&lt;/select&gt; &lt;/div&gt;
has comment: http://stackoverflow.com/comment/48105062
upvote count: 0
answer count: 1
tagged with: jquery
favorite count: 0
type: Question
has comment: http://stackoverflow.com/comment/48105084
has comment: http://stackoverflow.com/comment/48100499
has comment: http://stackoverflow.com/comment/48100641
score: -1
has title: Knockout Js Array.removeAll() not working
tagged with: knockout.js
downvote count: 1
has comment: http://stackoverflow.com/comment/48100524
has comment: http://stackoverflow.com/comment/48104180
has comment: http://stackoverflow.com/comment/48106184
has answer: http://stackoverflow.com/a/29994500
tagged with: javascript

http://stackoverflow.com/q/29925422
possible better answer: http://stackoverflow.com/a/29925875
tagged with: web-applications
has answer: http://stackoverflow.com/a/29925875
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29925580
type: Question
answer count: 2
has body: I'd like to create a function that that submits all the formularies with a checkbox checked and hides with their respective div tags I put the following code as an example I need to reprogram the function Jquery so that it can perform the desired function. the visual result would be something like this: that's my inbox of Outlook, checked my mails and then I click in 'remove' and my emails are hidden and deleted
tagged with: javascript
tagged with: jquery
score: 0
has title: Submit and hide all labels with a containing form chekbox checked
has answer: http://stackoverflow.com/a/29925580

http://stackoverflow.com/comment/48051509
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29964497
score: 0
has text: It works but I have 3 different controller ,i can't set a specific controller name ,it should be dynamic

http://stackoverflow.com/comment/48067738
has text: In a word, no. See e.g. http://www.w3schools.com/svg/svg_grad_linear.asp or the SVG spec.
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29973399
score: 1

http://stackoverflow.com/comment/47898512
score: 0
type: AnswerComment
type: Comment
has text: Thank You very much. Certainly do it.
comment on: http://stackoverflow.com/a/29874163

http://stackoverflow.com/a/29972046
has body: You need to provide a different value for the style("fill", ...) property on each circle. This will cause each new circle to have a different color but will not change the color of existing circles (that is somewhat more complex). If you want a random selection from a prepared list of colors, you should create an array of colors (by name or hex code) and a function to return a random color. Each time you draw a circle, call the function and it will select and return a color from the array. Something like so: var colors = ["red", "green", "blue", "yellow", "orange", "purple", "gray"]; function getColor() { return colors[Math.round(Math.random() * colors.length)]; } (function() { var svg = d3.select('svg'); function drawCircle(x, y, size) { console.log('Drawing circle at', x, y, size); svg.append("circle") .style("fill", getColor()) .attr("cx", x) .attr("cy", y) .attr("r", size); } svg.on('click', function() { var coords = d3.mouse(this); console.log(coords); drawCircle(coords[0], coords[1], 5); }); })(); .plot { background-color: #000; width: 500px; height: 500px; } &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.4.11/d3.min.js"&gt;&lt;/script&gt; &lt;svg class="plot"&gt; &lt;/svg&gt; To use the colors in order, you would just keep a counter like: var colors = ["red", "green", "blue", "yellow", "orange", "purple", "gray"]; var colorState = 0; function getColor() { var color = colors[colorState]; colorState = (colorState + 1) % colors.length; // keep it from going OOB return color; }
has comment: http://stackoverflow.com/comment/48075812
score: 0
has comment: http://stackoverflow.com/comment/48075662
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29971905
accepted answer of: http://stackoverflow.com/q/29971905
type: Answer

http://stackoverflow.com/a/29974164
has body: See the handler $('button').on('click', function(e) { e.stopPropagation(); Note that the event is click, so you're stopping the click event from propagating up the chain, and that doesn't interact with the submit event at all, that still fires as the default action of a submit button is to submit the form, and the way to stop that is to prevent that default action with preventDefault In other words, stopPropagation only stops the current event being handled from propagating to parent elements, it does not stop the default behaviour of the element, that would be preventDefault !
type: Answer
answers question: http://stackoverflow.com/q/29974088
upvote count: 6
score: 6
downvote count: 0

http://stackoverflow.com/comment/48040390
comment on: http://stackoverflow.com/q/29959823
score: 0
type: Comment
type: QuestionComment
has text: Use while loop and check condition while(name=="")

http://stackoverflow.com/a/29877954
answers question: http://stackoverflow.com/q/29877016
type: Answer
accepted answer of: http://stackoverflow.com/q/29877016
upvote count: 2
score: 2
has body: It can be done, if you make sure the content following the seperator a element and then check the positions of the seperator and the next element: <?= $d['contact'] ?> | <?= $d['address'] ?> T: <?= $d['phone'] ?> | <a href="mailto:<?= $d['email'] ?>"><?= $d['email'] ?> | <a href="http://<?= $d['website'] ?>" target="_blank"><?= $d['website'] ?> $(function () { $(window).resize(function () { $(".seperator").each(function () { var t = $(this); // use visibility since it does not free the space t.css("visibility", (t.next().offset().top > t.offset().top) ? "hidden" : "visible"); }); }).resize(); }); Edit: t.next().offset() must be checked for .length, otherwise console will show error for last element Uncaught TypeError: Cannot read property 'top' of undefined (there is no .next() after the last element). So code should be something like: $(function () { $(window).resize(function () { $(".seperator").each(function () { var t = $(this); var this_offset = t.offset().top; if (t.next().length) { var next_offset = t.next().offset().top; } // use visibility since it does not free the space t.css("visibility", (next_offset > this_offset) ? "hidden" : "visible"); }); }).resize(); });
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/47946260
type: QuestionComment
has text: Oh god , thanks x) I thought Flash was installed ... It works great now , thank you : )
comment on: http://stackoverflow.com/q/29897260
score: 0
type: Comment

http://stackoverflow.com/q/30002578
score: 19
has comment: http://stackoverflow.com/comment/48123727
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/30025681
favorite count: 0
has title: Immutablejs: One liner code to convert keys of a map into array?
type: Question
has body: From the docs: Map#keys I get the keys of a Map and loop through it to transform them into an array. Is there a one line code to cleanly convert these keys into an array?
answer count: 2
tagged with: immutable.js
accepted answer: http://stackoverflow.com/a/30025681
downvote count: 1
upvote count: 20
tagged with: javascript
possible better answer: http://stackoverflow.com/a/30135237
has answer: http://stackoverflow.com/a/30135237

http://stackoverflow.com/comment/47957504
type: QuestionComment
comment on: http://stackoverflow.com/q/29918180
has text: If you only use Javascript `location.href` to redirect your page if it fails to load request, I think this will return what you want to do! :)
score: 0
type: Comment

http://stackoverflow.com/comment/48001579
comment on: http://stackoverflow.com/a/29939826
score: 0
type: AnswerComment
type: Comment
has text: its working for this html, but we are using angularjs directive. we cannot able to use event while calling the function.

http://stackoverflow.com/a/29856222
has body: Your first issue here is that your background color property you are setting has invalid syntax. background-color: "#xxxxxx;" This should not have quotes. Your second problem is CSS specificity. You may want to read up on that. Either way, this can be solved by making your rule more specific, by adding the containers, and the attributes to your rule, like [disabled], or you can take the easy way out and use the !important clause. background-color: #xxxxxx !important; JSFiddle
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/47844780
upvote count: 1
has comment: http://stackoverflow.com/comment/47838529
answers question: http://stackoverflow.com/q/29856126
type: Answer

http://stackoverflow.com/q/29887911
score: 0
has answer: http://stackoverflow.com/a/29888404
tagged with: adobe
has comment: http://stackoverflow.com/comment/47900129
has title: Ways to incorporate dynamic update in flash cc
type: AnsweredQuestion
has body: Currently i'm working on a flash game where i want a certain value to appear on the right side when the user types in a value on the left side. Where the default amount is 0 and when the person types a number, the price(on the right will update accordingly. Is it possible for this to be achieved? *The text's fields are all set to dynamic text fields Picture below,
accepted answer: http://stackoverflow.com/a/29888404
type: Question
tagged with: flash
answer count: 1
tagged with: javascript
tagged with: actionscript

http://stackoverflow.com/a/29966508
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29966285
upvote count: 2
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/48053376
accepted answer of: http://stackoverflow.com/q/29966285
has comment: http://stackoverflow.com/comment/48053291
downvote count: 0
has comment: http://stackoverflow.com/comment/48053745
has body: try this in your html ng-click="send($event, foods.cal)" controller $scope.send = function(event, i) { event.preventDefault(); // do something with 'i' $location.path('/calc'); } you could also try using $state instead of $location.path('/calc') use $state.go('tab.calc')
has comment: http://stackoverflow.com/comment/48054034

http://stackoverflow.com/q/29933544
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29933588
score: 0
accepted answer: http://stackoverflow.com/a/29933588
tagged with: global
type: AnsweredQuestion
type: Question
has body: I'm trying to call fxn function outside $(document).ready(), but I can't get it working. It returns ReferenceError: fxn is not defined.. anything I missed?
tagged with: function
answer count: 1
has title: Calling jquery function with javascript
has comment: http://stackoverflow.com/comment/47989246

http://stackoverflow.com/comment/47851763
comment on: http://stackoverflow.com/q/29862115
type: QuestionComment
has text: Could you give a bit more specific information on whats not working? Its displaying the form so thats working ;-). Also do you have any errors in your js console?
type: Comment
score: 0

http://stackoverflow.com/comment/48061599
comment on: http://stackoverflow.com/a/29970565
type: AnswerComment
score: 0
has text: Ye, the comment is just copy & pasted, not edited :p. I'll edit it out. Thanks
type: Comment

http://stackoverflow.com/comment/48110405
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29994703
type: Comment
has text: It's hard to say how common it is, but its there to be used. If you determine $rootScope is the best solution, go with it. how a 3rd party module uses its `$rootScope` doesn't concern me as long as the module does its job. The recommendation against `$rootScope` has to do with the testability and maintainability of your project.

http://stackoverflow.com/q/29949860
answer count: 1
tagged with: javascript
tagged with: http://stackoverflow.com/tag/r
score: 0
tagged with: sql
has answer: http://stackoverflow.com/a/32380607
type: UnansweredQuestion
tagged with: php
has body: I'm attempting to query a MySQL database on a webpage. Within my R script, I have 4 different "query" functions along with multiple calculations which will display statistical graphs to my webpage, all dependent on an "N" variable. I'm using PHP (using shell_exec) to call to R and send "N". I'm using the RMySQL &amp; ggplot2 libraries in R. Running my R script with just 1 basic query function (includes dbConnect(), dbGetQuery and on.exit(dbDisconnect()), then using png(), plot(), and dev.off() takes ~15 seconds to display the graph on my website. With 2 functions and 2 plots, I haven't even had the patience to wait it out to see if it works since the load time is so long. The queries themselves are rather lengthy (could probably made easier through looping), but I've tested them to work through MySQL and I'm not sure how to avoid loop errors with SQL. Could the long loading time be due to having dbConnect/dbDisconnect in each individual function? Should I only do this once in the script (i.e. create a new "connect" function and then call to the other functions from here)? Is it the fact I'm running multiple and lengthy query requests? If that's the case, would it be better if I split each "query function" into individual R scripts, then "shell_exec" each and allow the user to select which graphs to display (i.e. check boxes in HTML/PHP that allow for the execution of each script/graph desired)? Through testing, I know that my logic is there, but I might be totally missing something. I would like to speed up the process so the website user doesn't have to stare at a loading screen forever and I can actually get some tangible results. Sorry for the lengthy request, I appreciate any help you can give! If you'd like to see the webpage or any of my code to get a better idea, I can upload that and share. Thanks! EDIT: It should also be noted that I'm using a while loop (x &lt; 100) for some of the calculations; I know loops in R are typically known to be expensive process…
has comment: http://stackoverflow.com/comment/48020634
tagged with: mysql
type: Question
has title: Long load times on website when running R script

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

http://stackoverflow.com/a/29927547
has comment: http://stackoverflow.com/comment/47980678
upvote count: 2
answers question: http://stackoverflow.com/q/29927278
has comment: http://stackoverflow.com/comment/47982345
has comment: http://stackoverflow.com/comment/47983961
has comment: http://stackoverflow.com/comment/47977458
has comment: http://stackoverflow.com/comment/47983225
has comment: http://stackoverflow.com/comment/47979891
has body: First, either of those will work and with your example there's no reason not to use which ever is more comfortable for your development cycle. I would probably use map since that is what is for; to create "a new array with the results of calling a provided function on every element in this array." However, are you asking which is the absolute fastest? Then neither of those; the fastest by 2.5-3x will be a simple for-loop (see http://jsperf.com/loop-vs-map-vs-foreach for a simple comparison): var newObj = []; for (var i = 0, item; item = a[i]; i++) { var obj = {}; obj[item.name] = item.value; newObj.push(obj); }); console.log(JSON.stringify(newObj));
has comment: http://stackoverflow.com/comment/47983957
downvote count: 1
type: Answer
has comment: http://stackoverflow.com/comment/47981784
has comment: http://stackoverflow.com/comment/47977294
has comment: http://stackoverflow.com/comment/47982770
has comment: http://stackoverflow.com/comment/47977149
has comment: http://stackoverflow.com/comment/47980567
score: 1
has comment: http://stackoverflow.com/comment/47978566

http://stackoverflow.com/comment/48029660
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29954373
has text: also depending on the browser you're using, document.getElementById('Name') in your code may not work because you are referencing a 'name' attribute and using it in the ..ById method. if you want to select elements based on their 'name' attribute, use document.getElementsByName('Name');

http://stackoverflow.com/comment/48071350
score: 3
type: Comment
has text: Might as well use `var x = [1,4,9...` then
type: AnswerComment
comment on: http://stackoverflow.com/a/29975707

http://stackoverflow.com/comment/48108121
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29993327
has text: Thanks, helped a lot! I didn't even glimpse that possibility. I'm just a sympathizer of those languages, I hope to devote myself to them someday! It took me all day doing this silly page because I need to study a little of everything that I need to build it. In addition to always keeping myself avoiding the javascript ^^. I hope to learn new things around here!
type: AnswerComment

http://stackoverflow.com/comment/48121421
score: 0
has text: Those `id`s are valid in HTML5, but they're not going to be easy to use as part of a CSS selector; they will need to be escaped (assuming they're the complete `id`s, and not a suffix of some kind). Though, as noted, unless you post some code we're unable to help without making some major - and almost certainly frustratingly *wrong* - guesses at what you're doing. Seriously: show some (minimal/[MCVE](http://stackoverflow.com/help/mcve)) code to reproduce your problem.
comment on: http://stackoverflow.com/q/30000953
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47989548
score: 1
comment on: http://stackoverflow.com/a/29933563
type: AnswerComment
has text: @djfkdjfkd39939 The function is called with `callback()`, whether it is anonymous or not. The function that receives the callback does not care at all whether the function is anonymous or not. FYI, `callbackFunction = function(){alert('x')}` still creates an anonymous function, you just assigned it to a variable.
type: Comment

http://stackoverflow.com/comment/47933118
type: Comment
comment on: http://stackoverflow.com/a/29905213
score: 0
type: AnswerComment
has text: Thanks, that was the first thing that I checked. The only place I am setting value to the hidden field is in the JS method.

http://stackoverflow.com/q/29853694
upvote count: 3
has answer: http://stackoverflow.com/a/29853758
answer count: 3
tagged with: button
tagged with: eventhandler
has comment: http://stackoverflow.com/comment/47834954
has body: So I was in the presumption that this function button.onclick = exampleFunk; would give me a handler on each button when I click them, but it doesn't. When replacing it with: button.onclick = alert("bananas"); I'm getting alerts at page onload. The problem is already solved with this: button.setAttribute("onclick", "removeIssue(this)"); Out of curiousity... What's going on? edited layout of post EDIT var issues = []; window.onload = function () { //alert("venster geladen"); issuesToList() } function issuesToList(data) { /*alert( "array length is " + data.issues.length + "\n" + "total_count is " + data.total_count + "\n" + "limit is " + data.limit + "\n" + "offset is " + data.offset + "\n" + "" );*/ for (i = 0; i < data.issues.length; i++) { issue = data.issues[i]; createIssue(issue); } } function createIssue(issue){ var id = issue.id; var tracker = issue.tracker; var status = issue.status; var priority = issue.priority; var subject = issue.subject; var description = issue.description; var assignee = issue.assignee; var watchers = issue.watchers; var ticket = new Issue(id, tracker, status, priority, subject, description, assignee, watchers); issues.push(ticket); var button = document.createElement("button"); button.innerHTML = "-"; button.onclick = function (){ alert("bananas")}; //button.setAttribute("onclick", "removeIssue(this)"); var item = document.createElement("div"); item.setAttribute("id", id); item.appendChild(button); item.innerHTML += " " + subject; var container = document.getElementById("container"); container.appendChild(item); } function removeIssue(e){ var key = e.parentNode.getAttribute("id"); var count = issues.length; if(confirm("Confirm to delete")){ for(i=0; i<count; i++){ if (issues[i].id == key ){ issues.splice(i,1); var element = document.getElementById(key); element.parentNode.removeChild(element); } } } } function Issue(id, tracker, status, priority, subject, description, assignee, watchers){ this.id = id; this.tracker = tracker; this.statu…
favorite count: 0
has comment: http://stackoverflow.com/comment/47833502
type: UnansweredQuestion
has title: Javascript button.onclick not functioning like I thought
score: 3
has comment: http://stackoverflow.com/comment/47833431
tagged with: onclick
downvote count: 0
has answer: http://stackoverflow.com/a/29853882
has comment: http://stackoverflow.com/comment/47833276
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/29853947

http://stackoverflow.com/a/29869537
answers question: http://stackoverflow.com/q/29869499
has comment: http://stackoverflow.com/comment/47866632
has body: I am assuming you are loading your JS at the top of the page and before "myGrid" exists. In that case, try to use $( document ).ready() like so: $( document ).ready(function() { var dataView = new Slick.Data.DataView(); var grid = new Slick.Grid("#myGrid", dataView, columns, options); //sample data var columns = [ { id: "CodeID", name: "CodeID", field: "CodeID", width: 50 }, { id: "Name", name: "Name", field: "Name", width: 200 }, width: 100 } ]; var options = { enableColumnReorder: false, multiColumnSort: true }; // wire up model events to drive the grid dataView.onRowCountChanged.subscribe(function (e, args) { grid.updateRowCount(); grid.render(); }); dataView.onRowsChanged.subscribe(function (e, args) { grid.invalidateRows(args.rows); grid.render(); }); $.getJSON(my_url, function (data) { dataView.beginUpdate(); dataView.setItems(data); dataView.endUpdate(); }); }); JS executed within the $( document).ready() callback won't be initialized until the entire document loads.
has comment: http://stackoverflow.com/comment/47864357
score: 0
has comment: http://stackoverflow.com/comment/47865326
has comment: http://stackoverflow.com/comment/47867788
type: Answer

http://stackoverflow.com/comment/48122089
score: 0
comment on: http://stackoverflow.com/q/30001197
has text: @FabianLurz yeah I haven't payed attention for the **F** it should be upped case thank's but this didn't solved now I get the same error in second example : `'append' called on an object that does not implement interface FormData.`
type: Comment
type: QuestionComment

http://stackoverflow.com/a/60733766
answers question: http://stackoverflow.com/q/29952249
downvote count: 0
upvote count: 2
type: Answer
has body: create a function const handleLogout = () => { window.localStorage.clear(); window.location.reload(true); window.location.replace('/'); }; then call it in this way handleLogout()}>
score: 2

http://stackoverflow.com/comment/48098875
has text: you have a typo at ` ` .. the style tag is outside the tag.. And please see my answer. The ` ` tag works perfectly
score: 0
comment on: http://stackoverflow.com/q/29989647
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/48108569
comment on: http://stackoverflow.com/q/29993862
type: QuestionComment
has text: Just in case there is a SQL error, change to `echo json_encode(mysql_error());` because that should still go to your `success` handler, but it needs to be proper json or else jQuery will not be able to parse it and the `error` callback will get called.
score: 0
type: Comment

http://stackoverflow.com/a/29885971
score: 2
upvote count: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/47934543
type: Answer
has body: When comparing the password you had only one '='. This assigns a value. To compare, you need two ('=='). &lt;script&gt; alert("Welcome. Please click ok and enter your username.") &lt;/script&gt; &lt;script&gt; var userName=prompt("Please enter your username:","Username") if(userName=="person") { alert("Next, please enter your password") } else{ reload(); } &lt;/script&gt; &lt;h1&gt;&lt;script&gt; var passWord=prompt("Please enter your password:","Password") if(passWord=="person") { document.write("Welcome to headquarters, Person!") } else{ reload(); } &lt;/script&gt;&lt;/h1&gt; By the way, NEVER use this for production. Anyone can view the source and see the password in plain text.
answers question: http://stackoverflow.com/q/29885753

http://stackoverflow.com/q/29997889
downvote count: 0
has comment: http://stackoverflow.com/comment/48115271
favorite count: 0
type: UnansweredQuestion
answer count: 0
linked to: http://stackoverflow.com/q/8556933
has comment: http://stackoverflow.com/comment/78846392
tagged with: surface
type: Question
has body: Is there a way to detect when the virtual keyboard of the MS Surface is being displayed in a web page via Javascript. The virtual keyboard is covering up the active text field on a page, and I need to be able to detect this so that I can re-layout the page to work better with the remaining window area.
has title: Detect MS Surface Virtual Keyboard in Javascript
tagged with: javascript
score: 4
has comment: http://stackoverflow.com/comment/78808354
upvote count: 4
tagged with: keyboard-events
has comment: http://stackoverflow.com/comment/55129164
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/29960509
type: Question
tagged with: javascript
score: -1
answer count: 2
has answer: http://stackoverflow.com/a/29961037
has comment: http://stackoverflow.com/comment/48041586
favorite count: 0
has comment: http://stackoverflow.com/comment/48041541
has comment: http://stackoverflow.com/comment/48041621
has body: I have some &lt;div&gt; with array like id pua[0], pua[1] etc. How can I find the clicked index in the click event? Here is my code: HTML: &lt;div class="gangina" id="pua[0]"&gt;&amp;nbsp;&lt;/div&gt; &lt;div class="gangina" id="pua[1]"&gt;&amp;nbsp;&lt;/div&gt; &lt;div class="gangina" id="pua[2]"&gt;&amp;nbsp;&lt;/div&gt; JavaScript: var hezi=document.querySelector('#pua'); hezi.addEventListener ( 'click', function() { console.log(); //I want to be able to get the clicked array id of #pua } );
possible better answer: http://stackoverflow.com/a/29960619
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29960619
accepted answer: http://stackoverflow.com/a/29961037
upvote count: 2
downvote count: 3
has title: Javascript: Find clicked index with array like id

http://stackoverflow.com/comment/48051400
has text: For me it is better to have separate javascript from html(twig) . What you can do is have multiple .js files to organize better (multiple .js for bundle, for example)
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29965676
score: 0

http://stackoverflow.com/comment/48026713
comment on: http://stackoverflow.com/a/29951818
type: AnswerComment
score: 0
type: Comment
has text: no actually i want it on button click only. and my page redirects on another page after button click. and i want his dialog box and then page shud redirect. pls let me know if that's possible

http://stackoverflow.com/q/29867642
has body: i am a beginner in nodejs. I am trying to create an HTTP server that uses koa framework for handling HTTP requests. Following is the code for my server. app.use(function * (next){ var ctx = this; var resource = url.parse(ctx.request.url, true, true).pathname; switch(resource) { case '/': resource = config.app.root + '/dist/index.html'; ctx.type = mime.lookup(resource); ctx.body = fs.readFileSync(resource, 'utf-8'); ctx.response.set('Access-Control-Allow-Origin', '*'); break; case '/fudge/contact': console.log('============================'); console.log(ctx.request); // no body console.log('============================'); console.log(ctx.req); // no body console.log('============================'); console.log(ctx.request.body) // is undefined break; default: resource = config.app.root + resource; ctx.type = mime.lookup(resource); ctx.body = fs.readFileSync(resource, 'utf-8'); ctx.response.set('Access-Control-Allow-Origin', '*'); break; }}); As mentioned in the case '/fudge/contact' the ctx.request.body is undefined. But, when I check for ctx.request or ctx.req, it shows content-length as 98(or something non-zero). Following is the output that i get: ============================ { method: 'POST', url: '/fudge/contact', header: { host: 'localhost:9090', 'user-agent': 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:36.0) Gecko/20100101 Firefox/36.0', accept: 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'accept-language': 'en-US,en;q=0.5', 'accept-encoding': 'gzip, deflate', 'content-type': 'text/plain; charset=UTF-8', referer: 'http://localhost:9090/', 'content-length': '98', connection: 'keep-alive', pragma: 'no-cache', 'cache-control': 'no-cache'}} ============================ { _readableState: { objectMode: false, highWaterMark: 16384, buffer: [], length: 0, ... more lines but no body. ============================ undefined Following is the client code: I have used HttpClient library of aurelia framework. contactUs(){ this.http.createRequest('/fud…
has comment: http://stackoverflow.com/comment/47876854
tagged with: http
answer count: 1
has title: Request body is undefined for POST request in KOA
has answer: http://stackoverflow.com/a/29906069
score: 2
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29906069
downvote count: 0
tagged with: koa
tagged with: javascript
favorite count: 0
type: Question
tagged with: node.js
upvote count: 2

http://stackoverflow.com/comment/48018565
score: 0
comment on: http://stackoverflow.com/a/29948426
has text: I added fade in the class of that tag like you asked and pressed enter, but nothing happens. Gonna try to remove the aria-hidden attribute in code. I really don't understand, since this whole thing works in plenty of other views. Think it might have something to do with parent/partial views.
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/47965670
type: Comment
type: AnswerComment
has text: Well, whatever, nice answer anyway.
comment on: http://stackoverflow.com/a/29921895
score: 0

http://stackoverflow.com/comment/48117472
score: 0
comment on: http://stackoverflow.com/q/29999097
type: QuestionComment
type: Comment
has text: @Patrick Thanks, but that seems to be something completely different. Not related to my issue. My issue is that jquery overwrites css properties when duplicates are used.

http://stackoverflow.com/comment/47927433
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29902281
has text: Thanks for the comment, i just tried that, but the same problem remained.

http://stackoverflow.com/a/29957649
answers question: http://stackoverflow.com/q/29957250
score: 2
type: AcceptedAnswer
downvote count: 0
has body: The "cleanest" way I can found is: function completeMatch(regex, str) { var newPattern = "^" + regex.source + "$"; var flags = regex.toString().split('/').reverse()[0]; var newRegex = new RegExp(newPattern, flags); return newRegex.test(str); } But as you can see is pretty the same approach you are handling right now
accepted answer of: http://stackoverflow.com/q/29957250
upvote count: 2
type: Answer

http://stackoverflow.com/comment/47823521
has text: Yes, I know that this isn't really a coding question. But from experience, SO saved my ass a few times with code and I wouldn't really know another place to ask these sort of questions. Google didn't really help out, because most of the tools I found were online converters and that isn't helping at all. I need my own implementation of such sort tool and maybe people on SO could advice something? And a server side task, well .. I have a website and a web api project in VS12. The only way to communicate between both projects is via angular. The image is uploaded at client side and not the server
comment on: http://stackoverflow.com/q/29848678
type: QuestionComment
type: Comment
score: 1

http://stackoverflow.com/q/29923692
has title: Having problems with regular expression
has comment: http://stackoverflow.com/comment/47969373
answer count: 1
has comment: http://stackoverflow.com/comment/47969341
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47969047
has comment: http://stackoverflow.com/comment/47969862
has comment: http://stackoverflow.com/comment/47969314
tagged with: regex
has body: I have wrote a regular expression in Javascript in an ASP-file. var re = new RegExp("&lt;h2&gt;Dollarkurs\sAktuell&lt;\/h2&gt;&lt;\/div&gt;"+ "&lt;div[^&gt;?]+&gt;&lt;div&gt;&lt;table&gt;"+ "&lt;colgroup&gt;&lt;col[^&gt;?]+&gt;&lt;col&gt;&lt;col[^&gt;?]+&gt;&lt;\/colgroup&gt;"+ "&lt;tbody&gt;&lt;tr&gt;&lt;td[^&gt;?]+&gt;Kurs&lt;\/td&gt;"+ "&lt;td[^&gt;?]+&gt;([^\s^&lt;?]+)\s*&lt;span[^&gt;?]+&gt;[^&gt;?]+&gt;&lt;\/span&gt;"+ "&lt;span[^&gt;?]+&gt;&lt;\/span&gt;"+ "&lt;\/td&gt;&lt;\/tr&gt;&lt;tr&gt;"+ "&lt;td[^&gt;?]+&gt;Kurszeit&lt;\/td&gt;&lt;td[^&gt;?]+&gt;"+ "^(([0-1]?[0-9])|([2][0-3])):([0-5]?[0-9])(:([0-5]?[0-9]))?$\sUhr"+ "&lt;\/td&gt;&lt;\/tr&gt;&lt;tr&gt;"+ "&lt;td[^&gt;?]+&gt;Kursdatum&lt;\/td&gt;&lt;td[^&gt;?]+&gt;"+ "([0-9\.]+)&lt;\/td&gt;", "gmi"); var mres = re.exec(htmlTxt); htmlTxt is(a part of webpage www.finanzen.net/devisen/dollarkurs): HTML CODE But the Object mres is null. How to solve this problem? I need the Object mres. What I need: mres[0] is 1,0947 mres[1] is 16:00:00 mres[2] is 28.04.2015 THX a lot!
has comment: http://stackoverflow.com/comment/47969513
has answer: http://stackoverflow.com/a/29924371
type: Question
has comment: http://stackoverflow.com/comment/47969363
tagged with: javascript
has comment: http://stackoverflow.com/comment/47969350
has comment: http://stackoverflow.com/comment/47969593
linked to: http://stackoverflow.com/q/1732348
score: 0

http://stackoverflow.com/comment/47972748
type: QuestionComment
has text: You're probably getting a syntax error from ` document.getElementById('1').style.height=100%;`, because it should be the string `"100%"`, not just `100%`.
score: 1
comment on: http://stackoverflow.com/q/29925538
type: Comment

http://stackoverflow.com/comment/48018156
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29948426
type: Comment
has text: Probably. What about styles? Do you have the same styles? And what about aria-hidden attribute? Try to add "fade" class manually to class attribute.

http://stackoverflow.com/comment/47954437
comment on: http://stackoverflow.com/q/29916592
type: QuestionComment
has text: i think you need similer http://stackoverflow.com/questions/755885/how-do-i-make-jquery-wait-for-an-ajax-call-to-finish-before-it-returns
score: 0
type: Comment

http://stackoverflow.com/comment/47955427
comment on: http://stackoverflow.com/a/29917070
has text: Where do these arbitrary numbers come from?I might as well post another answer saying "between 2 and 20 seconds".
type: AnswerComment
type: Comment
score: 1

http://stackoverflow.com/q/29979787
upvote count: 5
has title: Javascript: How can I optimize this line for performance?
tagged with: javascript
has comment: http://stackoverflow.com/comment/48079172
has comment: http://stackoverflow.com/comment/48079818
has comment: http://stackoverflow.com/comment/48079165
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/48079201
has comment: http://stackoverflow.com/comment/48079240
type: UnansweredQuestion
downvote count: 2
has answer: http://stackoverflow.com/a/29979949
has body: I would like to optimize the second line in my for loop(var phase). I believe moving parts of it outside of the loop would optimize performance. What can I move outside the for loop to improve performance? for (var i = 0; i &lt; items.length; i++) { var phase = Math.sin((document.body.scrollTop / 1250) + (i % 5)); //var phase = 0.31456656061611776 + (i % 5); items[i].style.left = items[i].basicLeft + 100 * phase + 'px'; }
score: 3
tagged with: performance
type: Question
tagged with: for-loop
has comment: http://stackoverflow.com/comment/48079543
has comment: http://stackoverflow.com/comment/48079199

http://stackoverflow.com/a/30288932
has body: Previous replies are completely correct, there's a mongoose loader that is defined within grunt and passed into the 'grunt test' task. Take a look at gruntfile.js:grunt.registerTask('test', ['env:test', 'mongoose', 'mochaTest', 'karma:unit']); I've looked around for nice solutions to this, and there should be a '--grep' switch to use with Mocha, but getting it passed in through grunt is beyond my current skillset - suggestions welcome! I'm sure there's a really great way to do this, but for now I've just restricted the test file configuration list when wanting to work with just one test. I've modified 'config\assets\test.js' to point to just one file. It's not pretty, and I'll probably get burned for suggesting it, but it works for me right now.
downvote count: 0
answers question: http://stackoverflow.com/q/29924608
type: Answer
score: 1
upvote count: 1

jquery
tags question: http://stackoverflow.com/q/29943061
tags question: http://stackoverflow.com/q/29873787
tags question: http://stackoverflow.com/q/29913207
tags question: http://stackoverflow.com/q/29899263
tags question: http://stackoverflow.com/q/29944650
tags question: http://stackoverflow.com/q/29871391
tags question: http://stackoverflow.com/q/29879945
tags question: http://stackoverflow.com/q/29892267
tags question: http://stackoverflow.com/q/29910802
tags question: http://stackoverflow.com/q/29970022
tags question: http://stackoverflow.com/q/29867315
tags question: http://stackoverflow.com/q/29914631
tags question: http://stackoverflow.com/q/29962702
tags question: http://stackoverflow.com/q/29944387
tags question: http://stackoverflow.com/q/29921685
tags question: http://stackoverflow.com/q/29887677
tags question: http://stackoverflow.com/q/29993862
tags question: http://stackoverflow.com/q/29993974
tags question: http://stackoverflow.com/q/29939406
tags question: http://stackoverflow.com/q/29944160
tags question: http://stackoverflow.com/q/29947072
tags question: http://stackoverflow.com/q/30000357
tags question: http://stackoverflow.com/q/29957763
tags question: http://stackoverflow.com/q/29933532
tags question: http://stackoverflow.com/q/29883031
tags question: http://stackoverflow.com/q/29959598
tags question: http://stackoverflow.com/q/29925337
tags question: http://stackoverflow.com/q/29906824
tags question: http://stackoverflow.com/q/29891587
tags question: http://stackoverflow.com/q/29898025
tags question: http://stackoverflow.com/q/29854188
tags question: http://stackoverflow.com/q/29875824
tags question: http://stackoverflow.com/q/29973318
tags question: http://stackoverflow.com/q/29974046
tags question: http://stackoverflow.com/q/29999956
tags question: http://stackoverflow.com/q/29911970
tags question: http://stackoverflow.com/q/29886437
tags question: http://stackoverflow.com/q/29961409
tags question: http://stackoverflow.com/q/29977467
tags question: http://stackoverflow.com/q/29875302
tags question: http://stackoverflow.com/q/29892270
tags question: http://stackoverflow.com/q/29912015
tags question: http://stackoverflow.com/q/29927116
tags question: http://stackoverflow.com/q/29855374
tags question: http://stackoverflow.com/q/29995748
tags question: http://stackoverflow.com/q/29898347
tags question: http://stackoverflow.com/q/29877016
tags question: http://stackoverflow.com/q/29869279
tags question: http://stackoverflow.com/q/29851331
tags question: http://stackoverflow.com/q/29948832
tags question: http://stackoverflow.com/q/29942558
tags question: http://stackoverflow.com/q/29850717
tags question: http://stackoverflow.com/q/29965937
tags question: http://stackoverflow.com/q/29957791
tags question: http://stackoverflow.com/q/29860438
tags question: http://stackoverflow.com/q/29909555
tags question: http://stackoverflow.com/q/29938945
tags question: http://stackoverflow.com/q/29950084
tags question: http://stackoverflow.com/q/29955969
tags question: http://stackoverflow.com/q/29964773
tags question: http://stackoverflow.com/q/29846639
tags question: http://stackoverflow.com/q/29846632
tags question: http://stackoverflow.com/q/29857066
tags question: http://stackoverflow.com/q/29896599
tags question: http://stackoverflow.com/q/29956762
tags question: http://stackoverflow.com/q/29900554
tags question: http://stackoverflow.com/q/29940202
tags question: http://stackoverflow.com/q/29877690
tags question: http://stackoverflow.com/q/29861960
tags question: http://stackoverflow.com/q/29916227
tags question: http://stackoverflow.com/q/29916417
tags question: http://stackoverflow.com/q/29994850
tags question: http://stackoverflow.com/q/29971322
tags question: http://stackoverflow.com/q/29860410
tags question: http://stackoverflow.com/q/29951533
tags question: http://stackoverflow.com/q/29919558
tags question: http://stackoverflow.com/q/29933292
tags question: http://stackoverflow.com/q/29978793
tags question: http://stackoverflow.com/q/29851231
tags question: http://stackoverflow.com/q/29918372

http://stackoverflow.com/a/65270376
has body: I tried all CSS solutions to no avail. Either iOS still bounced certain divs when it reached the top/bottom or scrolling itself became really unreliable and buggy when working with fixed positioning. And so I came up with a JavaScript solution which is really quite simple that seems to have solved it for me: function onTouchStart(e) { // Save position of touch console.log("touchstart"); const touch = e.touches[0] || e.changedTouches[0]; window.lastY = touch.pageY; } function onTouchMove(e) { console.log("touchmove"); // Check user isn't scrolling past content. If so, cancel move to prevent ios bouncing const touch = e.touches[0] || e.changedTouches[0]; y = touch.pageY; if (y < window.lastY && e.srcElement.scrollTop == (e.srcElement.scrollHeight - e.srcElement.clientHeight)) { console.log("user is trying to scroll down without anywhere to scroll to. Canceling propagation."); e.preventDefault(); } else if (y > window.lastY && e.srcElement.scrollTop == 0) { console.log("user is trying to scroll up without anywhere to scroll to. Canceling propagation."); e.preventDefault(); } }; document.addEventListener("touchstart", onTouchStart, { passive: false }); document.addEventListener("touchmove", onTouchMove, { passive: false });
score: 0
type: Answer
answers question: http://stackoverflow.com/q/29894997

http://stackoverflow.com/comment/48071054
has text: By the looks of that error, why don't you try and put the calling of the JQuery script in the header and Have it load and then call, becuase at the moment in the body you referenceing JQuery and it hasn't been loaded yet
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29975529
score: 1

http://stackoverflow.com/q/29877268
type: Question
tagged with: function
tagged with: javascript
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/29877296
type: UnansweredQuestion
has title: JavaScript function to open new window, irrespective of PHP file?
tagged with: php
has body: I have a small issue that's bugging me. I have a BUTTON, which, when clicked, opens a "New Window", based on a JavaScript Function : **&lt;input type="button" id="button1" value="PLEASE BEGIN" onclick="OpenWindow();"&gt;** And, here is the JS function : &lt;script type="text/javascript"&gt; function OpenWindow() { window.open ('/MyFolder/newfile.php', 'newwindow', config='height=670, width=1400, toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, directories=no, status=no'); } &lt;/script&gt; So, when the BUTTON is clicked, it calls the function, which opens the file "newfile.php" in a new window, with those parameters (height, width, etc, etc) This works perfectly.............as long as I need to open the SAME file each time that button is clicked. My problem is : the files differ. I want to open a "different" file each time that button is clicked. In other words : how can I structure the JS function, so that it works the same way, IRRESPECTIVE of which file needs to be opened ??? (My program is designed to FETCH the required file directly from the database itself. This is why my current JavaScript function is useless. It opens the same file each time) How can I fix this? Thanks UPDATE Perhaps, I did not clarify my issue properly in my initial post. My mistake. Here's what I am trying to do : (a) I'm creating a quiz program; (b) the questions are stored in the database, in a table called questions, which has only 3 columns : ID (which is integer, and auto-incremential); question (the question itself) question_php (which contains the name of the PHP FILE which holds the question) The reason I am using a database is : when a user answers each question, (whether correctly or wrongly), he proceeds to the NEXT question. I designed my PHP script to store the ID of the LAST question answered. So, the next time, the user logs in, he begins the quiz from the NEXT question in the database. This way, he never sees the same question more than once. My program is …

http://stackoverflow.com/comment/47894063
score: 0
type: QuestionComment
type: Comment
has text: @Patrick Evans but it doesn't work using jquery-mobile
comment on: http://stackoverflow.com/q/29884873

http://stackoverflow.com/comment/47906585
comment on: http://stackoverflow.com/q/29891539
has text: did you check the value of `$('#email').val()` - the regex have nothing to do with jQuery version so the problem is somewhere else
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/comment/48044243
has text: You will have a just above this input . Try finding it.
type: AnswerComment
comment on: http://stackoverflow.com/a/29961132
score: 0
type: Comment

http://stackoverflow.com/q/29904825
linked to: http://stackoverflow.com/q/23710329
type: AnsweredQuestion
downvote count: 0
linked to: http://stackoverflow.com/q/27511346
type: Question
score: 5
has answer: http://stackoverflow.com/a/29904862
has title: How to convert Dart to JavaScript?
accepted answer: http://stackoverflow.com/a/29904862
has body: The Dart app runs fine in Dartium, but I would like to convert it to JS. C:\dart-sdk\bin\dart2js --out=test.js main.dart generates JS from: import 'dart:html'; void main() { querySelector('#myid').text = 'Wake up, sleepy head!'; } Then I add it to the : hello But when I run it in Firefox, it doesn't work. It shows only "Hello" on the page. What am I doing wrong?
answer count: 1
tagged with: javascript
tagged with: dart
favorite count: 0
upvote count: 5

http://stackoverflow.com/a/30020562
answers question: http://stackoverflow.com/q/29877103
has body: Try changing this part of your code '&lt;a ui-sref=&amp;quot;Id({ Id: #: Id # }) &amp;quot;&gt;' To '&lt;a ui-sref="Id({ #: Id # })"&gt;'
score: 4
upvote count: 4
downvote count: 0
type: Answer

http://stackoverflow.com/a/29882733
has body: You could use the wp_customize query arg and is_user_logged_in function to wrap your javascript in an if statement like this: &lt;?php if ( ! ( isset( $_GET[ 'wp_customize' ] ) &amp;&amp; is_user_logged_in() ) ): ?&gt; &lt;script type="text/javascript"&gt; if (top.location != self.location) { top.location = self.location.href; } &lt;/script&gt; &lt;?php endif; ?&gt;
score: 1
answers question: http://stackoverflow.com/q/29880652
downvote count: 0
type: Answer
upvote count: 1

http://stackoverflow.com/comment/47919839
comment on: http://stackoverflow.com/q/29897952
score: 0
type: Comment
type: QuestionComment
has text: When you perform the post, do you encounter an error? What is returned?

http://stackoverflow.com/q/29883525
tagged with: node.js
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/61262054
linked to: http://stackoverflow.com/q/22539815
has body: Which part of syntax provides the information that this function should run in other thread and be non-blocking? Let's consider simple asynchronous I/O in node.js var fs = require('fs'); var path = process.argv[2]; fs.readFile(path, 'utf8', function(err,data) { var lines = data.split('\n'); console.log(lines.length-1); }); What exactly makes the trick that it happens in background? Could anyone explain it precisely or paste a link to some good resource? Everywhere I looked there is plenty of info about what callback is, but nobody explains why it actually works like that. This is not the specific question about node.js, it's about general concept of callback in each programming language. EDIT: Probably the example I provided is not best here. So let's do not consider this node.js code snippet. I'm asking generally - what makes the trick that program keeps executing when encounter callback function. What is in syntax that makes callback concept a non-blocking one? Thanks in advance!
has title: I know that callback function runs asynchronously, but why?
has comment: http://stackoverflow.com/comment/47892228
linked to: http://stackoverflow.com/q/19083357
linked to: http://stackoverflow.com/q/18333432
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/47891522
accepted answer: http://stackoverflow.com/a/29885509
has comment: http://stackoverflow.com/comment/47891777
has comment: http://stackoverflow.com/comment/47891343
has comment: http://stackoverflow.com/comment/47892124
tagged with: javascript
score: 15
has comment: http://stackoverflow.com/comment/47892083
linked to: http://stackoverflow.com/q/28961698
has comment: http://stackoverflow.com/comment/47892042
has answer: http://stackoverflow.com/a/29883563
answer count: 3
tagged with: asynchronous
tagged with: callback
possible better answer: http://stackoverflow.com/a/29883563
linked to: http://stackoverflow.com/q/56739934
favorite count: 0
has comment: http://stackoverflow.com/comment/47892009
has comment: http://stackoverflow.com/comment/47891985
has comment: http://stackoverflow.com/comment/47892107
has comment: http://stackoverflow.com/comment/47892075
has answer: http://stackoverflow.com/a/29883604
has comment: http://stackoverflow.com/comment/47891259
has answer: http://stackoverflow.com/a/29885509
has comment: http://stackoverflow.com/comment/47891265
upvote count: 16

http://stackoverflow.com/q/29999407
downvote count: 0
tagged with: dom-events
favorite count: 0
tagged with: angularjs
has comment: http://stackoverflow.com/comment/48118840
has body: I'm trying to send an event when an item gets selected, from directive to controller using $emit. I've two update functions for organizations and another for people. My directive should specify which event should emit. Here is my update functions: // For organization $scope.updateOrgs = function(selectedVal) { } // For people $scope.updatepeople = function(selectedVal, type) { } When it is people my directive should raise an emit event for updatepeople (), if it was org it should raise updateorg(). My directive looks like: .directive('search', function ($timeout) { return { restrict: 'AEC', scope: { model: '=', searchobj: '@', }, link: function (scope, elem, attrs, index) { scope.handleSelection = function (selectedItem) { scope.model = selectedItem; scope.searchModel=&quot;&quot;; scope.current = 0; scope.selected = true; $timeout(function () { scope.onSelectupdate(); }, 200); }; scope.Delete = function (index) { scope.selectedIndex = index; scope.delete({ index: index }); }; scope.Search = function (searchitem,event,searchobj) { // alert('item entered'+name) scope.searching = searchitem; scope.searchobject = searchobj; scope.onSearch({ searchitem: searchitem , searchobj:searchobj}); }; scope.current = 0; scope.selected = true; scope.isCurrent = function (index) { return scope.current == index; }; scope.setCurrent = function (index) { scope.current = index; }; }, controller: ['$scope','$element','$rootScope','SearchOrg', function($scope,$element,$rootScope,SearchOrg) { $scope.searchItem = function(filter,searchobj){ //alert('search'+searchobj); SearchOrg().fetch({'filter': filter, 'searchType': searchobj}).$promise.then(function(value){ $scope.searchData = value.data; console.info($scope.searchData); }, function(err) { }); } }], templateUrl: TAPPLENT_CONFIG.HTML_ENDPOINT[0] + 'home/genericsearch.html' } });; HTML snippet &lt;search searchobj=“tei-org” selectedItems=“arrayofIds” search-id=”someidtoIdentify”/&gt; How can I do this both functions are in different cont…
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/48120442
linked to: http://stackoverflow.com/q/14502006
type: Question
has answer: http://stackoverflow.com/a/30001043
upvote count: 12
has title: Send an event using $emit from directive to controller
tagged with: javascript
accepted answer: http://stackoverflow.com/a/30001043
score: 12
answer count: 1

http://stackoverflow.com/comment/47817279
has text: I thought i was comparing them through the use of a.catname == b.catname ?
comment on: http://stackoverflow.com/q/29845715
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/48471157
comment on: http://stackoverflow.com/a/30070207
has text: Ah, nice suggestion. Hadn't thought of that.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/48014898
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29946818
type: Comment
has text: The filter is already in the link function. This doesn't work either, it doesn't apply it on load, only on blur.

http://stackoverflow.com/comment/48243952
comment on: http://stackoverflow.com/a/29904400
score: 0
type: AnswerComment
has text: Note that the actual problem was not emptying the top and bottom arrays when they were lower than or equal to the drop amount. But the other information was also insightful.
type: Comment

http://stackoverflow.com/comment/48060742
has text: There are some answers below to do what you asked... but I may pose What is the real problem? http://meta.stackexchange.com/a/66378/278651
score: 5
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29970467

http://stackoverflow.com/comment/48083889
type: QuestionComment
comment on: http://stackoverflow.com/q/29982261
has text: You have not included jQuery in JSfiddle. Also there is no CSS applied initially.
score: 1
type: Comment

http://stackoverflow.com/q/29970234
score: 0
has title: how to center my google map script with divs?
has answer: http://stackoverflow.com/a/29970282
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/48060172
type: Question
tagged with: google-maps
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29970282
has body: so far the text is centered the google maps page hugs the left and then the text underneath it remains centered, i just want the map to be centered. Sorry hours Below text Style: #row1 { text-align: center; } Google Map JavaScript:
tagged with: google-maps-api-3
tagged with: http://stackoverflow.com/tag/html
answer count: 1
tagged with: css

http://stackoverflow.com/q/29884009
tagged with: jquery
tagged with: ajax
upvote count: 1
tagged with: form-data
favorite count: 0
has comment: http://stackoverflow.com/comment/47891999
type: UnansweredQuestion
tagged with: php
has title: How to upload image using ajax request
has body: I'm search in the internet for a solution. I find some of them but they didn't work for me. Basically I have an input form on a laravel project where I want to upload an image with ajax request. On the Get request instead of sending the image is sending the following parameter value [object%20FormData] I know that I'm doing something wrong but I don't know what it is. Can anyone help me? Here is my Html code Upload! And here is my ajax code var image = $('#image')[0].files[0]; formdata = new FormData(); formdata.append( 'image', image ); formdata.append( 'action', 'image' ); $.ajax({ type: "GET", url: '{{{ URL::route('upload') }}}', data: formdata, dataType: 'json', contentType: false, processData: false, success: function (data) { console.log(data); }, error: function (data) { var errors = data.responseJSON; $.each(errors, function (key, data) { $.each(data, function (index, data) { $(".upload_error").text(data); }) }) } }); Can anyone help me to find what I'm doing wrong? Thank you SOLUTION: as the comment says, I changed the GET request of ajax to POST and it work. Thank you for your help
answer count: 0
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/47891993
type: Question
has comment: http://stackoverflow.com/comment/47892519
tagged with: javascript

modal-dialog
tags question: http://stackoverflow.com/q/29898578
tag name: modal-dialog
tags question: http://stackoverflow.com/q/29897300
tags question: http://stackoverflow.com/q/29909199
tags question: http://stackoverflow.com/q/29954669
type: Tag
tags question: http://stackoverflow.com/q/29994297
tags question: http://stackoverflow.com/q/29937707
tags question: http://stackoverflow.com/q/29872758
tags question: http://stackoverflow.com/q/29993655
tags question: http://stackoverflow.com/q/29993454
tags question: http://stackoverflow.com/q/29946558
tags question: http://stackoverflow.com/q/29871495
tags question: http://stackoverflow.com/q/29930154
tags question: http://stackoverflow.com/q/29996238
tags question: http://stackoverflow.com/q/29910014

http://stackoverflow.com/q/29855984
has answer: http://stackoverflow.com/a/29858637
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/47841484
favorite count: 0
has comment: http://stackoverflow.com/comment/47838206
has title: How to select all from multiple kaminari pages
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/85506536
accepted answer: http://stackoverflow.com/a/29858637
upvote count: 3
has comment: http://stackoverflow.com/comment/47842817
tagged with: kaminari
has body: I am using Kaminari for paging in my rails application. I need to select all for items on the current page or every page. The current page is rather simple bundle how can I select all the items on other pages. file_items_controller.rb def index account = Account.includes(:credentials).find params[:account_id] @page = page_param.to_i @tab = 'Files' @sort_by = sort_by @credential = if params[:credential_id].blank? account.credentials.first || nil else account.credentials.find(params[:credential_id]) end return unless @credential file_items = FileItem.file_item_list(@credential.root_folder, sort_by) @total_count = file_items.count @max_per_page = file_items.count &lt;= 15 ? 'all' : max_per_page.to_i file_items_scope = Kaminari.paginate_array(file_items.select(&amp;:file?), total_count: file_items.count).page(page_param) @file_items = if max_per_page == 'all' file_items_scope.per(file_items.count) || [] else file_items_scope.per(max_per_page) || [] end end file_items.js $('a.select-all-current').click(function(e){ e.preventDefault(); $('input:not(:checked)').each(function(_, element){ $(element).click(); }); }); $('a.select-all-files').click(function(e){ e.preventDefault(); $('a.select-all-current').click(); }); index.html.slim ... .row ul.file-list - @file_items.each do |file_item| li.row.file-item .col-lg-9 p.label = "#{file_item[:path]}/#{file_item[:name]}" p.file-size = "#{number_to_human_size(file_item[:size]).downcase} | " .col-lg-1.pull-right = check_box_tag "file_id_#{file_item[:id]}", file_item[:id], false, class: 'file-box' ...
tagged with: ruby-on-rails
linked to: http://stackoverflow.com/q/11818158
type: Question
score: 3
tagged with: pagination
tagged with: javascript

http://stackoverflow.com/comment/48021115
comment on: http://stackoverflow.com/q/29950084
has text: @mattias - You might want to go over your code again... The statement does not make sense... Perhaps you are missing a call to `.attr('property')` before the replace.
type: Comment
type: QuestionComment
score: 2

http://stackoverflow.com/q/29994961
favorite count: 0
tagged with: parse-platform
answer count: 0
upvote count: 2
type: UnansweredQuestion
score: 2
has comment: http://stackoverflow.com/comment/48110714
type: Question
has body: Below is my code to signup for a new user var Account = Parse.Object.extend('Account'); account = new Account(); account.set("serviceTax", TAX.SERVICE_TAX); account.set("educationCess", TAX.EDUCATION_CESS); account.set("name", accountName); var user = new Parse.User(); user.set(USER.USER_NAME, username); user.set(USER.PASSWORD, password); user.set(USER.EMAIL, username); user.set(USER.FIRST_NAME, firstName); user.set(USER.LAST_NAME, lastName); user.set(USER.PHONE_NUMBER, phoneNumber); user.set(USER.COMPANY_NAME, companyName); user.set(USER.ACCOUNT_NAME, accountName); user.set(USER.ACCOUNT, account); user.signUp(null, { success : function(user) { $('.gifload').toggle(); bootstrap_alert.info("alert_placeholder", "User created successfully"); }, error : function(user, error) { $('.gifload').toggle(); bootstrap_alert.error("alert_placeholder", error.message); } }); I am getting the following error in this signup "user objects cannot allow writes from other users" Now as far i can tell, we are not updating any user, just creating one with an account object. Why am i getting this error? Any help on this will be deeply appreciated.
downvote count: 0
tagged with: javascript
has title: parse.com user.signup fails with error
has comment: http://stackoverflow.com/comment/48129556

http://stackoverflow.com/q/29988588
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
has answer: http://stackoverflow.com/a/29988616
type: UnansweredQuestion
score: 1
type: Question
answer count: 2
has title: Jquery ignore items with data attribute
has answer: http://stackoverflow.com/a/29988630
downvote count: 0
tagged with: javascript
tagged with: jquery
has body: I want to be able to select all elements with the class 'tag', once them items have been selected i want to remove the items from that list that have the attribute 'data-tag-cat'. var tags = $('.tag'); console.log(tags);

angular-ui-router
tags question: http://stackoverflow.com/q/29947227
tags question: http://stackoverflow.com/q/30002000
tags question: http://stackoverflow.com/q/29864891
tags question: http://stackoverflow.com/q/29936224
tags question: http://stackoverflow.com/q/29857488
tags question: http://stackoverflow.com/q/29933474
tags question: http://stackoverflow.com/q/29877103
tags question: http://stackoverflow.com/q/29919169
tag name: angular-ui-router
tags question: http://stackoverflow.com/q/29983595
tags question: http://stackoverflow.com/q/29915124
tags question: http://stackoverflow.com/q/29904661
tags question: http://stackoverflow.com/q/29892353
tags question: http://stackoverflow.com/q/29966017
tags question: http://stackoverflow.com/q/29905690
tags question: http://stackoverflow.com/q/29893067
tags question: http://stackoverflow.com/q/29978696
tags question: http://stackoverflow.com/q/29870081
tags question: http://stackoverflow.com/q/29855486
type: Tag

http://stackoverflow.com/a/29921541
has comment: http://stackoverflow.com/comment/48013743
has comment: http://stackoverflow.com/comment/48006057
has comment: http://stackoverflow.com/comment/48013798
answers question: http://stackoverflow.com/q/29921350
has comment: http://stackoverflow.com/comment/48005877
score: 0
accepted answer of: http://stackoverflow.com/q/29921350
type: AcceptedAnswer
has body: I found this plugin. It may helps you. And here there is a list of plugin that do flip effect: http://www.sitepoint.com/10-jquery-flip-effect-plugins/ Edited This may helps you! I only toggle the class .flip in .front and .back . (http://jsfiddle.net/0x13mL26/3/) Sorry for the misunderstanding! :)
type: Answer

http://stackoverflow.com/a/29882959
answers question: http://stackoverflow.com/q/29882895
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29882895
upvote count: 8
type: Answer
score: 8
has comment: http://stackoverflow.com/comment/47889850
has body: Can you use the id attribute inside the template tag. Yes, however: The template can be reused, but id's can't be. Correct. So using the same template multiple times (which is why they were invented in the first place) will result in invalid HTML, theoretically. Yes. Don't do that. Make sure the IDs are unique before you add them to the main DOM. You could edit them in the template's DOM before you append it to the main DOM.

http://stackoverflow.com/comment/47829922
has text: best inject them then...
comment on: http://stackoverflow.com/q/29851636
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/q/29887272
has comment: http://stackoverflow.com/comment/47898900
has comment: http://stackoverflow.com/comment/47898892
has comment: http://stackoverflow.com/comment/47898496
upvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/47898782
tagged with: oop
has body: I am creating a js library that handle item operations from collection object directly as follow. I want to allow to add dynamic user defined object function for each item and make these function available through collection object directly with index (please see example implementation). var item = function (obj) { this.foo = function () { alert("foo" + this.name); } for (var i in obj) { this[i] = obj[i]; //dynamic fields (overridable) } } var collection = function (list) { var self=this; this.items = []; if (list &amp;&amp; list.length &gt; 0) { for (var i in list) { var t = new item(list[i]); // create new item for (var j in t) { if (typeof (t[j]) === "function") { this[j]=function(index,arg1,arg2,arg3){ self.items[index][j](arg1,arg2,arg3); //not working (unreliable) console.log(j) //undefined // problem is here j cannot be visible from function handler. //I need to call dynamic j function within handler } } this.items.push(t); //push each item into collection } } } } var obj=new collection([ { id:1,name:"apple", bar:function(arg){ alert(arg+" "+this.name); } } ]); obj.foo(0); //equivalent to obj.items[0].foo(); obj.bar(0,"parameter"); //equivalent to obj.items[0].bar("parameter"); As described in comments in above code snippet, I can't call item's function from collection function dynamically. How can I achieve this purpose. Please help me.
has answer: http://stackoverflow.com/a/29887927
has title: How to get function name within dynamic object function in native javascript
type: AnsweredQuestion
tagged with: function
downvote count: 0
tagged with: javascript
score: 1
type: Question
has comment: http://stackoverflow.com/comment/47899586
accepted answer: http://stackoverflow.com/a/29887927
favorite count: 0

http://stackoverflow.com/a/29948773
score: 40
has comment: http://stackoverflow.com/comment/48020078
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/48019229
has comment: http://stackoverflow.com/comment/54064678
answers question: http://stackoverflow.com/q/29948680
has comment: http://stackoverflow.com/comment/53257248
type: Answer
has body: You can use angular.extend(dest, src1, src2,...); In your case it would be : angular.extend($scope.actions.data, data); See documentation here : https://docs.angularjs.org/api/ng/function/angular.extend Otherwise, if you only get new values from the server, you can do the following for (var i=0; i&lt;data.length; i++){ $scope.actions.data.push(data[i]); }
has comment: http://stackoverflow.com/comment/59469314
upvote count: 41
accepted answer of: http://stackoverflow.com/q/29948680
downvote count: 1
has comment: http://stackoverflow.com/comment/48019774

http://stackoverflow.com/comment/47838409
type: AnswerComment
has text: You could also replace if (z == null || z == "") for if (z) and so on. Works the same way.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29855148

http://stackoverflow.com/comment/48091562
comment on: http://stackoverflow.com/a/29982655
type: Comment
has text: I just noticed you are also using v1.5 of the dropdownmenu js, try v2.0
score: 0
type: AnswerComment

http://stackoverflow.com/comment/47866261
has text: @jimutt: Yes, the script will be loaded before the parsing continues. Calling the function later won't make the function exist if the loading fails in the first place, which is the only reason why it wouldn't exist.
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29870615
score: 0

http://stackoverflow.com/comment/47940728
has text: I tried using click, it doesn't make a difference. Also I'm using a $70 gaming mouse, so it isn't the mouse lol, and even if it was you shouldn't expect your users to have good mice either.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29909137

http://stackoverflow.com/a/29990873
has body: Instead of dynamically creating the block that has another id attribute, you should use class='closeOverlay'. Then instead of getElementById('closeOverlay') you can use getElementsByClassName('closeOverlay'), and add your function to each of element in that return array.
score: 0
answers question: http://stackoverflow.com/q/29990660
type: Answer

http://stackoverflow.com/q/29851368
has answer: http://stackoverflow.com/a/29851592
type: UnansweredQuestion
has body: I am trying to extract the information of this XML file and present some of them in &lt;p&gt; tag in HTML file. And my code is here: Open (this is just the opening code to prepare for my three ways): 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","books.xml", false); xmlhttp.send(); xmlDoc = xmlhttp.responseXML; star = xmlDoc.documentElement.childNodes; y = xmlDoc.getElementsByTagName('book'); var container = document.getElementById('page-wrapper'); var v = parseInt(document.getElementById('input').value); var autho = y[v - 1].getElementsByTagName('author'); Option 1: var text= []; for (var i= 0, n= y[v-1].childNodes.length; i&lt;n; i++) { var child= element.childNodes[i]; if (child.nodeType===1 &amp;&amp; child.tagName.toLowerCase()=='author') text.push(getTextContentExceptScript(child)); else if (child.nodeType===3) text.push(child.data); } return text.join(''); var pa = document.createElement("p"); var pt = document.createTextNode(text); pa.appendChild(pt); container.appendChild(pa); Option 2: var a = 0; while (a &lt; autho.length) { var t = document.createTextNode(autho[a].textContent); var d = document.createElement("p"); var e = document.createTextNode("Author: " + t); d.appendChild(e); container.appendChild(d); a = a + 1; } Option 3: for(var k = 0; k &lt; autho.length; k++) { var t = document.createTextNode(autho[k].childNodes[0].nodeValue); //p_text3 = p_text3 + t + ', '; var d = document.createElement("p"); var e = document.createTextNode("Author: " + t); d.appendChild(e); container.appendChild(d); } With those three ways above: I get nothing with option1, the same result with option two that is: Author: [Object Text], [Object Text], ... Please help me, Thanks.
has title: Javascript: How to get text of child element and present them in tag in HTML file
type: Question
tagged with: javascript
score: 0
answer count: 1

http://stackoverflow.com/q/29936376
linked to: http://stackoverflow.com/q/29918257
tagged with: php
has comment: http://stackoverflow.com/comment/47994869
has comment: http://stackoverflow.com/comment/47994676
type: Question
downvote count: 8
has body: I want to show a map based on state, city, area, latitude and longitude are fetched from database and shown in merker notification.
has comment: http://stackoverflow.com/comment/124472482
has comment: http://stackoverflow.com/comment/47994692
answer count: 1
has answer: http://stackoverflow.com/a/29936732
tagged with: javascript
favorite count: 0
upvote count: 0
has comment: http://stackoverflow.com/comment/47994538
has title: How to retrieve latitude and longitude and show in map with marker notification
type: UnansweredQuestion
score: -8

http://stackoverflow.com/q/29870456
has answer: http://stackoverflow.com/a/29870560
tagged with: onclick
score: 0
answer count: 3
has comment: http://stackoverflow.com/comment/47865914
linked to: http://stackoverflow.com/q/10126395
has comment: http://stackoverflow.com/comment/47865864
accepted answer: http://stackoverflow.com/a/29870560
type: AnsweredQuestion
tagged with: javascript
has body: I have the following code which creates new spans with some input fields: function add_course() { var newspan = document.createElement('span'); newspan.innerHTML = 'Degree: &lt;input type="text" name = "degree[]"&gt; Course: &lt;input type="text" name = "course[]"&gt;'; document.getElementById('degree_course').appendChild(newspan); } function add_skill() { var newspan = document.createElement('span'); newspan.innerHTML = 'Skill: &lt;input type="text" name = "skill[]"&gt; Level: &lt;input type="number"min ="1" max = "5" name = "level[]"&gt;'; document.getElementById('skills').appendChild(newspan); } I would like those spans to have a different id each. For example, in the case of add_course, if 3 spans where generated, i'd like them to have an id like: course_1, course_2, course_3 (skill_1, skill_2, skill_3 in the skills case). I know I'll have to put and id="course_VAR" in the innerHTML and create a var that i'll inscrease everytime. (There won't be a for cicle, because the function will trigger when I hit a specific button). &lt;input class="buttons" type="button" id="more_fields" onclick="add_course();" value="Add Course" /&gt; My question is, how can I get the var in the id and make it increase without a for cycle?
type: Question
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/29870506
has title: Generate spans with ids using JavaScript
has answer: http://stackoverflow.com/a/29870609
has answer: http://stackoverflow.com/a/29870506

http://stackoverflow.com/comment/47999384
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29935736
has text: I have no idea why this is closed as opinion based, it's clearly not opinion based - there is an _obvious objective_ answer.

http://stackoverflow.com/q/29863044
has body: How would you go about accessing a DOM element in Aurelia? This is a broad and general question, but I have a feeling there are one or two preferred ways to do this. I have two current cases in Aurelia now: In the template I have a form. I want to access the form element in the view-model, on VM canDeactivate(), to interrupt a user navigating away from a half filled out form. So the scope in which I'm trying to access the element can be considered local. In another view-model I want to hide navigation on VM activate(). Navigation resides in another view-model/template pair so the scope may be considered global.
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29869834
has answer: http://stackoverflow.com/a/45673572
accepted answer: http://stackoverflow.com/a/29866395
upvote count: 29
possible better answer: http://stackoverflow.com/a/29869834
type: AnsweredQuestion
tagged with: dom
type: Question
has title: Access a DOM element in Aurelia
has answer: http://stackoverflow.com/a/32569034
tagged with: aurelia
linked to: http://stackoverflow.com/q/29988599
has answer: http://stackoverflow.com/a/37822969
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/29866395
score: 29
favorite count: 0
answer count: 5

http://stackoverflow.com/q/29900359
has body: I am trying to implement socket.io-stream and in my server side file it works fine but on client side: This is top part of clientside, this is where file stops loading, at ss.createStream() as "ss" is not found. var socket = io.connect(); var username = null; var userarray = null; var stream = ss.createStream(); var filename="profile.jpg"; ss(socket).emit('profile-image', stream, {name: filename}); fs.createReadStream(filename).pipe(stream); It always says ss is not defined even though I've added it in head of html. This is top of jade template, where the scripts are defined in head. doctype html html head script(src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js") script(src="/socket.io/socket.io.js", type="text/javascript") script(src="script.js", type="text/javascript") script(src="http://chaterix.com/node_modules/socket.io-stream/socket.io-stream.js") script(src="char.js", type="text/javascript") My structure is as follows: root -public --script.js (client side) -node_modules --socket.io-stream ---socket.io-stream.js (the file I am trying to use) server.js (server side) I also tried using browsify as developer wrote: $ npm install browserify -g $ cd node_modules/socket.io-stream $ browserify index.js -s ss &gt; socket.io-stream.js but that didn't help too. socket.io-stream.js: https://github.com/nkzawa/socket.io-stream/blob/master/socket.io-stream.js and here is top part of server.js (server side) var http = require('http'), express = require('express'), app = express(), jade = require('jade'), server = http.createServer(app), bodyParser = require('body-parser'); var io = require('socket.io'); var escape = require('escape-html'); io = io.listen(server); var fs = require("fs"); var ss = require('socket.io-stream'); var path = require('path'); var Entities = require('html-entities').AllHtmlEntities; entities = new Entities(); server.listen(3000);
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47923654
has comment: http://stackoverflow.com/comment/47923868
has comment: http://stackoverflow.com/comment/47923602
tagged with: node.js
has title: Node.js - Global variable not found on client side
score: 3
upvote count: 3
has comment: http://stackoverflow.com/comment/47923363
type: Question
has comment: http://stackoverflow.com/comment/47923646
has answer: http://stackoverflow.com/a/39607547
tagged with: javascript
has comment: http://stackoverflow.com/comment/47923676
downvote count: 0
answer count: 1

http://stackoverflow.com/comment/47988590
type: QuestionComment
score: 0
has text: It's probably a bad idea to have two variables named `sendRequest`. It can cause potential confusion making people think the `sendRequest` inside the `async.each` callback have anything to do with the `sendRequest` function at the top.
comment on: http://stackoverflow.com/q/29933093
type: Comment

http://stackoverflow.com/comment/48086655
score: 0
comment on: http://stackoverflow.com/q/29983717
type: Comment
type: QuestionComment
has text: yeah, html contents are cached most oftenly and do not get refreshed on simple reload, you need hard reload by clearing browser cashe.

http://stackoverflow.com/comment/47924766
score: 0
type: Comment
type: QuestionComment
has text: @A.Wolff how can I change the button to a normal one instead?
comment on: http://stackoverflow.com/q/29901061

http://stackoverflow.com/comment/47995665
score: 0
has text: Thank you timelyportolio. Maybe should've put it up as an issue on github. I see there that @ramnathv is working on it - nice one.
type: QuestionComment
comment on: http://stackoverflow.com/q/29906806
type: Comment

http://stackoverflow.com/a/29863925
upvote count: 1
downvote count: 1
has body: You could try this function comp(a, b) { var diff = new Date(a.event_date) - new Date(b.event_date); if(diff &lt; 0) return -1; else if(diff &gt; 0) return 1; else if(parseTime(a.event_time) &lt; parseTime(b.event_time)) return -1; else if(parseTime(a.event_time) &gt; parseTime(b.event_time)) return 1; else return 0; } But why not make event_date and event_time one single property? edit: You could also define yourself a sortBy function to help you sort by any arbitrary number of properties. function sortBy(list, f) { list.sort(function(a, b) { var fa = f(a), fb = f(b); if(fa &lt; fb) return -1; else if(fa &gt; fb) return 1; else return 0; }); } Then you can sort by date, time, and title like this sortBy(list, function(o) { return [new Date(o.event_date), parseTime(o.event_time), o.title]; });
answers question: http://stackoverflow.com/q/29863837
score: 0
has comment: http://stackoverflow.com/comment/47853135
type: Answer
has comment: http://stackoverflow.com/comment/47853850
has comment: http://stackoverflow.com/comment/47853911

http://stackoverflow.com/comment/47833242
comment on: http://stackoverflow.com/a/29853273
score: 1
type: AnswerComment
type: Comment
has text: I can't upvote your answer because my rep is too low (I'm sure you knew that), I marked it answered thanks again.

http://stackoverflow.com/q/29885490
tagged with: jquery
has comment: http://stackoverflow.com/comment/47895042
has comment: http://stackoverflow.com/comment/47895114
favorite count: 0
linked to: http://stackoverflow.com/q/14028959
has comment: http://stackoverflow.com/comment/47895057
has title: Why is my addClass method not working?
type: UnansweredQuestion
duplicate of: http://stackoverflow.com/q/14028959
upvote count: 1
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/29885513
tagged with: javascript
score: 0
answer count: 1
has body: I'm working on an addClass method for my final project. I checked everything to make sure that there are no typos but clicking on the button doesn't change the texts color. Here is my code: Final Project: Home Some Text and here is my jQuery code: $('#theButton').click(function(){ $('#theText').addClass('theColor'); });

http://stackoverflow.com/a/29998538
score: 1
answers question: http://stackoverflow.com/q/29997398
upvote count: 1
type: AcceptedAnswer
has body: This code is maybe the solution you wanted: function countdown() { var i = document.getElementById('counter'); if (parseInt(i.innerHTML)&lt;=0) { $("#counter").fadeout(); i.innerHTML =10; i.style.width="100%"; $("#counter").fadein(10); } else { i.innerHTML = parseInt(i.innerHTML)-1; setTimeout(function(){ var i = document.getElementById('counter'); i.style.width="10%"; i.innerHTML="1"; },5000) } var msg = window.open("", "Window name", "width=200, height=100"); msg.document.write("Some HTML"); } You have to add jquery in the html head! Leave a comment if the code doesn't help.
has comment: http://stackoverflow.com/comment/48123151
type: Answer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29997398

http://stackoverflow.com/q/29965525
type: Question
has comment: http://stackoverflow.com/comment/48050948
has answer: http://stackoverflow.com/a/29965751
has comment: http://stackoverflow.com/comment/48050993
answer count: 2
has comment: http://stackoverflow.com/comment/48051185
downvote count: 0
tagged with: javascript
tagged with: jquery
has title: jQuery .slideToggle() to also close other tabs
favorite count: 0
has comment: http://stackoverflow.com/comment/48051323
accepted answer: http://stackoverflow.com/a/29965751
has comment: http://stackoverflow.com/comment/48050803
has body: I have two sections, each with 3 divs, opening on slideToggle. How can I close the other 2 divs in each section when 1 is open? https://jsfiddle.net/koteva/mdx20uqe/2/ Location grjryjj JERSEY ighlgkiuluil details fykyuk Location2 grjryjj JERSEY2 ighlgkiuluil details2 fykyuk
score: 2
type: AnsweredQuestion
upvote count: 2
possible better answer: http://stackoverflow.com/a/29965860
has answer: http://stackoverflow.com/a/29965860

http://stackoverflow.com/a/29963526
has comment: http://stackoverflow.com/comment/48047275
type: Answer
has comment: http://stackoverflow.com/comment/48047451
has comment: http://stackoverflow.com/comment/48048347
has body: Use $route.current to access the new route object. resolve: { log: function($route) { console.log($route.current); } } Is you wanna get templateURL value it should be in $route.current.loadedTemplateUrl
score: 0
answers question: http://stackoverflow.com/q/29963417

http://stackoverflow.com/a/29956408
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/29956144
type: AcceptedAnswer
has body: Can easily get the index of the cell that contains ':CMP:' and use the index to reference the previous cells. Or use traverses like prev() or use eq() once index is found. $('tbody tr').each(function () { var $cells = $(this).children(), $cmp = $cells.filter(':contains(":CMP:")'), cmpIndex = $cells.index($cmp); // array of values of previous cells var values = $.map($cells.slice(cmpIndex - 2, cmpIndex), function (el) { return $.trim($(el).text()); }); // make sure we have 2 cells with values and compare var cmpText = values.length === 2 &amp;&amp; values[0] === values[1] ? 'OK' : 'ERROR'; $cmp.text(cmpText); }); DEMO
upvote count: 1
type: Answer
has comment: http://stackoverflow.com/comment/48041670
accepted answer of: http://stackoverflow.com/q/29956144
has comment: http://stackoverflow.com/comment/48040863

http://stackoverflow.com/comment/47839299
type: Comment
type: AnswerComment
has text: well... it's in my answer.
score: 0
comment on: http://stackoverflow.com/a/29856390

http://stackoverflow.com/a/29988447
score: 2
answers question: http://stackoverflow.com/q/29988359
has body: In this specific example, the outer parentheses do not serve any function, other than (arguably) improving readability. This code is functionally identical: if (_.isObject(message)) { message = message.prev + ' is going to be removed in the future. ' + 'Please use ' + message.next + ' instead.' + (message.url ? ' See: ' + message.url : ''); } The parentheses around the ternary operator are added so the ternary operator doesn't evaluate everything before the message.url.
type: AcceptedAnswer
downvote count: 0
upvote count: 2
type: Answer
accepted answer of: http://stackoverflow.com/q/29988359

http://stackoverflow.com/q/29854842
has answer: http://stackoverflow.com/a/29854992
has body: I've been asked to have a pop-up when visitors leave the site asking them if they really want to leave. This pop-up will only show if their shopping cart has items in it. I can easily limit the pop-up to when the cart has items, however the issue I'm having is that even clicking an internal link loads the pop-up - how can I have it so this only comes up when actually leaving the site. &lt;script language="JavaScript"&gt; window.onbeforeunload = confirmExit; function confirmExit() { return "some message about leaving"; } &lt;/script&gt;
answer count: 5
has comment: http://stackoverflow.com/comment/47835572
has comment: http://stackoverflow.com/comment/47835689
has comment: http://stackoverflow.com/comment/47835586
possible better answer: http://stackoverflow.com/a/29854992
type: AnsweredQuestion
type: Question
linked to: http://stackoverflow.com/q/1686687
has answer: http://stackoverflow.com/a/29855057
has answer: http://stackoverflow.com/a/29855152
has answer: http://stackoverflow.com/a/29854911
tagged with: javascript
has comment: http://stackoverflow.com/comment/47835680
linked to: http://stackoverflow.com/q/29408083
score: 0
has answer: http://stackoverflow.com/a/29855022
tagged with: jquery
has title: Pop-up when leaving website
has comment: http://stackoverflow.com/comment/47835720
accepted answer: http://stackoverflow.com/a/29855057

http://stackoverflow.com/q/30001862
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/48122403
has comment: http://stackoverflow.com/comment/48122376
upvote count: 0
has comment: http://stackoverflow.com/comment/48122362
tagged with: web
favorite count: 0
type: Question
tagged with: http://stackoverflow.com/tag/html
score: -2
tagged with: css
has answer: http://stackoverflow.com/a/30001961
downvote count: 2
has body: This code working good in mozilla and opera .But not working in IE. Please help.The JavaScript is ok. But in IE 10 only back panel is coming .. Thank you.. http://codepen.io/syedrafeeq/pen/eCkFt CSS 3D FLIP BOX Flipping content to a div (Transitions and 3D Transforms) Front Side Back Side Front Side Back Side Front Side Back Side CSS body { background-color: #ecf0f1; margin: 20px; font-family: Arial, Tahoma; font-size: 20px; color: #666666; text-align: center; } p { color: #ffffff; } /*-=-=-=-=-=-=-=-=-=-*/ /* Column Grids */ /*-=-=-=-=-=-=-=-=-= */ .col_half { width: 49%; } .col_third { width: 32%; } .col_fourth { width: 23.5%; } .col_fifth { width: 18.4%; } .col_sixth { width: 15%; } .col_three_fourth { width: 74.5%;} .col_twothird{ width: 66%;} .col_half, .col_third, .col_twothird, .col_fourth, .col_three_fourth, .col_fifth{ position: relative; display:inline; display: inline-block; float: left; margin-right: 2%; margin-bottom: 20px; } .end { margin-right: 0 !important; } /*-=-=-=-=-=-=-=-=-=-=- */ /* Flip Panel */ /*-=-=-=-=-=-=-=-=-=-=- */ .wrapper{ width: 980px; margin: 0 auto; background-color: #bdd3de; hoverflow: hidden;} .panel { margin: 0 auto; height: 130px; position: relative; -webkit-perspective: 600px; -moz-perspective: 600px; } .panel .front, .panel .back { text-align: center; } .panel .front { height: inherit; position: absolute; top: 0; z-index: 900; text-align: center; -webkit-transform: rotateX(0deg) rotateY(0deg); -moz-transform: rotateX(0deg) rotateY(0deg); -webkit-transform-style: preserve-3d; -moz-transform-style: preserve-3d; -webkit-backface-visibility: hidden; -moz-backface-visibility: hidden; -webkit-transition: all .4s ease-in-out; -moz-transition: all .4s ease-in-out; -ms-transition: all .4s ease-in-out; -o-transition: all .4s ease-in-out; transition: all .4s ease-in-out; } .panel .back { height: inherit; position: absolute; top: 0; z-index: 1000; -webkit-transform: rotateY(-180deg); -moz-transform: rotateY(-180deg); -webkit-transform-st…
answer count: 1
has title: Code not working in internet explorer

http://stackoverflow.com/q/29944248
has comment: http://stackoverflow.com/comment/48010350
has comment: http://stackoverflow.com/comment/48010855
has comment: http://stackoverflow.com/comment/48010533
has answer: http://stackoverflow.com/a/29945155
accepted answer: http://stackoverflow.com/a/29945155
type: Question
possible better answer: http://stackoverflow.com/a/29945623
tagged with: google-closure-compiler
tagged with: javascript
score: 4
answer count: 2
has comment: http://stackoverflow.com/comment/48012166
tagged with: bundling-and-minification
tagged with: minify
has comment: http://stackoverflow.com/comment/48011429
favorite count: 0
has answer: http://stackoverflow.com/a/29945623
has comment: http://stackoverflow.com/comment/48012611
has comment: http://stackoverflow.com/comment/48012443
has comment: http://stackoverflow.com/comment/48010897
upvote count: 4
has comment: http://stackoverflow.com/comment/48010603
tagged with: typescript
type: AnsweredQuestion
downvote count: 0
has body: I am trying to use closure compiler advanced mode on typescript generated classes with no success. Is there anyone who has accomplished such things. Typescript Class class TestData { BlogName: string; CacheTimeOut: number; CopyrightHolder: string; constructor(blogName: string, cacheTimeOut: number, copyrightHolder: string) { this.BlogName = blogName; this.CacheTimeOut = cacheTimeOut; this.CopyrightHolder = copyrightHolder; } addBlog(value: string): boolean { console.log('add blog'); return true; } validate(): boolean { console.log('all valid'); return true } } var myTestData = new TestData("name",22,"cpyright"); Generated Code var TestData = (function () { function TestData(blogName, cacheTimeOut, copyrightHolder) { this.BlogName = blogName; this.CacheTimeOut = cacheTimeOut; this.CopyrightHolder = copyrightHolder; } TestData.prototype.addBlog = function (value) { console.log('add blog'); return true; }; TestData.prototype.validate = function () { console.log('all valid'); return true; }; return TestData; })();var myTestData = new TestData(); This compiles into new function() {}; I understand I should provide exports, so I added window['TestData'] = TestData; window['TestData'].prototype['addBlog'] = TestData.prototype.addBlog window['TestData'].prototype['validate'] = TestData.prototype.validate my output from closure compiler advanced compilation is var a = function() { function b() { } b.prototype.a = function() { console.log("add blog"); return !0; }; b.prototype.b = function() { console.log("all valid"); return !0; }; return b; }(); window.TestData = a; window.TestData.prototype.addBlog = a.prototype.a; window.TestData.prototype.validate = a.prototype.b; new a; If you see there is still no constructor code that is left. This gets worse when we add this inside a module. I also tried to use the @export of google closure wiht no success I see couple of pluggins which can generate closure compiler annotations based on typescript, but those also doesnt generate prope…
has comment: http://stackoverflow.com/comment/48011289
has title: Closure compiler export Typescript classes and functions

http://stackoverflow.com/comment/48030649
score: 0
has text: @Brad I have interest of learning developing extensions, so I prefer to do it by myself. edit: oh, you told me to look at the source code, I thought you told me to use this extension. sorry
comment on: http://stackoverflow.com/q/29954883
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29884896
downvote count: 1
has comment: http://stackoverflow.com/comment/47894268
has answer: http://stackoverflow.com/a/29885154
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47894101
has title: how can I fix this error "There is no attribute colorcode, selected or tabindex"
has answer: http://stackoverflow.com/a/29885104
tagged with: css
has body: colorthumbs[i].addEventListener('click', function(){ var colorcode = this.getAttribute('colorcode'); var thumbimg = document.getElementById('productthumbs').getElementsByTagName('img'); for(var i = 0; i < thumbimg.length; i++) { Select Color This has to be xhtml strict 1.0 only nothing else. been working on a ton of errors and now down to these last three. Line 83, Column 92: there is no attribute "colorcode" Line 83, Column 105: there is no attribute "selected" Line 117, Column 94: there is no attribute "tabIndex"
linked to: http://stackoverflow.com/q/1735230
type: Question
has comment: http://stackoverflow.com/comment/47894232
tagged with: javascript
has comment: http://stackoverflow.com/comment/47894006
score: 0
answer count: 2
upvote count: 1
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/a/29995278
has body: Just map your [{x1,y1}, {x2,y2}, ... {xN,yN}] pairs to a [y1, y2, ... yN] series, which is what that moving average function expects: movingAverageLine(data.map(function(d) { return d.y; }))
type: AcceptedAnswer
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/48131234
accepted answer of: http://stackoverflow.com/q/29994139
answers question: http://stackoverflow.com/q/29994139
score: 5
upvote count: 5

http://stackoverflow.com/comment/47864025
has text: OK! I have updated the answer. Please check again and consider my comments inside Edited answer.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29854352

http://stackoverflow.com/comment/47875143
has text: @ShashankAgrawal That's correct
comment on: http://stackoverflow.com/q/29875191
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29936484
type: Answer
score: 0
has body: Angular 1.3+ doesn't allow global function controller declaration. In order for your above to work, you need to add allowGlobals setting of $controllerProvider inside your config section. Code angular.module('myModule').config(['$controllerProvider', function($controllerProvider) { // this option might be handy for migrating old apps, but please don't use it $controllerProvider.allowGlobals(); }]); But I'd suggest you to don't use this approach, use angular module approach as @tpie suggested.
answers question: http://stackoverflow.com/q/29936188

http://stackoverflow.com/comment/48034172
comment on: http://stackoverflow.com/q/29956581
has text: I am not able to get anything still.. If it was my react setup would I not be getting any react to work?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29961206
tagged with: highcharts
tagged with: javascript
has comment: http://stackoverflow.com/comment/48049398
tagged with: heatmap
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/48050404
has comment: http://stackoverflow.com/comment/48051163
has title: HeatMap cell Transparent or none
has comment: http://stackoverflow.com/comment/48047384
type: Question
score: 0
has body: While plotting HeatMap it displays empty space (i.e. white cell) where data point doesn't exist, how can i make it transparent? similar to this link

http://stackoverflow.com/a/29985970
has body: After considerations on yo's package.json i found that: Main component to build CLI: https://www.npmjs.com/package/inquirer Helpers: https://www.npmjs.com/package/chalk https://www.npmjs.com/package/meow
answers question: http://stackoverflow.com/q/29985221
type: Answer
score: 0

http://stackoverflow.com/q/29907823
answer count: 3
has body: This code centers an element, but if the content is taller than the container a portion of the top of the element will be left above the top of the container. Is there a method of forcing the element to stay within the container? Though I'm sure it's possible with javascript, it would probably be pretty ugly. I would rather a css option. Just point me in the right direction. EDIT: I do not want to "hide" the overflow, I want the opposite. Visit the jsfiddle resize the preview panel smaller than the element and you will see what I mean jsfiddle html &lt;div class="fill"&gt; &lt;div class="myClass"&gt; hello world! &lt;/div&gt; &lt;/div&gt; css .fill { height:100%; width: 100%; } .myClass { position: relative; top: 50%; left: 50%; transform: translate(-50%,-50%); }
has answer: http://stackoverflow.com/a/29907877
has answer: http://stackoverflow.com/a/29908191
favorite count: 0
has title: css relative position keep inside container
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29907953
tagged with: css
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29908191
upvote count: 1
downvote count: 1
type: Question
tagged with: javascript
possible better answer: http://stackoverflow.com/a/29907877
score: 0

http://stackoverflow.com/comment/48068544
has text: Thank you, Bharani. Your code was not exactly accurate; the SUBMIT button should still be at the bottom (as I posted). Otherwise, it appears at the top of the form. But, still, your answer put me on the right track, so thanks :=))))
comment on: http://stackoverflow.com/a/29953101
type: AnswerComment
score: 0
type: Comment

dom
tags question: http://stackoverflow.com/q/29972011
tags question: http://stackoverflow.com/q/29967843
tags question: http://stackoverflow.com/q/29967492
type: Tag
tags question: http://stackoverflow.com/q/29932338
tags question: http://stackoverflow.com/q/29984702
tags question: http://stackoverflow.com/q/29953982
tags question: http://stackoverflow.com/q/29947630
tags question: http://stackoverflow.com/q/29857962
tags question: http://stackoverflow.com/q/30002384
tags question: http://stackoverflow.com/q/29857242
tags question: http://stackoverflow.com/q/29996091
tags question: http://stackoverflow.com/q/29898222
tags question: http://stackoverflow.com/q/29944336
tags question: http://stackoverflow.com/q/29971687
tags question: http://stackoverflow.com/q/29948765
tags question: http://stackoverflow.com/q/29888878
tags question: http://stackoverflow.com/q/29846206
tags question: http://stackoverflow.com/q/29975222
tags question: http://stackoverflow.com/q/29958865
tags question: http://stackoverflow.com/q/29876796
tags question: http://stackoverflow.com/q/29977831
tags question: http://stackoverflow.com/q/29956988
tags question: http://stackoverflow.com/q/29937744
tags question: http://stackoverflow.com/q/29961150
tags question: http://stackoverflow.com/q/29858846
tags question: http://stackoverflow.com/q/29954223
tags question: http://stackoverflow.com/q/29898485
tags question: http://stackoverflow.com/q/29996256
tags question: http://stackoverflow.com/q/29997895
tags question: http://stackoverflow.com/q/29994591
tags question: http://stackoverflow.com/q/29984806
tags question: http://stackoverflow.com/q/29846162
tags question: http://stackoverflow.com/q/29994355
tags question: http://stackoverflow.com/q/30001482
tags question: http://stackoverflow.com/q/29992346
tags question: http://stackoverflow.com/q/29946420
tags question: http://stackoverflow.com/q/29904709
tags question: http://stackoverflow.com/q/29921774
tags question: http://stackoverflow.com/q/29875824
tags question: http://stackoverflow.com/q/29863044
tag name: dom
tags question: http://stackoverflow.com/q/29950975
tags question: http://stackoverflow.com/q/29994929
tags question: http://stackoverflow.com/q/29864246
tags question: http://stackoverflow.com/q/29937768
tags question: http://stackoverflow.com/q/29893174
tags question: http://stackoverflow.com/q/29873511
tags question: http://stackoverflow.com/q/29998777
tags question: http://stackoverflow.com/q/29940202
tags question: http://stackoverflow.com/q/29996048

http://stackoverflow.com/q/29861778
tagged with: javascript
has title: JavaScript - how to delete elements that do not have a specific class?
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
accepted answer: http://stackoverflow.com/a/29861829
upvote count: 2
score: -4
downvote count: 6
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/21975881
has body: I want to delete all elements that do not have the class 'stay' For example: Stay Stay Go Stay classy I would like some javascript that would delete the elements that do not have the class stay and Sel, without having to list the classes go and element I have used: var els = document.querySelectorAll('#parent :not(.stay)'); for (var i = 0; i < els.length; i++) { els[i].parentNode.removeChild(els[i]) } from the first answer, but am unsure of how to keep the class 'Sel'. Also, I DO NOT want any Jquery.
has comment: http://stackoverflow.com/comment/47849225
type: Question
has comment: http://stackoverflow.com/comment/47849218
has answer: http://stackoverflow.com/a/29861829

http://stackoverflow.com/comment/48124247
has text: None of my thoughts shout "elegance" for this. How about a hovering (modal or not) clone, on mouseeover which will be fixed no matter what happens underneath?
type: Comment
score: 0
comment on: http://stackoverflow.com/q/30001312
type: QuestionComment

http://stackoverflow.com/q/29950833
accepted answer: http://stackoverflow.com/a/29962665
has title: How to make it possible to display special characters in CKEditor
tagged with: plugins
type: AnsweredQuestion
type: Question
has answer: http://stackoverflow.com/a/29962665
tagged with: javascript
tagged with: ckeditor
score: 0
has body: I want to write a simple plugin to display special characters in CKEditor. How to make it possible to display special characters. For example: space, tab, non-breaking space (&amp;nbsp;). Should work on the principle, as is done in Word.
answer count: 1

http://stackoverflow.com/a/29918078
has body: Please attach the event in a more robust way so that the event will work in all browsers. for (var j = 0; j < 100; j++){ var cell = document.createElement("td"); addEvent(cell, 'mouseover', changeColor); // See method in code below. // ... } // Attach the event to all table cells. [].slice.call(document.querySelectorAll('td')).forEach(function(td) { addEvent(td, 'mouseover', changeColor); }); function changeColor(e) { e = e || window.event; // Is the event local or global? var el = e.srcElement || e.target; // The element who dispatched the event. el.style.backgroundColor = 'red'; } // Cross-browser event listener. function addEvent(el, event, fn, useCapture) { if (el.addEventListener) { el.addEventListener(event, fn, useCapture); } else { el.attachEvent('on' + event, function() { // Call the event with the scope of the target element. return fn.call(el, window.event); }); } } th1 th2 td1 td2 You can achieve the same effect, as described above, using a little bit of jQuery. jQuery's event listeners set the scope of the target element for you. This makes event handling a bit easier. $(function() { $('table').on('mouseover', 'td', changeColor); function changeColor(e) { $(this).css('background-color', 'red'); } }); th1 th2 td1 td2
has comment: http://stackoverflow.com/comment/47981240
answers question: http://stackoverflow.com/q/29917345
type: Answer
has comment: http://stackoverflow.com/comment/47981087
downvote count: 1
upvote count: 0
score: -1

http://stackoverflow.com/q/29965025
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/48051614
upvote count: 1
has answer: http://stackoverflow.com/a/29966683
type: Question
has comment: http://stackoverflow.com/comment/48050888
has comment: http://stackoverflow.com/comment/48050825
has comment: http://stackoverflow.com/comment/48051267
tagged with: javascript
has comment: http://stackoverflow.com/comment/48050360
has title: Recreate same array from new one
has body: I have an array from which I take some values to create some fields of a form. After creating it I need to send the new array that I fill automatically to the server. The problem is that I need to send the same array from the first but of course with the new values. I created here the example: https://jsfiddle.net/vuqcopm7/2/ Some code here: HTML: {{data.attrname}} {{showNewJson()}} JS: var myApp = angular.module('myApp',[]); myApp.controller("mycontroller", ["$scope", "$http", function($scope, $http){ $scope.getItems = { "data": [ { "label": "first", "objects": [ { "name": "firstObj", "attributes": [ { "attrname": "asd1", "attrValue": "", "attrType":"text" }, { "attrname": "asd2", "attrValue": "", "attrType":"text" } ] } ], "key": "bolla" }, { "label": "second", "objects": [ { "name": "secondObj", "attributes": [ { "attrname": "asd", "attrValue": "", "attrType":"text" }, { "attrname": "asd3", "attrValue": "", "attrType":"text" } ] } ], "key": "2" } ] }; $scope.filterSelected = $scope.getItems.data[0].objects; $scope.myNewArray = { newArray: [ ] } $scope.pushItems = function pushItems(attribute, items) { $scope.myNewArray.newArray.push(angular.copy(attribute), angular.copy(items)); console.log($scope.myNewArray); } $scope.showNewJson = function() { return $scope.myNewArray; } }]); ps: I'm using angularjs EDIT: i updated the fiddle: https://jsfiddle.net/vuqcopm7/3/ This should be the correct json i would: { "objects": [ { "name": "firstObj", "attributes": [ { "attrname": "asd1", "attrValue": "asdas", "attrType": "text" }, { "attrname": "asd2", "attrValue": "sadsa", "attrType": "text" }, { "name": "secondObj", "attributes": [ { "attrname": "asd3", "attrValue": "tttt", "attrType": "text" }, { "attrname": "asd4", "attrValue": "qqq", "attrType": "text" } ] } ] } ] }
downvote count: 0
answer count: 1
score: 1
accepted answer: http://stackoverflow.com/a/29966683
has comment: http://stackoverflow.com/comment/48050649
favorite count: 0
has comment: http://stackoverflow.com/comment/48050798
tagged with: angularjs
has comment: http://stackoverflow.com/comment/48053318

http://stackoverflow.com/comment/47876548
comment on: http://stackoverflow.com/q/29865292
score: 0
type: QuestionComment
has text: Any ideas on the edited part?
type: Comment

redactor.js
tag name: redactor.js
type: Tag
tags question: http://stackoverflow.com/q/29920908

http://stackoverflow.com/a/29873785
upvote count: 2
answers question: http://stackoverflow.com/q/29873659
downvote count: 0
type: Answer
score: 2
has body: To auto-arrange elements with differing heights, there are a bunch of different libraries out there you can use. One such library is Masonry. Try out the snippet below: new Masonry(document.getElementById('container'), { itemSelector: '.item' }); .item { width: 25%; } .one { background-color: orange; height: 100px; } .two { background-color: green; height: 150px; } .three { background-color: blue; height: 200px; }

http://stackoverflow.com/comment/47909833
has text: you schould call query again in order to resfresh your grid...
score: 0
type: Comment
comment on: http://stackoverflow.com/q/29893087
type: QuestionComment

http://stackoverflow.com/q/29873730
has answer: http://stackoverflow.com/a/74547438
upvote count: 62
answer count: 6
has answer: http://stackoverflow.com/a/29883895
tagged with: reactjs
downvote count: 0
has answer: http://stackoverflow.com/a/53470549
tagged with: javascript
has answer: http://stackoverflow.com/a/49856459
possible better answer: http://stackoverflow.com/a/54248634
favorite count: 0
has answer: http://stackoverflow.com/a/54248634
has comment: http://stackoverflow.com/comment/47879374
accepted answer: http://stackoverflow.com/a/29883895
tagged with: lifecycle
type: AnsweredQuestion
has title: react lifecycle methods understanding
has body: I am a newbie to React.js and I am trying hard to understand several methods in the React lifecycle methods. So far, I have something that confuses me: 1) As far as I understand, the difference between componentWillUpdate and componentWillReceiveProps is that componentWillReceiveProps will be called when the parent changes the props and we can use setState (setState of this child inside componentWillReceiveProps). for example: react-table-sorter-demo var App = React.createClass({ getInitialState: function() { return {source: {limit: "200", source: "source1"}}; }, handleSourceChange: function(source) { this.setState({source: source}); }, render: function() { return ( &lt;div&gt; &lt;DataSourceSelectors onSourceChange={this.handleSourceChange} source={this.state.source} /&gt; &lt;TableSorter dataSource={urlForDataSource(this.state.source)} config={CONFIG} headerRepeat="5" /&gt; &lt;/div&gt; ); } }); In TableSorter, we have componentWillReceiveProps: function(nextProps) { // Load new data when the dataSource property changes. if (nextProps.dataSource != this.props.dataSource) { this.loadData(nextProps.dataSource); } } meaning when we change this.state.source, we will expect componentWillReceiveProps to be called in TableSorter. However, I don't quite understand how to use componentWillUpdate in this case, the definition of componentWillUpdate is componentWillUpdate(object nextProps, object nextState) How can we pass nextState from parent into child? Or maybe I am wrong, is the nextState passed from the parent element? 2) method componentWillMount confuses me because in the official documentation, it says that Invoked once, both on the client and server, immediately before the initial rendering occurs. In this case, if I use setState in this method, it will override the getInitialState since it will be called once only initially. In this case, what is the reason to set the parameters in the getInitialState method. In this particular case, we have: getInitialState: funct…
has answer: http://stackoverflow.com/a/43511239
type: Question
score: 62

http://stackoverflow.com/q/29846632
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47820072
has comment: http://stackoverflow.com/comment/47820483
has comment: http://stackoverflow.com/comment/47818879
type: Question
tagged with: jsp
linked to: http://stackoverflow.com/q/9223583
tagged with: javascript
has title: How to send data through jQuery AJAX and retrieve using JSP?
tagged with: jquery
tagged with: ajax
score: 0
has comment: http://stackoverflow.com/comment/47820393
has body: I want to send this variable fid to my JSP page. $.ajax({ url: 'http://api.themoviedb.org/3/genre/movie/list?api_key=' + api_key, dataType: 'jsonp', jsonpCallback: 'testing' }).error(function() { console.log('error') }).done(function(response) { fid = response.genres[Math.floor(Math.random() * response.genres.length)].id; $.ajax({ url: 'http://api.themoviedb.org/3/genre/' + fid + '/movies?api_key=' + api_key, dataType: 'jsonp', jsonpCallback: 'testing' }).error(function() { console.log('error') }).done(function(response) { k = Math.floor(Math.random() * response.results.length); $('#search_results').append( '&lt;img id="rimg" style="height:300px;width:300px;"src="' + images_uri + response.results[k].poster_path + '" alt="image not available"&gt;&lt;/img&gt;' ); $('#d2').append('&lt;h2 id="h2"&gt;' + response.results[k].title + '&lt;/h2&gt;'); }); }); });

http://stackoverflow.com/q/29991078
has answer: http://stackoverflow.com/a/34676531
has comment: http://stackoverflow.com/comment/48128648
answer count: 3
downvote count: 0
tagged with: javascript
has title: Binding to a component property in angular2
favorite count: 0
has answer: http://stackoverflow.com/a/30000775
tagged with: angular
possible better answer: http://stackoverflow.com/a/37626649
has comment: http://stackoverflow.com/comment/48108759
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/37626649
score: 16
accepted answer: http://stackoverflow.com/a/30000775
has body: I'd like to reference a property on a component within A. that' component's constructor B. that component's template. The apis on this seem to be shifting a little bit, but i'd expect the following to work: &lt;my-component [greeting]="hello"&gt;&lt;/my-component&gt; // my component.es6.js @Component({ selector: 'my-component', properties: { 'greeting': 'greeting' } }) @View({ template: '{{greeting}} world!' }) class App { constructor() { console.log(this.properties) // just a guess } } Plunkr What am I doing wrong?
upvote count: 16
type: Question
tagged with: ecmascript-6

http://stackoverflow.com/q/29901850
has comment: http://stackoverflow.com/comment/47976623
has comment: http://stackoverflow.com/comment/47926962
has comment: http://stackoverflow.com/comment/47926889
has title: Attaching an image to an overlay using javascript
answer count: 0
downvote count: 0
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47926507
type: Question
has comment: http://stackoverflow.com/comment/47926436
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47926395
score: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/47926347
has body: I have searched several posts but cannot find something similar to what I need to do, or what I have found I cannot get to work - pretty sure that is just me though! So, there are 3 links on a page. When a link is clicked it should display the photo (on the same page) with an overlay applied to it. I can get the image to open but for the life of me cannot figure out how to get the overlays to attach. When the image opens it should stay on the same page (with the links visible through the overlay). The user should be able to click a close button or the image itself to go back to the links display. I know the code is a mess as I've been trying anything I can think of to try and get this to work, since I'm currently stuck on getting everything to display properly and have not even gotten to the close function yet if someone can give me a hint I would really appreciate it. Thanks! HTML Image preview Mt. Rainier, 1 Mt. Rainier, 2 Mt. Rainier, 3 CSS .previewOverlay { position: absolute; display: none; top: 0px; left: 0px; background-color: rgba(0, 0, 0, 0.7); width: 100%; height: 100%; } .previewOverlay img { position: relative; border: 20px solid white; border-radius: 10px; top: 50px; left: 50px; } .close { position: absolute; top: 0px; left: 0px; color: #fdfdfd; font-size: 50px; text-shadow: 0px 0px 5px black; } .close:after { content: "\2717"; } .close:hover { color: orange; } JavaScript function Preview () { var mtnPics = document.querySelectorAll("a"); console.log(mtnPics); mtnPics.addEventListener("click", function(event) { event.preventDefault() }); for (var i = 0; i < mtnPics.length; i++) { mtnPics[i].onclick = showPicture; } function showPicture (pictureURL) { var picPicked = document.getElementById("a").value; console.log(picPicked); //Create Div's for image display. var ul = document.getElementById("ul"); var picDiv = document.createElement("div"); picDiv.setAttribute("class", "previewOverlay"); var imgDiv = document.createElement("div"); imgDiv.setAttribute("c…
upvote count: 1
tagged with: css

http://stackoverflow.com/q/29847282
score: 0
answer count: 3
has comment: http://stackoverflow.com/comment/47820929
has body: This question is so simple as to be embarrassing. As a test of something I copied the code from http://getbootstrap.com/javascript/#modals directly into a page that only carries a basic page setup, and yet it doesn't work. Which means I'm doing something extremely stupid. Here's my entire page: &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;!-- Website Title &amp; Description for Search Engine purposes --&gt; &lt;title&gt;&lt;/title&gt; &lt;meta name="description" content=""&gt; &lt;!-- Mobile viewport optimized --&gt; &lt;meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"&gt; &lt;!-- Bootstrap CSS --&gt; &lt;link href="includes/css/bootstrap.css" rel="stylesheet"&gt; &lt;link href="includes/css/bootstrap-glyphicons.css" rel="stylesheet"&gt; &lt;!-- Custom CSS --&gt; &lt;link href="includes/css/styles.css" rel="stylesheet"&gt; &lt;!-- Include Modernizr in the head, before any other Javascript --&gt; &lt;script src="includes/js/modernizr-2.6.2.min.js"&gt;&lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModal" data-whatever="@mdo"&gt;Open modal for @mdo&lt;/button&gt; &lt;button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModal" data-whatever="@fat"&gt;Open modal for @fat&lt;/button&gt; &lt;button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModal" data-whatever="@getbootstrap"&gt;Open modal for @getbootstrap&lt;/button&gt; ...more buttons... &lt;div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" 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="exampleM…
has comment: http://stackoverflow.com/comment/47821225
possible better answer: http://stackoverflow.com/a/29847796
tagged with: twitter-bootstrap-3
tagged with: twitter-bootstrap
has comment: http://stackoverflow.com/comment/47821743
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29848039
accepted answer: http://stackoverflow.com/a/29848039
has title: Bootstrap 3 Example Code for Modal Window Not working
has comment: http://stackoverflow.com/comment/47821427
has answer: http://stackoverflow.com/a/29847796
type: Question
has comment: http://stackoverflow.com/comment/47821590
has comment: http://stackoverflow.com/comment/47820578
tagged with: bootstrap-modal
tagged with: javascript
has answer: http://stackoverflow.com/a/29859954
tagged with: jquery
has comment: http://stackoverflow.com/comment/47820845
has comment: http://stackoverflow.com/comment/47821177

http://stackoverflow.com/q/29939567
tagged with: recursion
has answer: http://stackoverflow.com/a/29939882
has body: I want to loop through some functions recursively so that after last function again it goes to first one and it goes forever. Can anyone please help me out on that? I also want to know if there is proper tutorial or something that will help me out to solve these problem in node js looping and flow controlling. I tried online tutorial though But not able to understand properly. var util = require('util'); var async = require('async'); var SensorTag = require('./index'); var USE_READ = true; SensorTag.discover(function(sensorTag) { console.log('discovered: ' + sensorTag); sensorTag.on('disconnect', function() { console.log('disconnected!'); process.exit(0); }); async.series([ /*func 1*/ function(callback) { console.log('connectAndSetUp'); sensorTag.connectAndSetUp(callback); }, /*func 2*/ function(callback) { console.log('readDeviceName'); sensorTag.readDeviceName(function(error, deviceName) { console.log('\tdevice name = ' + deviceName); callback(); }); }, /*func 3*/ function(callback) { console.log('readSystemId'); sensorTag.readSystemId(function(error, systemId) { console.log('\tsystem id = ' + systemId); callback(); }); } }) }) When I executed it goes func 1 -> func 2 -> func 3 and then hangs. I need to recursively loop these again and again. Edit code :I TRIED TO LOOP SOME FUNCTIONS, not all var util = require('util'); var async = require('async'); var SensorTag = require('./index'); var USE_READ = true; SensorTag.discover(function(sensorTag) { console.log('discovered: ' + sensorTag); sensorTag.on('disconnect', function() { console.log('disconnected!'); process.exit(0); }); //function loop(){ async.series([ /*func 1*/ function(callback) { console.log('connectAndSetUp'); sensorTag.connectAndSetUp(callback); }, function loop(callback){ /*func 2*/ function(callback) { console.log('readDeviceName'); sensorTag.readDeviceName(function(error, deviceName) { console.log('\tdevice name = ' + deviceName); callback(); }); }, /*func 3*/ function(callback) { console.log('readS…
type: Question
has title: infinite loop recursively with node.js
downvote count: 0
tagged with: javascript
answer count: 2
has answer: http://stackoverflow.com/a/29939822
has comment: http://stackoverflow.com/comment/48000646
score: 1
favorite count: 0
type: UnansweredQuestion
upvote count: 1
tagged with: node.js

http://stackoverflow.com/q/29959386
type: AnsweredQuestion
tagged with: onclick
has title: Function not working on onclick event?
downvote count: 1
has answer: http://stackoverflow.com/a/29959994
type: Question
has comment: http://stackoverflow.com/comment/48039541
has comment: http://stackoverflow.com/comment/48039268
has comment: http://stackoverflow.com/comment/48039483
accepted answer: http://stackoverflow.com/a/29960649
has comment: http://stackoverflow.com/comment/48039464
has comment: http://stackoverflow.com/comment/48039312
has comment: http://stackoverflow.com/comment/48039320
answer count: 2
has comment: http://stackoverflow.com/comment/48039287
has comment: http://stackoverflow.com/comment/48039298
has comment: http://stackoverflow.com/comment/48039316
has body: I've a common function : function initialize(){ selectedAttachment(); } which is first called on ajax success and then after onclick event Ajax call : $.ajax({ url: HTTP_LANYARDS + 'orders/lyPrices', dataType: 'json', type: 'get', beforeSend: function(){ $('.overlay').show(); }, complete: function(){ $('.overlay').hide(); }, success: function(json){ ajaxData = json; initialize(); if(typeof(editOrder)==='function'){ editOrder(); }//calling edit function }, error: function(xhr, ajaxOptions, thrownError) { alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText); } }); selectedAttachment function : function selectedAttachment(){ $('.lanyardAttachment li').removeClass('selected'); // This statement is working on both (load/onclick) events. var radio = $('.lanyardAttachment li .name :radio:checked'); console.log(radio); // Getting element on load event but not on onclick event. } onclick event : $('body').on('click', '.lanyardAttachment li a', function(){ $('.lanyardAttachment li input[type="radio"]').attr('checked',false); $(this).find('input[type="radio"]').attr('checked',true); initialize(); }); Html : Attachment: Bulldog Clip (CL-01) Swivel Hook (CL-02) Split Ring (CL-03) Lobster Claw (CL-04) Oval Hook (CL-06) Carabiner Hook (CL-07) Now the problem is selectedAttachment function working fine on ajax success but getting empty element on onclick event. I'm not able to figure out whats going wrong here, any help would be appreciated.
has answer: http://stackoverflow.com/a/29960649
has comment: http://stackoverflow.com/comment/48039308
tagged with: javascript
tagged with: jquery
favorite count: 0
upvote count: 3
linked to: http://stackoverflow.com/q/16051491
has comment: http://stackoverflow.com/comment/48039772
score: 2
possible better answer: http://stackoverflow.com/a/29959994

http://stackoverflow.com/comment/48074226
comment on: http://stackoverflow.com/q/29977287
has text: Seeing as when js calls toString() on it, it returns the object's toString() and not the string.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47924968
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29900726
has text: It looks very much like you want `setup = setup.length*10` (for any one- to four-digit strings `setup`)
score: 0

http://stackoverflow.com/q/29897875
tagged with: ruby-on-rails
type: Question
has body: I am using a carrierwave and dropzonejs. Everything seems fine however, when I try to press to remove picture button, even though it removes from the database, picture stays on the container. Here how it looks like; When I click to remove file link all of them, it becomes; So I clicked all the remove file buttons, they are removed from the database however, stays on the page. I think it is because of the js code (end part) below, &lt;script type="text/javascript"&gt; $(document).ready(function(){ // disable auto discover Dropzone.autoDiscover = false; // grap our upload form by its id $("#picture-dropzone").dropzone({ // restrict image size to a maximum 5MB maxFilesize: 5, // changed the passed param to one accepted by // our rails app paramName: "picture[image]", acceptedFiles: "image/*", // show remove links on each image upload addRemoveLinks: true, // if the upload was successful success: function(file, response){ // find the remove button link of the uploaded file and give it an id // based of the fileID response from the server $(file.previewTemplate).find('.dz-remove').attr('id', response.fileID); $(file.previewTemplate).find('.dz-remove').attr('boat_id', response.boatID); // add the dz-success class (the green tick sign) $(file.previewElement).addClass("dz-success"); }, //when the remove button is clicked removedfile: function(file){ //location.reload(); //removeFile(file); *******THIS DOES NOT WORK******* // grap the id of the uploaded file we set earlier var id = $(file.previewTemplate).find('.dz-remove').attr('id'); var boat_id = $(file.previewTemplate).find('.dz-remove').attr('boat_id'); // // make a DELETE ajax request to delete the file $.ajax({ type: 'DELETE', url: '/boats/' + boat_id + '/pictures/' + id, success: function(file){ } }); } }); }); &lt;/script&gt; pictures controller if anyone wonders, class PicturesController &lt; ApplicationController before_action :logged_in_user before_filter :load_parent def new @picture = @boat.pictures.new @pictur…
accepted answer: http://stackoverflow.com/a/32623592
score: 5
upvote count: 5
tagged with: javascript
tagged with: image
has title: Dropzonejs with Rails Delete files from the page
answer count: 1
downvote count: 0
favorite count: 0
tagged with: ajax
has answer: http://stackoverflow.com/a/32623592
tagged with: refresh
type: AnsweredQuestion

http://stackoverflow.com/comment/87030945
score: 1
type: Comment
has text: Hello from the future! After about 3 hours of trying to debug why on earth would printing `$window.location.hostname` inside `onSuccess` show the value of a previous state, your answer finally let me figure out why. Thank you! If you're ever visiting Helsinki and feel like having a beer, you've got yourself covered.
comment on: http://stackoverflow.com/a/30198748
type: AnswerComment

http://stackoverflow.com/a/29914711
type: AcceptedAnswer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/29914612
type: Answer
has body: As @Juhana mentioned in comments, your last loop will fail because there is no element var el = icons[i]; // where i=icons.length hence change your loop to for (var i = 0; i &lt; icons.length; i++){//change &lt;= to &lt; and it should work.
upvote count: 1
accepted answer of: http://stackoverflow.com/q/29914612

http://stackoverflow.com/comment/47837196
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29855551
has text: Edit: I do know what document.referrer does in js, just not sure how mix panel is using it
score: 0

http://stackoverflow.com/comment/48023182
has text: Are you familiar with jQuery/AJAX? You can use them to easily accomplish this task and have it populate your "random image" area with the images, desc, price, etc... by having it feed from your database. You can even have it randomly change the images every so often, even if you don't refresh the page. This way the customer has time to see it, and if they're still on the page for awhile, it'll switch up so they can be exposed to even further products.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29950983
score: 1

http://stackoverflow.com/a/29966616
has comment: http://stackoverflow.com/comment/48206731
type: Answer
upvote count: 4
has comment: http://stackoverflow.com/comment/48129856
downvote count: 0
has comment: http://stackoverflow.com/comment/48118435
score: 4
accepted answer of: http://stackoverflow.com/q/29966149
has comment: http://stackoverflow.com/comment/48200908
answers question: http://stackoverflow.com/q/29966149
type: AcceptedAnswer
has body: I think the best data structure for such task is a trie. About case insetivity - just lowercase each word before adding to the trie and perform searching on lower cased words. When you reach some point of the trie, there are number of children nodes which are satisfying strings - string with have the prefix from root to current point. Output suggestions - recursively walk from current point(which is reached from root to user typed prefix) and print suggestion on nodes which marked as leafs. Stop printing after ~10 outputs because trie may have many satisfying words. Here is js implementations: trie-js, trie and many others. Just search js+trie. May be trie+autosuggest+js will also work) UPDATE 1 If you want to output all variants in O(1) (O(1) for each suggestion, of course), without recursive walk, you may store arraylist of references in each node. Arraylist stores indices of all words which belongs to node and each value is an index in other dictionary araylist. Something like that: Add word to dict: Check in O(word_len) is it in a trie (already added). If not, add to dictionary and remember index in "storage" if(!inTrie(word)){ dict.push(word); index = dict.length-1; //zero based indices // now adding to trie for each node visited while addition to trie : node.references.push(index) } Search: Go to node with prefix==typed word; for(int i=0;i<min(curNode.references.length(),10);i++) print(dict[curNode.references[i]]; UPDATE 2 About 'pa' --> 'Very cool park' You definetily should split phrase to separate words in order each word be "searchable" in a trie. BUT! As you treat phrase as one word, you should store it one cell. I mean: String phrase = "Very cool parl"; dict.push(phrase); index = dict.length-1; parts[] = split(phrase); for part in parts{ add part - for each node visited while addition of part perform node.references.push(index); } In other words, code of phrase the same with code of single word. And reference is the same, because we store all part togeth…
has comment: http://stackoverflow.com/comment/48203299
has comment: http://stackoverflow.com/comment/48055884

http://stackoverflow.com/comment/47916725
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/29879445
score: 0
has text: the navbar with menus should have been like this whose tempate I am using: https://dl.dropboxusercontent.com/s/e1ard35770w0rx6/prob2.JPG You can also check the sample template: http://dynamicmag-sbtemplates.blogspot.in/ this is what I am using in my site. But the menus are not showing like that

http://stackoverflow.com/comment/51496086
has text: you should have a look to `video.videoHeight` and `video.videoWidth` which will respectively give you the actual height and width of the video stream (640px)
comment on: http://stackoverflow.com/q/29937306
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47838511
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29855916
has text: well, you can. jsut loop over the array, and for each extension, append `a[href$=".png"]` to a string.
score: 0

http://stackoverflow.com/a/29869376
type: Answer
answers question: http://stackoverflow.com/q/29869268
has body: you currently have it looking for an incrementing value which you cant even print out( i++) you have to have it look for i explicitly THEN increment it xmlValues[i][0] .... i++
score: 0

http://stackoverflow.com/comment/47914897
type: QuestionComment
comment on: http://stackoverflow.com/q/29896128
has text: you need to attach to the anchor elements...instead of the document...
score: 0
type: Comment

http://stackoverflow.com/comment/48011271
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29943753
has text: Hmm. Looking at the kendo custom grid editor demo, they refer to the whole object, not a property e.g in this case it would be `field:"City"` and let the template take care of the actual property to display (as you are doing) Can you try that? [demo here](http://demos.telerik.com/kendo-ui/grid/editing-custom) Also, and I presume you have done this, but can you just confirm that the ajax call to `GetCities` is being made and have a look at the response using F12 tools on the browser - just to rule out data format issues, etc.
score: 0

http://stackoverflow.com/q/29848578
favorite count: 0
has body: I keep getting this error but there is nothing I can find about it on the Internet. What I am trying is get value of cmi.location but Chrome console and SCORM Cloud says Set Error State: 403 - The Location field has not been set for this SCO here is my code locIdentifier = Number(scorm.get("cmi.location"));
type: AnsweredQuestion
has title: SCORM 2004 Error 403
type: Question
has answer: http://stackoverflow.com/a/29849507
accepted answer: http://stackoverflow.com/a/29849507
score: 1
tagged with: scorm2004
upvote count: 1
answer count: 1
downvote count: 0
tagged with: scorm
tagged with: javascript

http://stackoverflow.com/a/29958142
answers question: http://stackoverflow.com/q/29958079
has body: Use JQuery Ajax
score: 0
type: Answer

http://stackoverflow.com/comment/47968497
score: 0
type: Comment
comment on: http://stackoverflow.com/q/29907168
has text: Yes , i want to compare via JavaScript.
type: QuestionComment

http://stackoverflow.com/q/29953281
favorite count: 0
has comment: http://stackoverflow.com/comment/48027696
has title: JavaScript alert is not showing in browser
has comment: http://stackoverflow.com/comment/48027981
has body: I can't seem to figure out why an alert won't show in the browser. I am using Chrome with Yosemite. Here is my code in the script.js file: $ (document).one('pageinit', function() { // add handler $ ('#submitAdd').on('tap', addWalk) ; // add a walk function addWalk() { alert (1); } ); And here is the top of index.html: Miletracker
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/48027473
accepted answer: http://stackoverflow.com/a/29953389
downvote count: 2
has answer: http://stackoverflow.com/a/29953404
has comment: http://stackoverflow.com/comment/48027931
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/48027456
has comment: http://stackoverflow.com/comment/48027926
has comment: http://stackoverflow.com/comment/48027866
possible better answer: http://stackoverflow.com/a/29953779
has answer: http://stackoverflow.com/a/29953779
answer count: 3
upvote count: 0
has comment: http://stackoverflow.com/comment/48027735
score: -2
tagged with: javascript
has answer: http://stackoverflow.com/a/29953389

http://stackoverflow.com/a/29890289
score: 2
accepted answer of: http://stackoverflow.com/q/29890022
has body: You just need to add event listener to form so that whenever user select any tag, form should be automatically submitted. var availableTags = [ "NSDL", "CDSL", "ROCA", "NSE", "SEBI" ]; $( "#search" ).autocomplete({ source: availableTags, select: function(event, ui){ $('#search').val(ui.item.value) $('#search_form').submit() } }); Jquery autocomplete plugin provide select callback which is called automatically whenever tag is selected. So submit your search form. I assume your search form has id os 'search_form'. Please replace it with id you applied to form.
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/47905035
upvote count: 2
type: Answer
answers question: http://stackoverflow.com/q/29890022

http://stackoverflow.com/comment/47959520
type: QuestionComment
score: 0
has text: looks like you are using some sort of validation plugin, would be good to include that in your question
comment on: http://stackoverflow.com/q/29919145
type: Comment

http://stackoverflow.com/comment/48007316
type: Comment
type: QuestionComment
has text: @Aracthor that is the error message
score: 0
comment on: http://stackoverflow.com/q/29942098

http://stackoverflow.com/comment/48061035
type: QuestionComment
comment on: http://stackoverflow.com/q/29970544
has text: I think you should use Textarea instead (one line). Please look on this http://stackoverflow.com/questions/11070830/smilies-to-textarea-on-click
score: 0
type: Comment

http://stackoverflow.com/comment/47905864
type: AnswerComment
score: 0
type: Comment
has text: @cannondale there are no `submitButton` element in your html
comment on: http://stackoverflow.com/a/29890821

http://stackoverflow.com/a/45124577
downvote count: 0
score: 3
answers question: http://stackoverflow.com/q/29922150
upvote count: 3
type: Answer
has body: For clarity, here is another example demonstrating erilem's answer with a map var and map div that are not named 'map'. mapElement = '#mapDiv' mymap = new ol.Map({ target: mapDiv, view: new ol.View({ ... }) }); $(mapElement).data('map', mymap); Then you can reference that map with jquery using data with the data method. In my case I then wanted to use the ol updateSize() to update mymap. thisMap = $(mapElement).data('map') thisMap.updateSize(); This is useful when I have more than one map on a page. Where I use: mapDiv = id +'-map' mapElement = '#' + mapDiv maps[i] = new ol.Map({ target: mapDiv, view: new ol.View({ ... }) }); $(mapElement).data('map', maps[i]) And then: thisMapId = activeDataset + '-map' thisMapElement = '#' + thisMapId thisMap = $(thisMapElement).data('map') thisMap.updateSize() Where id = activeDataset

http://stackoverflow.com/q/29888732
type: Question
accepted answer: http://stackoverflow.com/a/29889050
answer count: 3
has comment: http://stackoverflow.com/comment/47901529
tagged with: ruby-on-rails
has body: This is my index.html.erb &lt;% @posts.each do |post| %&gt; &lt;li&gt; &lt;%= post.title %&gt; &lt;%= post.author %&gt; &lt;%= link_to "show", post_path(post) %&gt; &lt;/li&gt; &lt;% end %&gt; I click the "show" anchor and it goes to the show.html.erb for the post. But I don't want an anchor, I just want to be able to click the post itself and go to the show page. What's an easy way of implementing this?
has comment: http://stackoverflow.com/comment/47901239
has answer: http://stackoverflow.com/a/29888892
score: 0
has comment: http://stackoverflow.com/comment/47901241
has answer: http://stackoverflow.com/a/29889050
has title: Call rails "posts#show" action with onclick
possible better answer: http://stackoverflow.com/a/29889009
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29889009
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/a/29940286
accepted answer of: http://stackoverflow.com/q/29921299
score: 3
downvote count: 0
answers question: http://stackoverflow.com/q/29921299
upvote count: 3
type: AcceptedAnswer
type: Answer
has body: Using the fme JavaScript console, I've found a way to solve the problem. It is possible to disable behaviours on a node, include the behaviour that checks for the node being locked. Inside the JavaScript console, this code does what I want: var node = search.findNode(nodeRef); var ctx = Packages.org.springframework.web.context.ContextLoader.getCurrentWebApplicationContext(); var pbf = ctx.getBean("policyBehaviourFilter"); pbf.disableBehaviour(nodeRef); node.addAspect("cm:taggable"); pbf.enableBehaviour(nodeRef); Now the still locked node has the mandatory aspect. It now can be unlocked without any integrity problem.

http://stackoverflow.com/comment/48027926
has text: @lorefnon The question is already answered. So I am just reminding the function of one(), not answering the OP's question
score: 0
comment on: http://stackoverflow.com/q/29953281
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/48096491
has text: Dear Browne: My hands are up. I am unable to do this. Plz download the files and help me get rid of this issue. And send me the package in a zip file plzzzzzz.
comment on: http://stackoverflow.com/a/29982655
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/48103285
type: Comment
comment on: http://stackoverflow.com/a/29991542
score: 0
type: AnswerComment
has text: This didn't work for me. When I type COMPARE('range','range') into my sheet, the cell is blank

http://stackoverflow.com/q/29847390
has comment: http://stackoverflow.com/comment/47820811
type: Question
has comment: http://stackoverflow.com/comment/47820807
upvote count: 0
has title: I want to create only one audio player instance
has comment: http://stackoverflow.com/comment/47820878
answer count: 1
has body: I have used the embed tag to make a playlist. The player is generated each time you click the audio of the list. When you listen to the selected file and then press one of the other files in the list, the player is eliminated and a new player appears. However, instead, I want to show only one player, and reuse it. if (agent.indexOf("chrome") != -1 || agent.indexOf("opera") != -1) { var audio = document.createElement('audio'); audio.setAttribute('id', 'audio'); audio.type = 'audio/wav'; audio.src = files[current]; audio.autoplay = true; a.setAttribute('onclick', 'playlistClick(0)'); a2.setAttribute('onclick', 'playlistClick(1)'); a3.setAttribute('onclick', 'playlistClick(2)'); bottom.appendChild(pop_tit01); bottom.appendChild(audio); bottom.appendChild(mp3_player); bottom.appendChild(re_txt); } else { var pop_tit01 = document.createElement('dl'); pop_tit01.setAttribute('class', 'pop_tit01'); var dt = document.createElement('dt'); var img = document.createElement('img'); img.setAttribute('src', 'images/img/sample_img05.jpg'); var dd = document.createElement('dd'); var strong = document.createElement('strong'); var str = document.createTextNode("default"); var strdd = document.createTextNode("click list"); //top dt.appendChild(img); strong.appendChild(str); dd.appendChild(strong); dd.appendChild(strdd); //top image pop_tit01.appendChild(dt); pop_tit01.appendChild(dd); bottom.appendChild(pop_tit01); a.setAttribute('onclick', 'playlistclick(0)'); a2.setAttribute('onclick', 'playlistclick(1)'); a3.setAttribute('onclick', 'playlistclick(2)'); //bottom.appendChild(audio); bottom.appendChild(re_txt); } function playlistclick(src) { if (!audio) { audio = document.createElement('embed'); audio.setAttribute('id', 'audio'); audio.height = "50"; audio.width = "400"; audio.controls = false; bottom.insertBefore(audio, re_txt); } }
has comment: http://stackoverflow.com/comment/47820404
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/47821049
accepted answer: http://stackoverflow.com/a/29847604
has comment: http://stackoverflow.com/comment/47820755
score: -1
has comment: http://stackoverflow.com/comment/47820916
downvote count: 1
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29847604

http://stackoverflow.com/comment/48108395
comment on: http://stackoverflow.com/q/29994415
has text: Your question doesn't show any research effort. Maybe you tried, but finding a solution to your exact question is probably hard, since it's quite specific. But you have three quite generic problems to solve. 1. Capture the click of an element, 2. Find the parent of an element, 3. Add a class to an element. The solution to each should be easy to find, and after that combining them is trivial.
type: Comment
type: QuestionComment
score: 2

http://stackoverflow.com/a/29937382
has body: I guess you forgot to close toolbar div.
answers question: http://stackoverflow.com/q/29937242
has comment: http://stackoverflow.com/comment/47996515
score: 0
type: Answer

http://stackoverflow.com/comment/48304488
type: QuestionComment
has text: Mateen - one amazing tool! If it would have been an anwer, I would have given it 2 votes up...
score: 0
type: Comment
comment on: http://stackoverflow.com/q/29998033

http://stackoverflow.com/comment/48085588
type: Comment
type: QuestionComment
has text: Can you enter screen shots and also check path of the css and js are correct or not.
comment on: http://stackoverflow.com/q/29983163
score: 0

http://stackoverflow.com/comment/47827612
type: Comment
has text: It should be noted that *just* using canvas will not create a pixel perfect down scaled image. It will produce noise in the photo. For example is you reduce the image by 1/2 then 4 pixels become one. Canvas does not blend those pixels but picks one at random. For more details about how to do pixel perfect down scaling using canvas see this article: http://stackoverflow.com/questions/18922880/html5-canvas-resize-downscale-image-high-quality
score: 2
type: AnswerComment
comment on: http://stackoverflow.com/a/29848855

http://stackoverflow.com/comment/78382383
type: AnswerComment
has text: this is not working in my project, I am using fabricjs canvas under iFrame.
type: Comment
comment on: http://stackoverflow.com/a/30255675
score: 0

http://stackoverflow.com/a/29917483
downvote count: 0
type: Answer
score: 2
answers question: http://stackoverflow.com/q/29917315
has body: Two hide the whole input section, change: verified = $('#id_mod_contracts'); to verified = $('.field-mod_contracts');
upvote count: 2

http://stackoverflow.com/q/29924916
tagged with: javascript
has body: Trying to code a similar feel to the ios8 Lockscreen, having a dragable item only move on the x axis. $( "#IDlsDragable" ).draggable({ axis: "x" }); .lockscreen { position:fixed; top:0px; left:0px; width:100%; height:100%; background-color:rgba(89,54,158,1); background-image:url('../pics/wall.png'); background-size:cover; background-position:center center; } .lockscreenFace { position:absolute; top:0px; left:1080px; width:1080px; height:1920px; } .lockscreenSlider { position:absolute; top:0px; left:-1080px; width:200%; height:100%; } .lockscreenClock { position:absolute; top:110px; left:0px; width:100%; height:300px; font-size: 296px; color:white; text-align:center; } .lockscreenDate { position:absolute; top:432px; left:0px; width:100%; height:80px; font-size: 60px; color:white; text-align:center; } .lockscreenSlideText { position:absolute; bottom:234px; left:0px; width:100%; height:80px; font-size: 80px; font-weight:bold; color:white; text-align:center; background:url('../pics/highlight.png'); -webkit-animation: slidetounlock 3s infinite linear; -webkit-background-clip: text; -webkit-text-fill-color: transparent; } .lockscreenSlideText:before { content: "\f105"; font-family: FontAwesome; font-style: normal; font-weight: normal; font-size:85px; line-height:1; -webkit-font-smoothing: antialiased; } @-webkit-keyframes slidetounlock { 0% { background-position: -880px 0; } 100% { background-position: 0px 0; } } #TIME# #DATE# slide to unlock When I begin to drag it to the right the div "lockscreenSlider" jerks to the right.
has comment: http://stackoverflow.com/comment/47971724
score: 2
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/47971845
favorite count: 0
has comment: http://stackoverflow.com/comment/47971541
has answer: http://stackoverflow.com/a/29925418
upvote count: 2
has comment: http://stackoverflow.com/comment/47971510
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47972073
has comment: http://stackoverflow.com/comment/47971920
has title: jqueryUI Draggable mouse offset
type: Question
tagged with: jquery-ui
has comment: http://stackoverflow.com/comment/47971646

http://stackoverflow.com/a/29949157
downvote count: 0
type: Answer
has body: You can solve it easily changing your submit button by a simple button: $('input[name="finish"]', '.send').on('click', function(){ $(this).prop('disabled', true); $('.send').submit(); });
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/29948912

http://stackoverflow.com/comment/47973138
type: Comment
has text: Understood, but I still don't see the code for the `applicants_search` action. Where's the controller code that this form tag triggers: `<%= form_tag applicants_path, :method => 'get', :id => "applicants_search", remote: :true do %>`
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/29925593

http://stackoverflow.com/q/29860053
downvote count: 2
upvote count: 1
linked to: http://stackoverflow.com/q/750486
has comment: http://stackoverflow.com/comment/47847864
type: Question
has answer: http://stackoverflow.com/a/29873414
tagged with: javascript
has body: i have a trouble with content script. When oi run it with breakpoint its work fine, but without breakpoint not working properly. $(this).html(a.farewell); not update DOM. My manifest contain "run_at": "document_end" $(function () { $(document).ready(function () { console.log("ready!"); var a = "1"; var rows = $("tr.row"); rows.each(function (i) { var id = $(this).attr("data-bull-id"); chrome.runtime.sendMessage({ getStorage: id }, function (response) { a = response; console.log(response.farewell); $(this).html(a.farewell); }); // this.innerHTML = a.test; }); console.log("ready2!"); }); });
has comment: http://stackoverflow.com/comment/47846333
tagged with: google-chrome-extension
has title: Chrome Extension content script DOM not loaded
answer count: 1
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/47848255
accepted answer: http://stackoverflow.com/a/29873414
has comment: http://stackoverflow.com/comment/47845952
has comment: http://stackoverflow.com/comment/47846183
score: -1
type: AnsweredQuestion

http://stackoverflow.com/a/29863705
has body: mDNS is for names local to the network. Globally issued certificates are for names on the internet and can not be used for local names, because there contrary to a globally unique name on the internet local names can be the same in different local networks and thus there is no real owner of the name which can claim a global certificate for it. This means that you can not use the global trust settings (i.e. root CA) available in the browser, but must instead add local trust settings. This can be done by having your own local root CA and trust it within all browsers on the local network or by using self-signed certificates which need to be explicitly trusted by each user. Apart from that just imagine that other developers have the same kind of idea. This would mean that there will be several independent certificates for the same local names, because they are all inside different local networks. So using mDNS names together with https will only make sense in local installation without any kind of mobile clients.
upvote count: 2
accepted answer of: http://stackoverflow.com/q/29863571
has comment: http://stackoverflow.com/comment/47852767
score: 2
answers question: http://stackoverflow.com/q/29863571
type: AcceptedAnswer
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/47852634
has comment: http://stackoverflow.com/comment/47852685

http://stackoverflow.com/comment/48034756
comment on: http://stackoverflow.com/a/29955889
has text: This is wrong. There is no "conservation of space" in SVG. That's an HTML thing.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/47914306
has text: Forgot about this... :)
score: 0
comment on: http://stackoverflow.com/q/29895827
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47993313
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29935706
has text: Sorry, it is correct and it's directly a copy and paste from the angular documents. What I meant is this does not help the post owner in no way nor does this explain the question at hand.

http://stackoverflow.com/comment/47855608
type: AnswerComment
has text: Should i write the entire javascript inside my template in the controller and use it? Edit: Is there any way that i can keep it as a separate file?
type: Comment
comment on: http://stackoverflow.com/a/29865269
score: 0

http://stackoverflow.com/comment/47830367
comment on: http://stackoverflow.com/a/29851669
score: 0
type: Comment
has text: Not the URL @LeonardoFettucciari, the actual code. A URL is not sufficient here.
type: AnswerComment

http://stackoverflow.com/a/29901277
has comment: http://stackoverflow.com/comment/47926573
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 11
has body: The documentation explains "Response from the server must be JSON formatted following JavaScript object:" { // Query is not required as of version 1.2.5 "query": "Unit", "suggestions": [ { "value": "United Arab Emirates", "data": "AE" }, { "value": "United Kingdom", "data": "UK" }, { "value": "United States", "data": "US" } ] } And you are just returning an array without the format value/data. You can change your format in PHP or use the "transformResult" function to create the suggestions property with your array. You should add an object in your PHP code: $obj = new stdClass(); $obj-&gt;suggestions = $a_json; echo json_encode($obj);
upvote count: 11
has comment: http://stackoverflow.com/comment/47926999
has comment: http://stackoverflow.com/comment/47925986
accepted answer of: http://stackoverflow.com/q/29901178
answers question: http://stackoverflow.com/q/29901178

http://stackoverflow.com/comment/48114444
has text: At the moment the JS is part of the HTML (top left) section, so it is displaying it, just not in the correct panel.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29997314

http://stackoverflow.com/q/30001027
tagged with: javascript
tagged with: jquery
score: 0
answer count: 3
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
upvote count: 2
has answer: http://stackoverflow.com/a/30001157
has title: Javascript delay after click, set timeout not working
has answer: http://stackoverflow.com/a/30001209
type: AnsweredQuestion
has body: Thanks in advance for helping. I am new to JavaScript so i think i'm doing something basic incorrectly. I would like 'toggleclass' between class '.fa' and class '.fa-bars fa-times' to take 1 second after i click on class '.ubermenu-responsive-toggle' The toggle between '.fa' and '.fa-bar fa times' after clicking on '.ubermenu-responsive-toggle' works. I just can't get the timeset delay down. I keep getting JavaScript errors in Chrome's inspector. I will put my best guess below. I'm sure this is something simple but, like I said, JavaScript is new territory for me. Thanks again for your help. jQuery(document).ready(function($) { $( '.ubermenu-responsive-toggle' ).on( 'click touchend' , setTimeout(function(){ jQuery( this ).find( '.fa' ).toggleClass( 'fa-bars fa-times' ); }, 1000)); });
downvote count: 2
accepted answer: http://stackoverflow.com/a/30001209
has comment: http://stackoverflow.com/comment/48120974
type: Question
possible better answer: http://stackoverflow.com/a/30001155
has answer: http://stackoverflow.com/a/30001155

http://stackoverflow.com/a/29960640
has body: You are comparing those src values wrong. Use == instead of = if (document.getElementById("imgClickAndChange").src == "../final_copy/img/play.png") { document.getElementById("imgClickAndChange").src = "../final_copy/img/pause.png"; } else { if (document.getElementById("imgClickAndChange").src == "../final_copy/img/pause.png") { document.getElementById("imgClickAndChange").src = "../final_copy/img/play.png"; } }
score: 3
has comment: http://stackoverflow.com/comment/48045916
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/48049404
upvote count: 3
answers question: http://stackoverflow.com/q/29960578

http://stackoverflow.com/q/29967635
has answer: http://stackoverflow.com/a/29968063
accepted answer: http://stackoverflow.com/a/29968063
has answer: http://stackoverflow.com/a/29967675
type: AnsweredQuestion
has title: Delay the subsequent lines
has body: I'm trying to delay executing the subsequent lines something like: //block of code if (//some condition) { delay(1000) } //block of code How can I do that? I tried using while loop something like: var del = 0 setTimeOut(function(){del = 1}, 1000) while (del === 0) {console.log("waiting for 1 second");} But it caused the browser to crash. So is there a statement or a method or function that can do that in a clean way? Note: I don't want to use a setTimeOut to call a function Or is there something like delay in animations like: $("#editor img").on("mouseenter",slideInTag) .delay(1000) .on("mouseenter",slideOutTag);
type: Question
has comment: http://stackoverflow.com/comment/48054872
has comment: http://stackoverflow.com/comment/48054996
tagged with: javascript
has answer: http://stackoverflow.com/a/29967690
has comment: http://stackoverflow.com/comment/48055221
score: 0
has answer: http://stackoverflow.com/a/29967774
answer count: 4
has comment: http://stackoverflow.com/comment/48054859
favorite count: 0
upvote count: 1
possible better answer: http://stackoverflow.com/a/29967690
downvote count: 1

http://stackoverflow.com/comment/47995249
comment on: http://stackoverflow.com/q/29936636
type: Comment
has text: In the jQuery documentation i found this hint: `If $.ajax() or $.ajaxSetup() is called with the global option set to false, the .ajaxStart() method will not fire.` Does that help you?
score: 0
type: QuestionComment

http://stackoverflow.com/a/29861282
answers question: http://stackoverflow.com/q/29860575
has comment: http://stackoverflow.com/comment/47872716
has body: You can't "convert" a promise into an array. A promise is a promise object, that may be fulfilled at some point (if not already fulfilled). They can return results asynchronously. So when you have the line: var companies = adapter.findAll(); The companies variable is a promise that, when fulfilled, will return your data. In other words, companies has a .then() method you should be using. So your ArrayController code would become something like this: export default Ember.ArrayController.extend({ searchText: null, searchResults: [], searchResultUpdater: function(){ var searchText = this.get('searchText'); var adapter = AddressBookAdapter.create(); var companies = adapter.findAll(); if ( ! searchText) { return; } else { var regex = new RegExp(searchText, 'i'); companies.then(function(data) { var results = data.filter(function(c){ return c.match(regex); }); this.set('searchResults', results); }); } }.property('searchText') }); This sets a searchResults property when the promise is fulfilled. Of course, there are probably nicer ways of doing this - Ember provides a lot of tools. Also you may want to do your if (!searchText) bit before you make any ajax requests if you're not going to use the result at all ;)
score: 0
has comment: http://stackoverflow.com/comment/47861815
type: Answer
has comment: http://stackoverflow.com/comment/47861926

http://stackoverflow.com/a/29884994
upvote count: 2
has body: Sending JSON data to your server is just a normal request on a particular path with the data sent as JSON. If the request is a GET, then the data is URL encoded. If the request is a POST, then the data is sent encoded into the body. In either case, the body-parser module will parse it for you. Here's a simple example for a get request to "/response.json": var express = require("express"); var app = express(); var bodyParser = require('body-parser'); app.get('/response.json', bodyParser.json(), function (req, res) { if (!req.body) return res.sendStatus(400); // req.body is the parsed JSON that was sent with this request // process it here }); app.listen(80); There are several different ways to use the body-parser module. You can see several other examples here: How do I consume the JSON POST data in an Express application. And, the client code would be: var $promise = $http.jsonp('/response.json', config)
type: AcceptedAnswer
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/29880721
score: 2
answers question: http://stackoverflow.com/q/29880721

http://stackoverflow.com/a/29977654
score: 0
type: AcceptedAnswer
has body: It is possible to adapt the TopToolbar example to make a persistent toolbar. This javascript stuff is a bit fiddly, so here is the code, and if you want more details on why, let me know. class TweakToolbar(plugins.PluginBase): """Plugin for changing toolbar""" JAVASCRIPT = """ mpld3.register_plugin("tweaktoolbar", TweakToolbar); TweakToolbar.prototype = Object.create(mpld3.Plugin.prototype); TweakToolbar.prototype.constructor = TweakToolbar; function TweakToolbar(fig, props){ mpld3.Plugin.call(this, fig, props); }; TweakToolbar.prototype.draw = function(){ // the toolbar svg doesn't exist // yet, so first draw it this.fig.toolbar.draw(); // then change the toolbar as desired // show toolbar this.fig.toolbar.buttonsobj.transition(750).attr("y", 0); // remove event triggers this.fig.canvas .on("mouseenter", null) .on("mouseleave", null) .on("touchenter", null) .on("touchstart", null); // then remove the draw function, // so that it is not called again this.fig.toolbar.draw = function() {} } """ def __init__(self): self.dict_ = {"type": "tweaktoolbar"} Here is a notebook that shows it in context.
type: Answer
answers question: http://stackoverflow.com/q/29976625
accepted answer of: http://stackoverflow.com/q/29976625

http://stackoverflow.com/comment/47828392
comment on: http://stackoverflow.com/q/29851018
score: 0
type: Comment
type: QuestionComment
has text: More than 1 body tag???

http://stackoverflow.com/a/29951915
has comment: http://stackoverflow.com/comment/48025685
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/48026630
upvote count: 2
has comment: http://stackoverflow.com/comment/48025782
answers question: http://stackoverflow.com/q/29950744
has body: The animation should be possible to achieve using pure CSS. But to set it up and trigger the animation I assume it's ok to use JS? If so, one way to solve it would be to have an element ("circle-wrapper") with a circle element as a child. The circle moves horisontally to the right. By duplicating "circle-wrapper" and rotating each one you can get something like what you describe. JavaScript: for (var i = 0; i &lt; 10; i += 1) { var ang = (i / 10) * 360; $('&lt;div/&gt;') .addClass('circle-wrapper') .append($('&lt;div/&gt;').addClass('red-circle')) .css({ transform: 'rotate(' + ang + 'deg)' }) .appendTo($('body')); } // trigger anim $('button').click(function () { $('.red-circle').addClass('move'); }); CSS: .black-circle { position: absolute; width: 40px; height: 40px; background-color: black; border-radius: 100%; left: 250px; top: 150px; } .circle-wrapper { transform-origin: 10px 10px; position: absolute; left: 260px; top: 160px; width: 200px; border: 1px solid rgba(0, 0, 0, 0.05); } .red-circle { width: 20px; height: 20px; background-color: red; border-radius: 100%; transform: translateX(50px); } .move { animation-name: move; animation-duration: 3s; } @keyframes move { 0% { transform: translateX(50px); } 100% { transform: translateX(200px); } } http://jsfiddle.net/otn0zmb6/1/ In the example, circle-wrapper has been given a width and a border to easier understand what's going on. Also, the button will only trigger the animation once (since the move class is not removed).
has comment: http://stackoverflow.com/comment/48025187
has comment: http://stackoverflow.com/comment/48025080
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29950744

http://stackoverflow.com/comment/47888588
score: 0
has text: jQuery *also* works perfectly fine the way he's using it. I'd put choosing either approach down to personal style, more than anything else.
type: Comment
comment on: http://stackoverflow.com/a/29882264
type: AnswerComment

http://stackoverflow.com/q/29902904
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/47929005
has answer: http://stackoverflow.com/a/29904126
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47928665
linked to: http://stackoverflow.com/q/6223449
type: UnansweredQuestion
type: Question
has body: I have been writing a reusable script, let's call it a plugin although it's not jQuery, that can be initialised in a declarative way from the HTML. I have extremely simplified it to explain my question so let's say that if a user inserts a tag like: &lt;span data-color="green"&gt;&lt;/span&gt; the script will fire because the attribute data-color is found, changing the color accordingly. This approach proved very handy because it avoids anyone using the plugin having to initialise it imperatively in their own scripts with something like: var elem = document.getElementsByTagName('span')[0]; myPlugin.init(elem); Moreover by going the declarative way I could get away without defining any global (in this case myPlugin), which seemed to be a nice side effect. I simplified this situation in an example fiddle here, and as you can see a user can avoid writing any js, leaving the configuration to the HTML. Current situation The plugin is wrapped in a closure like so: ;(function(){ var changeColor = { init : function(elem){ var bg = elem.getAttribute('data-color'); elem.style.background = bg; } }; // the plugin itslef looks for appropriate HTML elements var elem = document.querySelectorAll('[data-color]')[0]; // it inits itself as soon as it is evaluated at page load changeColor.init(elem); })(); The page loads and the span gets the correct colour, so everything is fine. The problem What has come up lately, though, is the need to let the user re-evaluate/re-init the plugin when he needs to. Let's say that in the first example the HTML is changed dynamically after the page is loaded, becoming: &lt;span data-color="purple"&gt;&lt;/span&gt; With the first fiddle there's no way to re-init the plugin, so I am now testing some solutions. Possible solutions Exposing a global The most obvious is exposing a global. If we go this route the fiddle becomes http://jsfiddle.net/gleezer/089om9z5/4/ where the only real difference is removing the selection of the element, leaving it to the us…
has title: How to re-evaluate a script that doesn't expose any global in a declarative-style component
tagged with: declarative
score: 0

http://stackoverflow.com/comment/47960508
has text: @machineaddict If I read it right, he's fetching JSON so no encode is necessary
comment on: http://stackoverflow.com/q/29919622
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/comment/48047651
score: 0
has text: Assuming you are using including the jquery library as you are using $ for that second part where qualification1= $..... ? Also without being able to see the html for the divs we are unable to tell if the problem lies in the js or that the ids are wrong on the divs
comment on: http://stackoverflow.com/q/29961959
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29859935
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47847249
has comment: http://stackoverflow.com/comment/47847147
linked to: http://stackoverflow.com/q/4812784
has comment: http://stackoverflow.com/comment/47847177
type: Question
has comment: http://stackoverflow.com/comment/47845671
has answer: http://stackoverflow.com/a/29860359
tagged with: javascript
has body: I can't seem to get the datepicker to work on this. My Javascript: $(function () { $('.date-picker1').datepicker({ dateFormat: 'yy-mm-dd' }).val(); } ); And this is the function that the button will call once clicked. var count2 = "1"; function addRow2(in_tbl_name) { var tbody = document.getElementById(in_tbl_name).getElementsByTagName("TBODY")[0]; // create row var row = document.createElement("TR"); // create table cell 2 var td2 = document.createElement("TD") var strHtml2 = "&lt;input class='date-picker1' name='date"+count2+"' id='date"+count2+"' /&gt;"; td2.innerHTML = strHtml2.replace(/!count2!/g,count2); row.appendChild(td2); count2 = parseInt(count2) + 1; // append row to table tbody.appendChild(row); }
score: 0
has title: Jquery datepicker doesnt work on appended element
answer count: 1
tagged with: jquery
accepted answer: http://stackoverflow.com/a/29860359
tagged with: datepicker

http://stackoverflow.com/comment/47945996
has text: wouldn't jquery lowercase the map keys too?
comment on: http://stackoverflow.com/q/29911926
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/60121656
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/29879267
has body: in javascript you cant give to a class (constructor function) 2 different prototype object and because inheritance in javascript work with prototype soo you cant do use more than 1 inheritance for one class but you can aggregate and join property of Prototype object and that main property inside a class manually with refactoring that parent classes and next extends that new version and joined class to your target class have code for your question : let Join = (...classList) =&gt; { class AggregatorClass { constructor() { classList.forEach((classItem, index) =&gt; { let propNames = Object.getOwnPropertyNames(classItem.prototype); propNames.forEach(name =&gt; { if (name !== 'constructor') { AggregatorClass.prototype[name] = classItem.prototype[name]; } }); }); classList.forEach(constructor =&gt; { Object.assign(AggregatorClass.prototype, new constructor()) }); } } return AggregatorClass };
upvote count: 1
type: Answer

http://stackoverflow.com/q/29921455
has comment: http://stackoverflow.com/comment/47964363
has comment: http://stackoverflow.com/comment/47964297
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47964319
tagged with: javascript
has comment: http://stackoverflow.com/comment/47964215
has title: Javascript Password Protected area.. must be better way
has comment: http://stackoverflow.com/comment/47964398
type: Question
has answer: http://stackoverflow.com/a/29921650
score: 0
accepted answer: http://stackoverflow.com/a/29921650
answer count: 3
linked to: http://stackoverflow.com/q/28476598
has body: I am still pretty fresh in the javascript scene, but I have this bit of code that works as intended for all intents and purposes.. but there just simply must be a better and cleaner way of going about it, and I would just love to see how it would be accomplished. function Restricted() { var password = 'pass1'; var password1 = 'pass2'; var password2 = 'pass3'; var password3 = 'pass4'; var password4 = 'pass5'; if (this.document.login.pass.value == password || this.document.login.pass.value == password1 || this.document.login.pass.value == password2 || this.document.login.pass.value == password3 || this.document.login.pass.value == password4) { //Do stuff if correct setTimeout(function() { setLocation('#'); }, 2000); } else { //Alert them its wrong } so as you can see.. inputing all the different passwords is fine and to be expected, but the whole checking function of just comparing all the different passwords against eachother to tell if they work must be one of the worst ways of working around this.. haha, it's almost embarrassing as I look at it.
has comment: http://stackoverflow.com/comment/47964387
has comment: http://stackoverflow.com/comment/47965243
has answer: http://stackoverflow.com/a/29921721
tagged with: password-protection
possible better answer: http://stackoverflow.com/a/29921557
has answer: http://stackoverflow.com/a/29921557
has comment: http://stackoverflow.com/comment/47964406
has comment: http://stackoverflow.com/comment/47964540
has comment: http://stackoverflow.com/comment/47964238

http://stackoverflow.com/a/29883294
has body: I guess that the values you are passing should be strings, I honestly doubt that you have declared javascript variables called visible and red anywhere in your page: function facebookButton2() { document.getElementById("notification").style.visibility = 'visible'; document.getElementById("notification").style.color = 'red'; document.getElementById("hello").style.color = 'red'; }
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/29883256
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29883256
type: Answer
has comment: http://stackoverflow.com/comment/47891239

http://stackoverflow.com/comment/47982570
type: Comment
type: QuestionComment
has text: I've got jQuery and lodash.js
comment on: http://stackoverflow.com/q/29929781
score: 0

http://stackoverflow.com/comment/47845013
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29859542
has text: @ethorn10 By caret position, the OP is referring to the position of the insertion point in the text box.

http://stackoverflow.com/q/29941653
tagged with: iframe
has title: Iframe height definition in IE 7
type: Question
tagged with: internet-explorer
has comment: http://stackoverflow.com/comment/48004484
score: 0
has comment: http://stackoverflow.com/comment/48004151
tagged with: javascript
has comment: http://stackoverflow.com/comment/48007563
has comment: http://stackoverflow.com/comment/48010427
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has body: I have a problem with resizing iframe content in IE7. I have an external iframe with width=100%, height=93% and add my page into it. Here is a page body On my page I add resize events. if (window.addEventListener) { window.addEventListener("load", resizeGame, false); window.addEventListener("resize", resizeGame, false); } else if (window.attachEvent) { window.attachEvent("onload", resizeGame); window.attachEvent("onresize", resizeGame); } else { window.onload = function() {resizeGame();}; window.onresize = function() {resizeGame();} } Here is my resizeGame function function resizeGame(isIEResize) { var flash = document.getElementById('flashcontent'); var screen = screenSize(); var width = screen.width; var height = screen.height; var left = 0; var top = 0; if (height * 1.5 > width) { height = width / 1.5 } else { width = height * 1.5; } flash.width = width; flash.height = height; document.getElementById('flashcontent').style.width = width + 'px'; document.getElementById('flashcontent').style.height = height + 'px'; document.getElementById('flashcontent').style.top = '50%'; document.getElementById('flashcontent').style.left = '50%'; if (width < screen.width) { left = (screen.width - width) / 2 + left; } if (height < screen.height) { top = (screen.height - height) / 2; } document.getElementById('game-box').style.top = top + 'px'; document.getElementById('game-box').style.left = left + 'px'; } function screenSize() { var w, h; w = (window.innerWidth ? window.innerWidth : (document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body.offsetWidth)); h = (window.innerHeight ? window.innerHeight : (document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.offsetHeight)); return {width:w, height:h}; } And here is a question: In IE7 function screenSize() gives me wrong height on load. Under other browsers and IE>7 function screenSize() gives me correct height. That's why I can't resize my content properly. And…
answer count: 0
type: UnansweredQuestion

http://stackoverflow.com/q/29897300
has answer: http://stackoverflow.com/a/29897413
linked to: http://stackoverflow.com/q/9538868
has body: I am creating this website and when you click at link at the far right-end of the second row of the header, modal window shows up with youtube videos embedded. When I scroll through the modal, BODY will also scroll and I would like to stop that. How could I do that? Help will be much appreciated! Thank you for your time.
tagged with: css
has comment: http://stackoverflow.com/comment/47917540
type: Question
linked to: http://stackoverflow.com/q/9280258
upvote count: 9
tagged with: modal-dialog
downvote count: 0
has comment: http://stackoverflow.com/comment/90915771
tagged with: javascript
has answer: http://stackoverflow.com/a/47235332
has answer: http://stackoverflow.com/a/29900405
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/40630543
favorite count: 0
has title: disable scroll on body when modal view is opened
has comment: http://stackoverflow.com/comment/47918213
score: 9
has comment: http://stackoverflow.com/comment/47920727
answer count: 5
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47917191
has answer: http://stackoverflow.com/a/29897592

http://stackoverflow.com/comment/47838289
comment on: http://stackoverflow.com/a/29855758
type: AnswerComment
has text: Hello, i updated one last time the answer, i hope thats what you want =)
score: 0
type: Comment

http://stackoverflow.com/a/29882397
upvote count: 3
downvote count: 0
type: Answer
has body: That's what the .map() function does. The .split() call just builds the array over which .map() will iterate. The function passed to .map() is called once for each element in the array (the first argument). Each call is made with three parameters: the value of the element in the array; the index of the element, and the array itself. Your anonymous function just has one argument (which is common), so that'll be the element value.
score: 3
answers question: http://stackoverflow.com/q/29882367

http://stackoverflow.com/q/29959085
possible better answer: http://stackoverflow.com/a/29959247
favorite count: 0
has comment: http://stackoverflow.com/comment/48038824
has answer: http://stackoverflow.com/a/29959247
accepted answer: http://stackoverflow.com/a/29959622
has comment: http://stackoverflow.com/comment/48039154
tagged with: ruby-on-rails
type: AnsweredQuestion
score: 2
upvote count: 2
has title: Avoid multiple javascript_include_tag when rendering collections
type: Question
tagged with: ruby-on-rails-4.2
has answer: http://stackoverflow.com/a/29959622
tagged with: javascript
answer count: 2
tagged with: http://stackoverflow.com/tag/html
has body: I am trying to render a collection this way views/consumer/home/index.html.erb &lt;%= render @promotions %&gt; consumer/promotions/_promotion.html.erb &lt;% content_for :page_js_modules do %&gt; &lt;%= javascript_include_tag 'consumer/carousels' %&gt; &lt;% end %&gt; Since _promotion.html.erb is rendered more than once if there are more than one promotions in @promotions, the javascript tag also gets included more than once and causing issues. I want to put the javascript tag inside of promotion view only so as to make it modular and hence anyone can use it without worrying about including the pertaining js tags.
downvote count: 0

http://stackoverflow.com/a/29865722
answers question: http://stackoverflow.com/q/29865557
has comment: http://stackoverflow.com/comment/47856578
has body: The plugin is custom built by Mark Kennedy for USATODAY. * @classdesc Used for adding dropdown functionality to &amp;lt;select&amp;gt;&amp;lt;/select&amp;gt; elements ONLY.&lt;br/&gt; * For dropdowns that are not select elements (i.e. divs or uls), the {@link ui/dropdown} should be used instead. * @author Mark Kennedy &lt;mdkennedy@gannett.com&gt; * @constructs form/dropdown (Taken from dropdown.js within source code)
score: 0
type: Answer

http://stackoverflow.com/q/29898158
has answer: http://stackoverflow.com/a/29898231
has comment: http://stackoverflow.com/comment/125770056
type: Question
has comment: http://stackoverflow.com/comment/47919148
has answer: http://stackoverflow.com/a/29898220
linked to: http://stackoverflow.com/q/585234
possible better answer: http://stackoverflow.com/a/29898236
tagged with: javascript
upvote count: 4
linked to: http://stackoverflow.com/q/21012580
score: 1
accepted answer: http://stackoverflow.com/a/29898220
favorite count: 0
has answer: http://stackoverflow.com/a/40388573
answer count: 4
has body: I'm working on a simple HTML/Javascript application. This application shows a random text message to the user in a text area. I have 15-20 such text messages of at most 500 characters. I don't want to save these messages in database. I have two scenarios - I have multiple .txt files for each message and then by using javascript only to read a random txt file and display file's content in textarea. User enters a message in a separate text area and by pressing save button, a new txt file for that message should be created. I've been searching how to read / write files in javascript, I found these two posts - Is it possible to write data to file using only JavaScript? and How to read and write into file using JavaScript. But these posts are about reading file on client side or reading file from file input type. https://stackoverflow.com/a/21012689/1930283 This suggestion is about using some server side language. Is there any way to read and write txt files using Javascript only.
type: AnsweredQuestion
downvote count: 3
has answer: http://stackoverflow.com/a/29898236
has title: Read / Write txt file on server using only javascript without involving any server side language

http://stackoverflow.com/comment/47922294
type: Comment
type: QuestionComment
has text: Would [this](http://stackoverflow.com/questions/668720/how-do-i-shift-the-visible-text-in-a-narrow-input-element-to-see-the-cursor-at-th/668856#668856) link work? It's pure JS.
comment on: http://stackoverflow.com/q/29899364
score: 0

http://stackoverflow.com/comment/48190017
score: 0
comment on: http://stackoverflow.com/a/29992874
type: AnswerComment
type: Comment
has text: @ayjay Functionally it seems they are the same. Visually, `catch` is a "if an error happens anywhere in this chain, do something", whereas `then arg 2` is "when something errors in the previous promise".

http://stackoverflow.com/comment/48113727
has text: I don't know those specific libraries, but you can usually just do a feature test to check for the existence of some API that the library implements. if it is present, then the library is present. If the API is not present, then the library is not loaded.
comment on: http://stackoverflow.com/q/29997089
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29894170
has comment: http://stackoverflow.com/comment/47912998
has comment: http://stackoverflow.com/comment/47951889
score: 0
has comment: http://stackoverflow.com/comment/47912506
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47912014
has comment: http://stackoverflow.com/comment/47951812
type: Answer
accepted answer of: http://stackoverflow.com/q/29893629
has comment: http://stackoverflow.com/comment/47913182
answers question: http://stackoverflow.com/q/29893629
has body: Here is simple solution using CSS and HTML, no @media queries no JavaScript, I just modified some lines of HTML and CSS to your code those are below. HTML button 1 button 2 button 3 css /* I wanted to center my loader */ #cycle-loader { height:32px; left:50%; margin:-8px 0 0 -8px; position:absolute; top:50%; width:32px; z-index:999; } /*I want to avoid jumpiness as the JS loads, so I initially hide my cycle*/ #maximage { display:none;/* Only use this if you fade it in again after the images load */ position:fixed !important; } #arrow_left, #arrow_right { bottom:45%; height:67px; position:fixed; right:3%; width:36px; z-index:1000; } #arrow_left { left:3%; } #arrow_left:hover, #arrow_right:hover { bottom:45%; } #arrow_left:active, #arrow_right:active { bottom:45%; } a {color:#666;text-decoration:none;} a:hover {text-decoration:underline;} /*I want to style my pager*/ #cycle-nav { /* float:left;*/ margin-top: 8px; margin-left: 0; text-align: center; } #cycle-nav ul { list-style-type:none; width: 100% } #cycle-nav ul li { /* border:1px solid #FF8000;*/ display: inline-block; margin:3px; } #cycle-nav ul li a { /*background: #057c96;*/ background: #49BED8; float:left; height:10px; margin:2px; width:10px; } #cycle-nav ul li a:hover { background: #000; opacity:0.6; } #cycle-nav ul li.activeSlide { /* border:1px solid #000;*/ /* background: #075262;*/ } #cycle-nav ul li.activeSlide > a { background: #075262; } #controls-wrapper { margin:0 auto; height:42px; width:100%; bottom:70px; z-index:4; background:url(../img/nav-bg.png) repeat-x; position:fixed; } #controls { width: 50%; float: left; } .buton-controls{ width: 50%; float: left; text-align: center; } .buton-controls > div{ display: inline-block; } .button2{ background-color: red; font: 14px/23px 'TitilliumText25L400wt',Arial,sans-serif; height: 20px; opacity: 0.4; text-align: center; width: 70px; color:#FFFFFF; } .button2:hover{ background-color:#000; cursor:pointer; opacity:1 !important; } .button2hoverBg{ background-co…
has comment: http://stackoverflow.com/comment/47951603
has comment: http://stackoverflow.com/comment/47951530

http://stackoverflow.com/a/29914348
type: Answer
upvote count: 1
has body: Since database query is an asynchronous opreation, your variable retValue has not been set yet at the time you call console.log(retValue). var retValue; var query = connection.query('SELECT * FROM tblData;'); query .on('error', function(err) { // Handle error, an 'end' event will be emitted after this as well }) .on('fields', function(fields) { // the field packets for the rows to follow }) .on('result', function(row) { // Pausing the connnection is useful if your processing involves I/O connection.pause(); processRow(row); console.log(retValue); //retValue is now set }) .on('end', function(row) { }); connection.end(); function processRow(rows) { retValue = rows; } console.log(retValue); // undefined, retValue has not been set yet
score: 1
downvote count: 0
answers question: http://stackoverflow.com/q/29913206

http://stackoverflow.com/comment/47837407
type: Comment
has text: @Nooneknows aaand I'm guessing that the other element isn't moving because its position is something other than `position:relative`. Otherwise you could just drop the margin part completely and it would move **relative** to the element above it when it slides out.
type: AnswerComment
comment on: http://stackoverflow.com/a/29855191
score: 0

http://stackoverflow.com/q/29962077
tagged with: jquery
score: -1
accepted answer: http://stackoverflow.com/a/29962231
favorite count: 0
has body: I have a form template : 1 2 3 4 I want when the select tag's value is change (ex : from 1 into 2), the div with id TEMPLATE multiply into 2, Become like this. 1 2 3 4 The number of template have to match with the select value, if the select value is 1, then there will only 1 template div, if 3, then there will be 3 template div. Anybody know how to do it with jquery ?
has title: Multiplying Form Template with Jquery
downvote count: 1
type: AnsweredQuestion
type: Question
has answer: http://stackoverflow.com/a/29962231
upvote count: 0
answer count: 1
tagged with: javascript

http://stackoverflow.com/q/29985360
has comment: http://stackoverflow.com/comment/48090968
tagged with: javascript
has answer: http://stackoverflow.com/a/40516665
answer count: 3
has comment: http://stackoverflow.com/comment/48090926
favorite count: 0
upvote count: 5
tagged with: http://stackoverflow.com/tag/html
tagged with: carousel
possible better answer: http://stackoverflow.com/a/40516665
tagged with: css
has body: Hey lovely StackOverflow Community. I have a problem with my website. I added the Bootstrap Carousel from getbootrap.com and it actually works very well. But there is one problem. Everytime the image sitch, my whole website goes up and down. I don't know what could be the problem, cause i changed nothing on the code from getbootstrap.com :-/ Sorry for my bad english :D Hope you can understand my problem.
has title: Bootstrap Carousel - Whole website jumps when image is changing
type: AnsweredQuestion
tagged with: twitter-bootstrap-3
has answer: http://stackoverflow.com/a/29985410
downvote count: 0
has answer: http://stackoverflow.com/a/29985545
accepted answer: http://stackoverflow.com/a/29985545
type: Question
score: 5

http://stackoverflow.com/comment/48053609
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29963402
has text: Sure, but checking whether you can scroll only tells you if the text is longer than one page or not. You could use that together with dynamically removing and inserting parts of your text instead of working with a span, but the basic principle remains the same.

http://stackoverflow.com/comment/47968716
has text: You would need to show the relevant code. It may be you are ripping out rows that are referenced? Test by changing the `remove()` to `hide()`.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29920842

http://stackoverflow.com/comment/115566638
comment on: http://stackoverflow.com/a/29970547
has text: @Cerbrus yeah, I was busy, sorry.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/47859458
type: AnswerComment
type: Comment
has text: how can i do? I do not find the option !! help!
score: 1
comment on: http://stackoverflow.com/a/29866966

http://stackoverflow.com/comment/48684101
has text: page was active / deactive sorry not able to get anything out of it, please add more information.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29984936
score: 0

http://stackoverflow.com/q/29994249
has answer: http://stackoverflow.com/a/29994332
score: 1
has title: Why does this program keep on running after null is returned?
type: Question
answer count: 2
tagged with: null
upvote count: 1
tagged with: javascript
favorite count: 0
downvote count: 0
type: UnansweredQuestion
has body: I'm learning recursion and I understand how the program generally works, but I'm confused why the program continues to work after null is first returned when the value, at 16, is too big. Basically the code below will run and add 5 to the argument for start each time from 1,6,11 to 16. Since 16 is > 13 it says to return null. How does JavaScript know to go back and try to calculate 13 when it just says return null on line 6? I'd really appreciate any help. Here's the code from the book I'm looking at: function findSolution(target) { function find(start, history) { if (start == target) return history; else if (start &gt; target) return null; else return find(start + 5, "(" + history + " + 5)") || find(start * 3, "(" + history + " * 3)"); } return find(1, "1"); } console.log(findSolution(13));
has comment: http://stackoverflow.com/comment/48108098
has answer: http://stackoverflow.com/a/29994381
tagged with: recursion

http://stackoverflow.com/comment/47978467
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29927888
score: 0
has text: IMHO if you're building a web-based game you shouldn't have to say you support something pre-IE11. Flexbox is the way to go: http://caniuse.com/#feat=flexbox. See also: http://stackoverflow.com/questions/29852531/css-bootstrap-how-to-dynamically-stretch-subdiv-width-to-fit-container-with/29853031#29853031

http://stackoverflow.com/comment/47919620
has text: Yeah that's what I meant, here take a look at the updated fiddle - http://jsfiddle.net/cu7uphcw/5/ I coded what I wrote in the comment. Let me know if it's not clear
score: 1
comment on: http://stackoverflow.com/a/29896864
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/48020722
type: QuestionComment
comment on: http://stackoverflow.com/q/29926388
has text: It's all HTML code. The code I posted is directly from one of the placeholders in question. I think it might be a problem with the angular-material framework.
score: 0
type: Comment

http://stackoverflow.com/comment/47910001
type: AnswerComment
comment on: http://stackoverflow.com/a/29893490
has text: It needs to be dynamic though. Could you do something like: `$state.get(current).views.sidebar.templateUrl`?
type: Comment
score: 0

http://stackoverflow.com/a/30202988
has body: To fake a onclick event from javascript you need to do something like this.. var aTag = document.createElement('a'); aTag.setAttribute('href',"http://www.google.com"); aTag.innerHTML = "link text"; aTag.click() the above code will hit the UIWebViewNavigationType.LinkClicked window.open("http://www.w3schools.com"); the above code will trigger UIWebViewNavigationType.other
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 2
upvote count: 2
accepted answer of: http://stackoverflow.com/q/29902889
answers question: http://stackoverflow.com/q/29902889

http://stackoverflow.com/q/29915613
tagged with: jquery
has comment: http://stackoverflow.com/comment/47954042
score: 0
answer count: 1
tagged with: ajax
has title: Sending Form data by Jquery.ajax including php function in action parameter
type: UnansweredQuestion
has body: I´m developing a wordpress pluging. I have a php file that controll all the plugin and some php class and css files. In the main php file I create a form. When the form is submited, a Jquery.Ajax function catch the form values and send them to a php function defined in the main php file. After this jquery have to give you a alert verification. I know how to send the file imagen. I know hot to send the text values. But I have not idea how to send the file imagen and the text values to my php function in my php main file. Here is my code: PHP main file: Create the form function formulario_nueva_ft(){ $cadena=" $cadena.=" "; $cadena.=" "; $cadena.=" "; $lista=new areatematica; $res=$lista->listarareastematicas(); $cadena.=" "; foreach($res as $valor){ $cadena.=" id_at.'>".$valor->titulo_at." "; } $cadena.=" "; $cadena.=" Online Mixta Presencial "; $cadena.=" "; $cadena.=" "; $cadena.=" loading.. "; $cadena.=" "; $cadena.=" "; echo $cadena; die(); } Here is where I catch the ajax response ,insert data in mysql and upload the image file: function crear_ft(){ $tit=$_POST['tit']; $hor=$_POST['hor']; $req=$_POST['req']; $cod_at=$_POST['cod']; $modalidad=$_POST['mod']; $pdf=$_POST['pdf']; $tabla='ft'; $ft=new curso(); $sourcePath = $_FILES['new_pdf_ft']['tmp_name']; $targetPath = "archivos/".$_FILES['new_pdf_ft']['name']; move_uploaded_file($sourcePath,$targetPath); $ft->set_titulo($tit); $ft->set_horas($hor); $ft->set_requisitos($req); $ft->set_cod_at($cod_at); $ft->set_modalidad($modalidad); $ft->set_pdf($pdf); $ft->set_tabla($tabla); $nada=$ft->insertarcurso(); echo $nada; die(); } And this is my js code: This have to be 'live' method because is about an element that appears after other js event. jQuery('#form_new_ft').live("submit", function(e){ var file = new FormData(jQuery('#form_new_ft')); e.preventDefault(); jQuery("#message").empty(); jQuery('#loading').show(); jQuery.ajax({ url: "/wordpress/wp-admin/admin-ajax.php", type: "POST", contentType: false, processData: f…
tagged with: php
has comment: http://stackoverflow.com/comment/47953006
linked to: http://stackoverflow.com/q/4006520
tagged with: wordpress
has answer: http://stackoverflow.com/a/29916366
type: Question
tagged with: javascript

http://stackoverflow.com/comment/48065766
has text: @Vandervals: You have however overwrite the public methods that access the private variable…
comment on: http://stackoverflow.com/q/29972754
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29999382
type: Question
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/48117947
has comment: http://stackoverflow.com/comment/48118014
has comment: http://stackoverflow.com/comment/48118058
tagged with: asp.net
favorite count: 0
has comment: http://stackoverflow.com/comment/48117911
answer count: 0
has body: I created doughnut chart using chart.js in asp.net(aspx page). But whenever i try to write legend like : tooltipTemplate: "&lt;%= value %>" then it shows me error "The name 'value' does not exist in the current context." Any suggestion?
type: UnansweredQuestion
upvote count: 1
has title: Chart js legend issue in asp.net(aspx page)
has comment: http://stackoverflow.com/comment/48203344
tagged with: charts
score: 1

http://stackoverflow.com/comment/56333595
type: Comment
has text: Hello! This is awesome and helps me a ton. Any idea how I can undo it once I've set it? I need to re-enable selection of text on click of a button. Thanks!
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29908832

http://stackoverflow.com/q/29871496
has comment: http://stackoverflow.com/comment/47878612
has comment: http://stackoverflow.com/comment/47871088
has comment: http://stackoverflow.com/comment/47883228
tagged with: node.js
has comment: http://stackoverflow.com/comment/47870298
answer count: 0
has comment: http://stackoverflow.com/comment/47895364
type: Question
has comment: http://stackoverflow.com/comment/47867981
has comment: http://stackoverflow.com/comment/47867969
tagged with: javascript
tagged with: scope
has comment: http://stackoverflow.com/comment/47870600
score: 0
has comment: http://stackoverflow.com/comment/47883210
has comment: http://stackoverflow.com/comment/47870739
has title: Node.js scope of a variable inside a function
has body: I am just getting started with node.js, and on a small program I am writing I am running into a problem when trying to pass a variable. I have a function which I pass a line I have read from a file. In that function create a Mongoose model of the line and try to save it to the database. That is working fine, however in cases where there is something wrong with the data and it can't be saved to the database I would like to save it to a text file. I added a call to save to the file, the file gets created but is always empty. When debugging the code, The console messages are displayed and it appears that at that point in the execution line is an empty string. Is this the proper way to pass the value ? var parseRecord = function (line) { var arrayOfString = line.toString().split(" "); if (arrayOfString[0].substr(0,1) != '#'){ var dbRecord = new LogEntry({ logDateTime: arrayOfString[0] + ' ' + arrayOfString[1], serverIP: arrayOfString[2], requestMethod: arrayOfString[3], uriStem: arrayOfString[4], serverPort:arrayOfString[6], clientIP:arrayOfString[8], browserType:arrayOfString[9], referrerSite:arrayOfString[10], httpStatus:arrayOfString[11], bytesSent:arrayOfString[12], bytesReceived:arrayOfString[13], elapsedTime:arrayOfString[14] }); dbRecord.save(function (err) { if (err) { // console.log("Skipped one record"); // console.log("This is the skipped line:" + bufferedLine); fs.appendFile('skippedRecords.txt', line, function (err) { if (err) console.log("Could not write skipped record"); }); //skippedRecords++; } else { //insertedRecords++; } }) //dbRecord.print(); } } Thank you for any suggestions. --MD
has comment: http://stackoverflow.com/comment/47883256
type: UnansweredQuestion

http://stackoverflow.com/comment/48082678
comment on: http://stackoverflow.com/a/29961550
type: AnswerComment
score: 0
type: Comment
has text: I've tried putting it in a javascript file and enquired it but it doesn't work (the skrollr effect works when mobile size) I added it to the skrollr.js file itself. When I add it to the bottom after the other scripts it does nothing, when I added it above the other scripts it removes skrollr on all screen sizes

http://stackoverflow.com/q/29921073
answer count: 3
has comment: http://stackoverflow.com/comment/47968167
has comment: http://stackoverflow.com/comment/47963654
possible better answer: http://stackoverflow.com/a/29927749
has comment: http://stackoverflow.com/comment/47966066
has comment: http://stackoverflow.com/comment/47963908
tagged with: jquery
has body: I am trying to call a C# method from jQuery before the PostBack happens. I've seen some solutions involving Ajax, but I am trying to do this from a UserControl (ascx), so I am not sure that calling a [WebMethod] would work. Here is the .ascx markup and .cs code for the button and event: &lt;asp:ImageButton ID="inBottomButton" CssClass="img" title="In Bottom" runat="server" ImageUrl="~/Widgets/QuoteModule/Resources/images/In-Bottom.png" OnClick="inBottomButton_Click" AlternateText="In Bottom"/&gt; protected void inBottomButton_Click(object sender, ImageClickEventArgs e) { QuoteRequest multiQuote = new QuoteRequest { WindPosition = WindPosistions.InBottom }; QuoteResponse quote = ValidateMultiQuoteRequest(multiQuote); ProcessMultiQuoteRequest(quote); } If somebody can help me figure out a way to call the click event from jQuery, I would appreciate it. I know I can prevent the PostBack using (return false;) or preventDefault(e); And I also know that I can check (IsPostBack) on PageLoad but I am already doing that load data, and that would not help me in this situation. A user will click the ImageButton (inBottomButton) and generate data that is submitted through the event. Thanks in advance. EDIT: Instead of downvoting, can I get a suggestion on how to improve this question?
tagged with: asp.net
tagged with: sitefinity
favorite count: 0
has comment: http://stackoverflow.com/comment/47968049
has title: Call method from jQuery before PostBack
has comment: http://stackoverflow.com/comment/47966724
has comment: http://stackoverflow.com/comment/47968274
accepted answer: http://stackoverflow.com/a/29929210
score: 2
linked to: http://stackoverflow.com/q/29948878
upvote count: 3
downvote count: 1
has comment: http://stackoverflow.com/comment/47964588
type: AnsweredQuestion
tagged with: c#
linked to: http://stackoverflow.com/q/19701658
has comment: http://stackoverflow.com/comment/47963958
has comment: http://stackoverflow.com/comment/47964669
has comment: http://stackoverflow.com/comment/47964245
has answer: http://stackoverflow.com/a/29927749
tagged with: javascript
has answer: http://stackoverflow.com/a/29928038
type: Question
linked to: http://stackoverflow.com/q/886903
has answer: http://stackoverflow.com/a/29929210

http://stackoverflow.com/comment/47850358
type: Comment
type: QuestionComment
score: 1
has text: Maybe I'm missing something, but why can't you simply open a new window in JavaScript that launches the picker?
comment on: http://stackoverflow.com/q/29861495

http://stackoverflow.com/q/29912217
type: UnansweredQuestion
tagged with: popup
answer count: 0
upvote count: 3
tagged with: lang
type: Question
has title: CKFinder standalone .popup() setting language does not work
score: 3
has body: Good day. I usually opened CKFinder standalone as following: function browseServer(inputId) { var finder = new CKFinder( ); finder.BasePath = '/ckfinder/' ; finder.SelectFunction = setFileField ; finder.SelectFunctionData = inputId ; finder.Popup() ; } I want to open this with a new language (based on user language), but even hard coded passed language setting does not work. Its opening every time in german actually. I googled and watched into the ckfinder documentations, dont figured out how to let it work. I tried: Delete all cache and cookies // var finder = new CKFinder( ); finder = new CKFinder( ); Delete all cache and cookies Then between the instanciation and .Popup() i tried all constellations of .. // finder.defaultLanguage = 'it'; // finder.language = 'it'; finder.langCode = 'it'; .. with every time deleting all cache and cookies. And all this with and without 'var' before the var declaration and instanciation of 'new CKFinder()'. What i am doing wrong? Tested in FF and Chrome. Thaks all in advance. EDIT: I also tried to pass those lang config possibilities as object into new CKFinder({});
tagged with: javascript
tagged with: ckfinder
downvote count: 0
favorite count: 0

http://stackoverflow.com/a/29939321
has body: Add this in jquery part..see this DEMO $('#CmdAddBranch').click(function(){ $('#TestModal').modal('show'); $('#BC').val("Test") ; $('#B').val("Test"); $('#CID').val("Test"); });
score: 0
type: Answer
answers question: http://stackoverflow.com/q/29937707

http://stackoverflow.com/a/29895842
type: Answer
has body: Event already exists in the global namespace. When you are declaring Event.prototype.overlapsWith Internet Explorer is attaching it to the native Event object not your class declaration. If you have a look at the Event object you can see it there. Easy fix is to not use the name Event. Edit: Nevermind, it seems to work. It still probably isn't a good idea to use the name Event though. Can you add more details about the error?
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/47914460
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29895721
answers question: http://stackoverflow.com/q/29895721

http://stackoverflow.com/q/29897972
has answer: http://stackoverflow.com/a/29929515
tagged with: javascript
tagged with: sorting
answer count: 2
has comment: http://stackoverflow.com/comment/47918903
has answer: http://stackoverflow.com/a/29900483
tagged with: backbone.js
type: UnansweredQuestion
has title: Backbone comparator sort by different field types
has comment: http://stackoverflow.com/comment/47918977
has body: I have a collection that I want sorted by three different fields. One of these fields is a boolean, the other is an integer, and the third is a string. I want my collection of teams to be sorted by the organization_id they belong to first, and then sorted by an is_primary flag (the boolean), and finally I want them to be alphabetized. So ideally my collection would look like this when it's done: Team C (is_primary) (org_id 1) Team A (org_id 1) Team B (org_id 1) Team D (is_primary) (org_id 2) Team A (org_id 2) Team B (org_id 2) Team C (org_id 2) Is there an easy way to do this? I've tried comparator: (team) -&gt; [team.get('organization_id'), team.get('name'), team.get('is_primary')] But that doesn't seem to actually work. Can anyone provide some help here for me?
score: 0
tagged with: coffeescript
type: Question
has comment: http://stackoverflow.com/comment/47919213

http://stackoverflow.com/q/29919596
has body: I am trying to find a way to display all countries list in a dropdown. Is there any short code in PHP or jQuery to get a list of countries on my webpage? Thank you in advance.
tagged with: jquery
has answer: http://stackoverflow.com/a/70517921
favorite count: 0
has title: How do I get a list of countries in my website?
answer count: 5
has answer: http://stackoverflow.com/a/29920109
tagged with: php
has answer: http://stackoverflow.com/a/29919808
type: AnsweredQuestion
upvote count: 19
has answer: http://stackoverflow.com/a/67965920
possible better answer: http://stackoverflow.com/a/70517921
downvote count: 7
type: Question
accepted answer: http://stackoverflow.com/a/61094255
has comment: http://stackoverflow.com/comment/47960340
tagged with: javascript
score: 12
has answer: http://stackoverflow.com/a/61094255

http://stackoverflow.com/comment/48115832
type: QuestionComment
comment on: http://stackoverflow.com/q/29997428
has text: Ah thanks, a friend of mine said the same thing - the URL parameter approach works well. I've added it as an answer!
score: 0
type: Comment

http://stackoverflow.com/comment/47843433
type: AnswerComment
has text: Make sure you have the http:// in front of your url. If necessary, use: $("#bg").css("background", "#f00 url(http://"+imgdefondo+") no-repeat center");
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29858366

http://stackoverflow.com/q/29997895
tagged with: ajax
possible better answer: http://stackoverflow.com/a/29998043
answer count: 2
upvote count: 1
accepted answer: http://stackoverflow.com/a/29997957
favorite count: 0
has answer: http://stackoverflow.com/a/29998043
has comment: http://stackoverflow.com/comment/48115306
has answer: http://stackoverflow.com/a/29997957
type: AnsweredQuestion
has body: Please look at this code on https://jsfiddle.net/safron6/9g98j68g/embedded/result/ I am trying to get the calculated result from the list of APIS and JSON code that is generated to show the precipIntensity. At the end of the code there is an alert and the code works in firebug but nothing is showing up. What may be the reason why the alert does not pop up? var listAPIs = ""; $.each(threeDayAPITimes, function(i, time) { var darkForecastAPI= "https://api.forecast.io/forecast/" + currentAPIKey + "/" + locations + "," + time +"?callback=?"; $.getJSON(darkForecastAPI, { tags: "WxAPI[" + i + "]", //Is this tag the name of each JSON page? I tried to index it incase this is how to refer to the JSON formatted code from the APIs. tagmode: "any", format: "json" }, function(result) { // Process the result object var eachPrecipSum = 0; if(result.currently.precipIntensity &gt;=0 &amp;&amp; result.currently.precipType == "rain") { $.each(result, function() { eachPrecipSum += (result.currently.precipIntensity); totalPrecipSinceDate += eachPrecipSum ; ///Write mean precip alert(eachPrecipSum ); $("body").append("p").text(eachPrecipSum) }); } });
has comment: http://stackoverflow.com/comment/48115296
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/48115348
has title: JS Alert or append is not working on DOM
tagged with: dom
type: Question
tagged with: weather-api
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/48077190
comment on: http://stackoverflow.com/a/29929199
has text: Thanks for the advice, i had the new collection statement in my routes fill but i had an unnecessary id: parseInt(id) instead of just user_id: id
score: 0
type: AnswerComment
type: Comment

cleartimeout
tags question: http://stackoverflow.com/q/29872567
tag name: cleartimeout
type: Tag
tags question: http://stackoverflow.com/q/29941099

http://stackoverflow.com/comment/47920072
has text: if you need it added every time then use addClass
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/29898675

http://stackoverflow.com/q/29908237
tagged with: javascript
has answer: http://stackoverflow.com/a/29908400
favorite count: 0
has answer: http://stackoverflow.com/a/29908302
type: UnansweredQuestion
has body: Let me explain: When you call an alert() in JS, all the code that in below of the alert, will stop and when you click in Ok, the code returns work. I make my own Custom Alert with this code: function cAlert() { var bOn; this.show = function (content) { bOn = true; document.write(' '); $("#cAlertContentBox").html(content); $("#cAlertBox").show(); $("#turnOffLight").fadeIn("fast"); var div = document.getElementById('cAlertBox').offsetWidth; var res = -Math.abs(div / 2); document.getElementById('cAlertBox').style.marginTop = res + "px"; }; this.ok = function () { $("#cAlertBox").hide(); $("#turnOffLight").fadeOut("medium"); bOn = false; }; } and in the other pages: but I have a problem, in login page, after call the cAlert(), I call this: echo " "; to return to the last page, when I used to using the alert(), only after the user click in ok, the browser return to the last page, but using the cAlert, the browser already returns to the last page. What I want is that the user need to click in Ok button to the code continue as an alert().
tagged with: alert
score: 7
upvote count: 7
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/47966403
has title: Stop all the code and continue afterwards, like an alert() in JS
downvote count: 0

http://stackoverflow.com/comment/47844937
type: Comment
comment on: http://stackoverflow.com/q/29859489
score: 0
type: QuestionComment
has text: idk what this garbage does `{% url 'search' %}`. What does the outputted javascript look like? Probably it's supposed to be a string but it's not wrapped in quotes. Check your js errors

http://stackoverflow.com/a/29902884
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/29902766
type: Answer
has body: Well, an arguments list is no structure that can be represented with plain js. To pass multiple function arguments that are encoded as a string, you'd have to use eval('putPage('+arr[i]+')') or better putPage.apply(null, JSON.parse('['+arr[i]+']')); However, your putPage function does not even expect multiple arguments but a single array, so you'd just have to use putPage(JSON.parse('['+arr[i]+']')); I would however recommend to store proper JSON strings or real arrays in your tmpArr in the first place, like var tmpArr = [ ["2015-04-27", "12345", "http://thispage.com/2.html", 1, 1, 0, 0], ["2015-04-25", "34567", "http://thispage.com/2.html", 0, 0, 1, 1], ["2015-04-25", "34567", "http://thispage.com/2.html", 0, 0, 1, 1] ];
downvote count: 0

http://stackoverflow.com/comment/47881363
type: AnswerComment
score: 0
type: Comment
has text: You should be able to generate an api, and then just switch it over to sockets.
comment on: http://stackoverflow.com/a/29874088

http://stackoverflow.com/a/29936674
has comment: http://stackoverflow.com/comment/47995301
has comment: http://stackoverflow.com/comment/47995124
has comment: http://stackoverflow.com/comment/47999966
score: 0
has body: This is very simple using the ng-checked directive &lt;input type="radio" name="XXX" value="add" data-ng-model="XXX" ng-checked="add.new"/&gt;Add If add.new resolves to a truthy value the button will be checked, if not, it will not be checked.
type: Answer
answers question: http://stackoverflow.com/q/29936591
has comment: http://stackoverflow.com/comment/47995803

http://stackoverflow.com/q/29954361
has comment: http://stackoverflow.com/comment/48283591
has answer: http://stackoverflow.com/a/66191047
has answer: http://stackoverflow.com/a/77219863
downvote count: 1
type: Question
type: AnsweredQuestion
score: 26
has title: Prevent PDF auto download by idm using pdf.js
has answer: http://stackoverflow.com/a/30086615
has answer: http://stackoverflow.com/a/30201038
has comment: http://stackoverflow.com/comment/48285491
has answer: http://stackoverflow.com/a/44618145
upvote count: 27
has body: I'm using PDF.Js to embed PDF file for preview, and I removed the script of download and open files from the viewer.js , but when I test the page and PDF file try to show, the Internet Download Manager download it and abort the preview .. after search I found that using object instead of iframe may solve the problem, but it didn't work the pdf viewer appeared white, what can I do to prevent auto download ? or using another way (Plugin) to show PDF file content. '.$pdf_url.'
tagged with: javascript
has answer: http://stackoverflow.com/a/68303978
favorite count: 0
has answer: http://stackoverflow.com/a/73435751
tagged with: pdf.js
tagged with: http://stackoverflow.com/tag/pdf
accepted answer: http://stackoverflow.com/a/30201038
possible better answer: http://stackoverflow.com/a/55710383
has answer: http://stackoverflow.com/a/30152933
has answer: http://stackoverflow.com/a/55710383
answer count: 9
tagged with: iframe

http://stackoverflow.com/a/29890968
has body: From the document As of jQuery 1.8, the .ajaxComplete() method should only be attached to document. So $(document).ajaxComplete(function(event, request, settings){ }); But in your code, there is no need to use ajaxComplete, the success callback will be called only when the ajax call is finished, so you can just check the value of msg directly in it. $.ajax({ type: "POST", url: "check.php", data: "userID=" + usr, success: function (msg) { if (msg == "OK") { $("#userID").removeClass('object_error'); // if necessary $("#userID").addClass("object_ok"); $(this).html('&amp;nbsp;&lt;img src="tick.gif" align="absmiddle"&gt;'); } else { $("#userID").removeClass('object_ok'); // if necessary $("#userID").addClass("object_error"); $(this).html(msg); } } });
type: Answer
has comment: http://stackoverflow.com/comment/47905460
accepted answer of: http://stackoverflow.com/q/29890877
has comment: http://stackoverflow.com/comment/47905548
answers question: http://stackoverflow.com/q/29890877
score: 5
upvote count: 5
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/29877055
tagged with: onclick
downvote count: 1
type: Question
upvote count: 0
tagged with: javascript
score: -1
has answer: http://stackoverflow.com/a/29877134
has body: I need help on my game, in this chase I need help for On-click event. I have a image that for each time I click on it I get 1 score point. I need help to create this quite basic event or someone who be kind enough to write a script for me. I created a basic code for the clicker game: My Work I haven't made that much progress as you can see, I need help with a on-click event in either html or in JavaScript also a score board system would be a nice touch however I can probably figure this out. I got a friend to write some code but time was limited I got a half done code if you like to finish it or to tell me what he was trying to do here is that code: My Work All help is greatly appreciated! :)
tagged with: http://stackoverflow.com/tag/html
answer count: 1
tagged with: events
favorite count: 0
type: UnansweredQuestion
has title: How To Make a Score Event Script for On-click game using purely HTML, css and Javascript
has comment: http://stackoverflow.com/comment/47878378

http://stackoverflow.com/comment/47902108
type: Comment
has text: i want to sum the amount value if the date is same and remaining values are need to be print as it is..
comment on: http://stackoverflow.com/q/29888900
score: 0
type: QuestionComment

http://stackoverflow.com/q/29933897
tagged with: javascript
has answer: http://stackoverflow.com/a/30366920
accepted answer: http://stackoverflow.com/a/30366920
favorite count: 0
has title: how to use createAndFillWorkbook() in exceljs?
has answer: http://stackoverflow.com/a/39242515
upvote count: 5
downvote count: 0
has body: I followed the documentation var workbook = createAndFillWorkbook(); and I get this error Object # has no method 'createAndFillWorkbook' even if I required exceljs already var Excel = require("exceljs"); What I wanted to do was to create a report but I am somehow confused on the documentation because it does not say here how to use the createAndFillWorkbook() method it just says here to use it right away. I referred here in the documentation: https://github.com/guyonroche/exceljs#writing-xlsx
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/39242515
tagged with: exceljs
type: Question
answer count: 2
score: 5

http://stackoverflow.com/comment/48070816
has text: Ooh, I didn't know about the "+=" syntax. While I'm going with the CSS approach, I'll definitely incorporate that nugget into the code. Thanks!
comment on: http://stackoverflow.com/a/29975146
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/29859815
tagged with: polymer
accepted answer: http://stackoverflow.com/a/29862039
tagged with: javascript
has body: You may know that I totally fell in love with Dart and Polymer and once again, I have a question addressing those two technologies. My application is a fairly compex polymer app written in Dart. There are some sort of "pages" whereas a page is shown once the user performed an action. The pages contain various types of content and the number of items can reach from zero to a few hundreds. To enhance the user experience I've build a loader which you can register elements at and once all registered elements loaded, the page is shown. This works and feels pretty amazing but it's way to complicated to make sure to react on all the different states which can occur and overall I am not that happy with the loader thingy. Thus I wanted to ask if there is anything in Dart or Polymer which helps me to show a loading indicator as long as not everything is fully loaded and once it is done, it hides the loader?
type: AnsweredQuestion
score: 2
tagged with: dart
downvote count: 0
has title: Callback in Dart when the page is fully loaded
favorite count: 0
type: Question
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29862039
upvote count: 2
answer count: 1

http://stackoverflow.com/comment/47896433
score: 0
type: Comment
type: QuestionComment
has text: what do you get if you `console.log(FormData.getAll)`
comment on: http://stackoverflow.com/q/29886112

http://stackoverflow.com/comment/48008090
has text: Are you debugging using chrome? If not, could you? The errors are usually more explicit in the chrome console.
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29938992

http://stackoverflow.com/q/29900200
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: php
has comment: http://stackoverflow.com/comment/47923142
has title: Pass mysql table data from php page to bootstrap modal
score: 0
upvote count: 1
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/29900614
tagged with: javascript
has answer: http://stackoverflow.com/a/29901114
answer count: 3
tagged with: bootstrap-modal
tagged with: jquery
favorite count: 0
has body: I have mysql table named project with columns named Project Name, Project Number,Project Status,Project Start Date,Project End Date. Also I have a php page called 'projects.php' where I am displaying the data from mysql table project in the page but I am showing only data from first 3 columns ( Project Name,Project Number,Project Status ). Also for every row in php table I have given a link named view clicking which will trigger a modal. I want to show data from all the columns of that particular row in the modal. Please guide me how I can go forward with this situation. I am very new to php, javascript, jquery. Hence unable to figure out how to pass the data to modal. Following is the code which might help. Table in projects.php: &lt;table class="table table-striped table-condensed"&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;Project Name&lt;/th&gt; &lt;th&gt;Project Number&lt;/th&gt; &lt;th&gt;Project Status&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;?php $sql = "SELECT proj_name, proj_status, proj_num, FROM Project"; $records = mysql_query($sql); while ( $proj = mysql_fetch_assoc($records) ) { echo "&lt;td&gt;".$proj['proj_name']."&amp;nbsp;&amp;nbsp;&lt;a href='#testmodal' data-toggle ='modal'&gt;view&lt;/a&gt;&lt;/td&gt;"; echo "&lt;td&gt;".$proj['proj_num']."&lt;/td&gt;"; echo "&lt;td&gt;".$proj['proj_status']."&lt;/td&gt;"; echo "&lt;/tr&gt;"; } ?&gt; &lt;/tbody&gt; &lt;/table&gt; Following is my modal code: ( which is just basic one ) &lt;div class="modal" id="testmodal"&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;h3 class="modal-title"&gt;&lt;b&gt;Test Modal&lt;/b&gt;&lt;/h3&gt; &lt;/div&gt;&lt;!--end of modal-header--&gt; &lt;div class="modal-body"&gt; This is my test Modal !! &lt;/div&gt; &lt;div class="modal-footer"&gt; &lt;button type="button" class="btn btn-default" data-dismiss="modal"&gt;Clo…
has answer: http://stackoverflow.com/a/29900406

http://stackoverflow.com/comment/47953241
type: QuestionComment
comment on: http://stackoverflow.com/q/29915223
score: 0
type: Comment
has text: If I am not mistaken, the child scope has access to its parents properties without doing anything. The if you care for re-usability you should probably follow the answers described bellow, and pass the property in through an attribute on the child directive.

http://stackoverflow.com/a/29966394
answers question: http://stackoverflow.com/q/29966204
has comment: http://stackoverflow.com/comment/48052794
has comment: http://stackoverflow.com/comment/48052878
upvote count: 1
has comment: http://stackoverflow.com/comment/48056180
type: Answer
has comment: http://stackoverflow.com/comment/48055929
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/48054343
has body: Without any external library, python can't provide GUI features, such as events handling. Listening to an event such onkeydown or onkeyup is thus impossible with the python sdl. If you really want to react to these events, you must use an external library providing event-driven operations, such as the Qt binding PyQt, the TKinter module, or other libraries.
has comment: http://stackoverflow.com/comment/130585701
has comment: http://stackoverflow.com/comment/48053398
has comment: http://stackoverflow.com/comment/48052984

http://stackoverflow.com/a/29909606
has comment: http://stackoverflow.com/comment/47941762
type: Answer
upvote count: 4
accepted answer of: http://stackoverflow.com/q/29909528
downvote count: 0
has body: You can directly use location.pathname this will return you path after hostname Kindly refer this link http://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_loc_pathname
score: 4
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29909528

http://stackoverflow.com/q/29941098
has answer: http://stackoverflow.com/a/29941532
score: 0
answer count: 2
tagged with: setinterval
tagged with: slideshow
tagged with: javascript
has title: Javascript Pic Slideshow Failing?
type: UnansweredQuestion
has body: FOr some reason my code is not executing properly. i am trying to program a slideshow with javascript. Im using a for loop to pull and populate the src files from a created array and change the pic every 3 seconds. THe page loads and the first pic is present but when the interval occurs the first pic dissapears and nothing falls in its place. What am I doing wrong? &lt;img name="mainSlide" id="mainSlide" src="images/mainPagePhotos/facebook-20131027-180258.png" alt=""&gt; var mainSlidePics = ("facebook-20131027-180258.png","IMG_9694116683469.jpg","IMG_28452769990897.jpg"); window.onload = setInterval("mainSlide();", 3000); function mainSlide() { for(i=0; i&lt;mainSlidePics.length; i++ ) { document.images.mainSlide.src = "images/mainPagePhotos/" + mainSlidePics[i]; } }
has answer: http://stackoverflow.com/a/29941442
type: Question

http://stackoverflow.com/a/39776430
type: Answer
answers question: http://stackoverflow.com/q/29998462
score: 0
has body: I found this while looking for a solution to my problem. I was / am working through J Dickey's "Write Modern Web Apps with the MEAN Stack" and my file names, controller names, CDNs, Angular v1.2.18, gulp, etc. etc. are the same. The post is over a year old, but I'm just now getting to this particular book &amp; others with the same problem may well follow. Everything was working just fine until chapter 8 "Adding Routing..." I added ngRoute &amp; ng/routes.js ran $ gulp dev and was expecting the 404 error for the missing templates/posts.html, but got the: "Failed to instantiate module app due to: Error: [$injector:unpr] Unknown provider: $routeProvider ..." error instead. The problem I found was that in chapter 5 we broke up ng/app.js into separate pieces -- I wanted the original for comparison later. So I renamed it ng/app.bak.js and proceeded to pull the parts out into separate files with no problem. In chapter 6 we added in automated build using gulp uglify, annotate, yada yada -- still no problem. In chapter 7 the dependency for ngRoute was added and everything broke (just as the topic of this post). I already knew what K.Torres said just above, but thanks to that post, I looked harder for at that possibly being the problem. With my backup app.js in ng/ it was being combined with the original parts into the "uglified &amp; annotated" assets/js/app.js like so: angular.module("app",["ngRoute"]);angular.module("app",[]);... ng/module.js consists of only "angular.module("app",["ngRoute"])" and is ordered 1st in the build process. The rest are added by wildcard matching on ng/**/*.js -- which included app.bak.js with no dependencies. The second angular.module() was overwriting the first without the needed ngRoute dependency. When I removed app.bak.js from ng/ then assets/js/app.js smooshes like so: angular.module("app",["ngRoute"]),angular.module("app").controller... then I was able to proceed as planned. 8) My lesson: Don't leave unneeded files in build folders. Hope…

http://stackoverflow.com/comment/48073340
comment on: http://stackoverflow.com/q/29976788
score: 0
has text: console error - Cannot read property 'submit' of null
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47968730
type: Comment
type: QuestionComment
has text: joking! that's done it thank you @Daved!
comment on: http://stackoverflow.com/q/29923460
score: 0

http://stackoverflow.com/a/29947219
has comment: http://stackoverflow.com/comment/48017295
score: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29946840
type: Answer
has comment: http://stackoverflow.com/comment/48017430
has comment: http://stackoverflow.com/comment/48016870
has comment: http://stackoverflow.com/comment/48019021
answers question: http://stackoverflow.com/q/29946840
has comment: http://stackoverflow.com/comment/48015660
has body: On your HTML add aside1 and aside2 like so: Long content there: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Social Network Content Kitten Content Then you can use jQuery to call a function on document ready and window resize. Inside the function, you need to calculate .aside1 and .aside2 height with the height() function. Then apply the total (aside1 + aside2) to article. jQuery: $(document).ready(myfunction); $(window).on('resize', myfunction); function myfunction() { var aside1 = $('.aside1').height(); var aside2 = $('.aside2').height(); var total = aside1 + aside2; $('article').css("height", total); }; See an example CodePen.
has comment: http://stackoverflow.com/comment/48016071
has comment: http://stackoverflow.com/comment/48015983

http://stackoverflow.com/q/29903569
has comment: http://stackoverflow.com/comment/47929753
favorite count: 0
has title: Explanation of JavaScript Decimal Rounding example at MDN?
tagged with: tostring
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29903631
has comment: http://stackoverflow.com/comment/47932523
type: Question
tagged with: rounding
has answer: http://stackoverflow.com/a/29903631
tagged with: javascript
has body: I'm learning JavaScript, and I've heard that there can be issues among different browsers when using JavaScript's Math.round() and .toFixed() methods. After researching on this website, the solution I've with the seen with least criticisms are the Decimal Rounding method as illustrated at the MDN. Looking over the code, I'm confused by this part: function decimalAdjust(type, value, exp) { // If the exp is undefined or zero... if (typeof exp === 'undefined' || +exp === 0) { return Math[type](value); } value = +value; exp = +exp; // If the value is not a number or the exp is not an integer... if (isNaN(value) || !(typeof exp === 'number' && exp % 1 === 0)) { return NaN; } // Shift value = value.toString().split('e'); value = Math[type](+(value[0] + 'e' + (value[1] ? (+value[1] - exp) : -exp))); // Shift back value = value.toString().split('e'); return +(value[0] + 'e' + (value[1] ? (+value[1] + exp) : exp)); } Specifically, I'm confused by the line "value = value.toString().split('e');", appearing about five lines from the bottom. From what I gather, JavaScript is changing "value" to text, then splitting it at 'e'. Where is this 'e' coming from? Whenever I use the "toString()" method on a float such as 11.111, I get "11.111". Is the 'e' somehow implied? Is it stored somewhere along with the string? Do they really mean "toExponential()"? Thanks in advance for any input, and I apologize if this is a stupid question. If anyone has a more reliable solution, please feel free to point me in the right direction.
score: 0
upvote count: 1
has comment: http://stackoverflow.com/comment/47929974
has comment: http://stackoverflow.com/comment/47929805
answer count: 1
downvote count: 1

http://stackoverflow.com/comment/49972393
score: 1
has text: Following the same line of thinking with your solution, using a `Function#wrap` call should allow you to call the parent method if you are only extending for specific scenarios ([ref](http://prototypejs.org/doc/latest/language/Function/prototype/wrap/)). eg: `Validation.prototype.isVisible = Validation.prototype.isVisible.wrap(parent, function(elm) { if (condition) return true; else return parent(elm); });`
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29887719

http://stackoverflow.com/a/31034547
score: 0
type: Answer
answers question: http://stackoverflow.com/q/29956581
has body: I have made a couple of edits, but not too much. Just added React.render at the end of your script tag and made a callback to change the text. Which version of React are you running? JS Bin I have also hooked up the update to the toggle text when the function callback was called for event fired working example is here http://jsbin.com/yoseqo/edit?html,output

http://stackoverflow.com/a/29891817
type: Answer
score: 4
upvote count: 4
has body: Addition to stribizhev's answer.. you can use (:\))\B Examples for when to use what: \b : string = That man is batman. regex = \bman\b matches only man and not the man in batman because position between tm is not a word boundary (it is a word). \B : string = I am bat-man and he is super - man. regex = \B-\B matches - in super - man whereas \b-\b matches - in bat-man since position between t- and -m are word boundaries.. and (space) -, - (space) is not. Note: It is easy to understand if you consider \b or \B as a position between two characters and if the transition from character to character is word to word or word to non word
downvote count: 0
answers question: http://stackoverflow.com/q/29891640

http://stackoverflow.com/q/29871722
tagged with: jquery
favorite count: 0
type: Question
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29871768
score: 0
answer count: 2
has body: So I have a function, lets call it calculate(). This pulls data from some forms, and adds it together if the items are checked or filled in and adds those together. For the sake of laziness it looks like this Calculate Total What I want to do sounded easy, but I cannot figure it out. I want to print the result in an alert box. Any help for his newb?
upvote count: 1
downvote count: 1
has title: Print the result of a function in an alert box
has comment: http://stackoverflow.com/comment/47868445
tagged with: javascript
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29871824

http://stackoverflow.com/a/29940241
answers question: http://stackoverflow.com/q/29939748
score: 0
has body: Following should work, you should pass event to function itself: &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;body&gt; &lt;script&gt; function call(e) { var targ; if (e.target) targ = e.target; else if (e.srcElement) targ = e.srcElement; if (targ.nodeType == 3) // defeat Safari bug targ = targ.parentNode; } &lt;/script&gt; &lt;input value="click" type="button" onclick="call(e)" /&gt; &lt;/body&gt; &lt;/html&gt;
has comment: http://stackoverflow.com/comment/48001394
type: Answer
has comment: http://stackoverflow.com/comment/48001660
has comment: http://stackoverflow.com/comment/48001431

http://stackoverflow.com/q/29907721
tagged with: javascript
has comment: http://stackoverflow.com/comment/48024719
has answer: http://stackoverflow.com/a/29953567
has comment: http://stackoverflow.com/comment/48020491
has body: Dropzone works perfectly for everything except passing the file during fallback mode (IE9). Drops work perfect in normal mode, all hidden inputs pass through post perfectly, and all hidden post values work during fallback mode. The only problem is that $_FILES is empty when IE9 forces fallback mode. I do not have any javascript on the page besides the dropzone.js file, as I understood this process was automatic, and according to everything I have read, it should be... right? Here is the code on the HTML side -- cleaned up some PHP elements for clarity: &lt;form action="process/process_file_upload.php" method="post" class="dropzone"&gt; &lt;div class="fallback"&gt; &lt;input name="file" type="file" multiple /&gt; &lt;input type="submit" value="Submit" style="margin-left:8px;"&gt; &lt;input type="hidden" name="calling_dept" value="home.php"&gt; &lt;/div&gt; &lt;input type="hidden" name="dept_id" value=5&gt; &lt;/form&gt;
answer count: 1
downvote count: 0
has title: Dropzone js not passing file in Fallback Mode
favorite count: 0
tagged with: dropzone.js
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/29953567
tagged with: php
type: AnsweredQuestion
upvote count: 3
type: Question
score: 3

http://stackoverflow.com/comment/138443088
type: Comment
has text: this is not working when we use server pagination
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/45883914

http://stackoverflow.com/q/29936355
has comment: http://stackoverflow.com/comment/47997042
has title: jQuery connect with lines
upvote count: 2
has comment: http://stackoverflow.com/comment/47995039
answer count: 1
tagged with: javascript
type: UnansweredQuestion
has body: How can I connect numbers with dotted lines in the below jsfiddle. I want these lines to start from border of inner circle, either from jQuery or from css. I mean around border of inner circle start from inner border edge to number , ....... 1, ..... 2 to show guide lines. http://jsfiddle.net/ineffablep/x03f61db/ function createFields() { $('.field').remove(); var container = $('#container'); for(var i = 0; i &lt; +$('input:text').val()+1; i++) { $('&lt;div/&gt;', { 'class': 'field', 'text': i }).appendTo(container); } } function distributeFields() { var fields = $('.field'), container = $('#container'), width = center.width()*2, height = center.height()*2, angle = 0, step = (2*Math.PI) / fields.length; var radius = width/2; var containerLength=$('input:text').val(); angle=step* (containerLength-1); fields.each(function() { var x = Math.round(width + radius * Math.cos(angle)); var y = Math.round(height + radius * Math.sin(angle)); $(this).css({ right: x + 'px', top: y + 'px' }); angle -= step; }); } var center = $('#center'); $(window).resize(function(height) { $('#container').width($(window).height()*0.9) $('#container').height($(window).height()*0.9) var width = $('#container').width() * 0.4; console.log("width",$('#container').width()); console.log("height",$('#container').height()); var radius = width/2; width += 'px'; radius += 'px'; center.css({ width: width, height: width, '-moz-border-radius' : radius, '-webkit-border-radius' : radius, 'border-radius' : radius }); createFields(); distributeFields(); // rest of your code for font-size setting etc.. }); $(window).resize(); $('input').change(function() { createFields(); distributeFields(); });
linked to: http://stackoverflow.com/q/4576724
score: 2
downvote count: 0
tagged with: jquery
has answer: http://stackoverflow.com/a/29953724
has comment: http://stackoverflow.com/comment/47994959
favorite count: 0
type: Question
linked to: http://stackoverflow.com/q/11299944
tagged with: http://stackoverflow.com/tag/html
tagged with: css

http://stackoverflow.com/comment/47875245
comment on: http://stackoverflow.com/q/29875229
score: 0
has text: i found out in console that mongo is not known. console says: (exports, require, module, __filename, __dirname) { CalEvent = new Mongo.Coll | ^ ReferenceError: Mongo is not defined
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29995292
duplicate of: http://stackoverflow.com/q/19807665
has answer: http://stackoverflow.com/a/29995332
has comment: http://stackoverflow.com/comment/48110163
downvote count: 1
has title: How do I refresh my html page every 2 mins?
type: Question
upvote count: 5
has body: I am currently using an html page for a webview within my iOS and Android apps. I don't want to update the native code and was wondering if I could just refresh the homepage which is index.html every 2 mins? Is it possible?
tagged with: javascript
score: 4
accepted answer: http://stackoverflow.com/a/29995332
has answer: http://stackoverflow.com/a/29995324
has answer: http://stackoverflow.com/a/29995341
favorite count: 0
tagged with: ajax
possible better answer: http://stackoverflow.com/a/29995324
has answer: http://stackoverflow.com/a/29995516
has comment: http://stackoverflow.com/comment/48110480
linked to: http://stackoverflow.com/q/19807665
tagged with: http://stackoverflow.com/tag/html
answer count: 4
type: AnsweredQuestion

http://stackoverflow.com/comment/47963398
comment on: http://stackoverflow.com/a/29920651
type: Comment
score: 0
type: AnswerComment
has text: @TrueBlueAussie Yeah, but that's why I use .indexOf instead of ==

http://stackoverflow.com/comment/47904855
comment on: http://stackoverflow.com/a/29890327
type: Comment
score: 0
type: AnswerComment
has text: thank you for your response, but i want to add it like this [ { email : 'nikola@tesla.com', firstName : 'Nikola', lastName : 'Tesla' }, { email : 'brian@thirdroute.com', firstName : '<%= glksdsd %>Brian', lastName : 'Reavis' }, { email : 'pampersdry@gmail.com', firstName : 'John', lastName : 'Pozy' } ],

http://stackoverflow.com/q/29909012
tagged with: angularjs
type: AnsweredQuestion
score: 2
tagged with: angularjs-ng-show
upvote count: 2
has body: I am trying to figure out how to update my ng-show variable when a state is changed. In my default index.html file I have: &lt;div id="searchBar" ng-show="searchBar" ng-controller="mainController"&gt;&lt;/div&gt; Since this is not part of my page1 template, searchBar does not get updated when a state is changed. The variables are actually changing correctly, but ng-show does not know this. I'm knew to angular, but does anyone have any suggestions on getting ng-show to notice the change in searchBar when it is changed in a controller? var routerApp = angular.module('app', ['ui.router']) .service('MainShared', function () { var MainShared = this; MainShared.searchBar = false; }) .controller('mainController', function($scope, MainShared) { $scope.searchBar = MainShared.searchBar; }); routerApp.config(function($stateProvider, $urlRouterProvider, $locationProvider) { $locationProvider.html5Mode(true); $urlRouterProvider.otherwise('/page1'); $stateProvider .state('page1', { url: '/page1', templateUrl: 'pages/templates/page1.html', controller: 'page1' }); }); routerApp.controller('page1', function($scope, $http, $state, MainShared) { MainShared.searchBar = true; }); EDIT: Let it be known, that from the below answer, you do not need to have a service to do this.
type: Question
has answer: http://stackoverflow.com/a/29909045
tagged with: javascript
answer count: 2
accepted answer: http://stackoverflow.com/a/29909045
has answer: http://stackoverflow.com/a/29909124
downvote count: 0
has title: Updating ng-show from different controller
favorite count: 0
possible better answer: http://stackoverflow.com/a/29909124

http://stackoverflow.com/a/29918397
accepted answer of: http://stackoverflow.com/q/29917984
answers question: http://stackoverflow.com/q/29917984
has body: Hmmm well there are probably several ways to go about this.. Respectfully your code is not one of them. You should avoid "getNthEntry()" at all costs as it's a horrible performer. If you did want to stick with you're solution you should get rid of the for loop and use something where you can do getNextEntry(entry) or a getNextDocument(doc). The SIMPLEST method might be just updating the view if that's an option. The Parent document has a form that's likely different then the response. So you could add a column to the effect of @if(@contains("form", "myParentForm");1;0)... something like that. so you return a 1 if it's a parent and 0 if not. then you set the column to get the total and then use the NotesViewNavigator class to pull that number back. If you didn't want to add a column. Then again you're best solution will likely be with the NotesViewNavigator. This should be VERY FAST. you want to navigate to the first entry - which is likely a Parent. Then you loop through doing getnextSibling to job over any response documents. Should be a lot of examples around but here's one: http://www-12.lotus.com/ldd/doc/lotusscript/lotusscript.nsf/1efb1287fc7c27388525642e0074f2b6/11c5837eb09e23a78525675300720a16?OpenDocument I guess of course you could create a new hidden view that has the same selection formula minus the part that's picking up the responses. If you had a view with only the parents then you could put all the documents or entries into a collection and then simply do collection.getCount()... something like that. Good Luck!
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47959781
type: Answer
downvote count: 0
score: 1

http://stackoverflow.com/a/29970386
type: Answer
answers question: http://stackoverflow.com/q/29968226
score: 1
upvote count: 1
has body: For now, i found a workaround inspired by Filipe Borges suggestion @Html.Raw(Html.Encode(Model.Libelle).Replace("&amp;quot;", "\\\"")) It's very ugly, but at least it solves the problem, I appreciate anyone suggesting a better solution.
downvote count: 0

http://stackoverflow.com/comment/48033635
comment on: http://stackoverflow.com/a/29956301
has text: Still, it may be an issue with javascripts because you will have a different JS configuration that I do. I checked the styles but don't seem to find the issue
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/29880427
tagged with: web
favorite count: 0
type: UnansweredQuestion
has body: I have a typing web game written using JS. The JS contains all the necessary definition and algorithm of the game. There is a global variable called game_mode. By altering this variable to either 0, 1 or 2, I can load different game modes on the webpage. My difficulty is, I can't figure out a way where I can edit game_mode before I load the JS content using HTML. If I load the JS, the JS already starts running and thus the game starts, using the game_mode hard-coded. Is there anyway to do so?
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47885036
has title: How to change a variable in the JavaScript without loading the JavaScript content?
has answer: http://stackoverflow.com/a/29880473
upvote count: 1
downvote count: 1
type: Question
tagged with: javascript
score: 0
answer count: 1

http://stackoverflow.com/comment/76199590
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29905815
has text: this might be irrelevant but have you seen this? - https://github.com/Automattic/mongoose/issues/4847 might solve the error. Who knows. Good luck.

http://stackoverflow.com/q/29850351
favorite count: 0
tagged with: ajax
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29850646
type: AnsweredQuestion
score: 1
has body: I have this HTML: if (isset($listaGrupo)) { $html = ' '; $html .= ' Selecione '; foreach ($listaGrupo as $value) { $html .= '<option value="' . $value['ProcuraProdutoPedOnline']['cd_familia'] . '-' . $value['ProcuraProdutoPedOnline']['cd_depto'] . '-' . $value['ProcuraProdutoPedOnline']['cd_grupo'] . '-' . $value['ProcuraProdutoPedOnline']['cd_grupo_sub'] . '*' . strtoupper(utf8_encode($value['ProcuraProdutoPedOnline']['ds_grupo'] . '-' . $value['ProcuraProdutoPedOnline']['ds_grupo_sub'] . '-' . $value['ProcuraProdutoPedOnline']['ds_depto'])) . '">' . strtoupper(utf8_encode($value['ProcuraProdutoPedOnline']['ds_grupo'] . '/' . $value['ProcuraProdutoPedOnline']['ds_grupo_sub'] . '/' . $value['ProcuraProdutoPedOnline']['ds_depto'])) . ' '; } $html .= ' '; } echo $html; What I want is : When the result comes from DB,the value in the dropdown should be auto selected. My Ajax: function preencherGrupo(obj){ $.ajax({ type: "POST", url: 'url', data: { produto: obj }, dataType: "html", success: function(data) { $(".subgrupo").html(data); } }); } Edit 1: Autofilled two dropdown menu with same information. EDIT : @Diogo Cunha look the images :
upvote count: 1
type: Question
has title: How to AutoSelect a result from DB on dropdown menu ?
accepted answer: http://stackoverflow.com/a/29850646
tagged with: cakephp
tagged with: javascript
answer count: 1
downvote count: 0
tagged with: jquery

http://stackoverflow.com/a/30198748
score: 1
answers question: http://stackoverflow.com/q/29855486
upvote count: 1
has body: Angular exposes the $location service to interact with the window.location object and I'm pretty sure ui-router uses that and not the window.location object directly. You can decorate the $location service from your config function to intercept all calls to the $location service and provide your own implementation that does not use window.location. e.g. (highly simplified): $provide.decorate('$location', function($delegate) { var currentUrl = ''; //we base the proxy on the original var locationProxy = Object.create($delegate); //and overwrite what we need locationProxy.url = function(newUrl) { if (newUrl) { $rootScope.$broadcast('$locationChangeStart' /* other event args here*/); currentUrl = newUrl; $rootScope.$broadcast('$locationChangeSuccess' /* other args here */); } else { return currentUrl; } }; }); It does require you to implement all functions in a compatible way with the original $location service, so it will probably be quite a bit of work.
type: Answer
has comment: http://stackoverflow.com/comment/87030945
downvote count: 0

http://stackoverflow.com/q/29949928
favorite count: 0
has answer: http://stackoverflow.com/a/29950136
type: Question
answer count: 5
tagged with: android
has body: I've spend some time looking around to see if it is possible to access a mobile devices battery status or charge via a web browser API but haven't found any resources or really anything even discussing this topic. This makes me believe it's not possible as it isn't in the spec of whatever reason (security?). Either way I've found that it is possible to get the battery status / charge percentage with iOS, Cordova, PhoneGap, Appcelerator etc.. all of which has an API I might be able to get to work might work for what I am looking into developing. However all of these solutions still would required the app to run as native app — I'm hoping to be able to run it in browser on the device. Is this possible? If so, what browser API should I be looking into?
accepted answer: http://stackoverflow.com/a/29979157
has title: Is it possible to access a mobile devices battery status or charge via a web browser API?
has answer: http://stackoverflow.com/a/34451652
downvote count: 1
possible better answer: http://stackoverflow.com/a/29950197
tagged with: javascript
has answer: http://stackoverflow.com/a/29950197
upvote count: 4
tagged with: mobile
type: AnsweredQuestion
score: 3
has answer: http://stackoverflow.com/a/29979157
tagged with: ios
has answer: http://stackoverflow.com/a/75797910

http://stackoverflow.com/comment/47830666
has text: But that's not how color work. The spectrum youve posted is just displaying hue with 100% saturation and 100% brightnes. Which leaves you with 360 color tones to choose from with HSL (which some answers are referring to). If you really would iterate over all the 16mio colors, it would still go from dark to bright and back and forth.
type: Comment
type: QuestionComment
score: 3
comment on: http://stackoverflow.com/q/29851873

http://stackoverflow.com/comment/59579251
has text: Hi, any progress on the composite option?
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/29906806
type: Comment

http://stackoverflow.com/q/29971898
has title: How to create an accurate timer in javascript?
has answer: http://stackoverflow.com/a/64359475
linked to: http://stackoverflow.com/q/20618355
has answer: http://stackoverflow.com/a/29972039
type: Question
has answer: http://stackoverflow.com/a/52685672
has comment: http://stackoverflow.com/comment/48063580
linked to: http://stackoverflow.com/q/196027
score: 177
has answer: http://stackoverflow.com/a/70749281
has body: I need to create a simple but accurate timer. This is my code: var seconds = 0; setInterval(function() { timer.innerHTML = seconds++; }, 1000); After exactly 3600 seconds, it prints about 3500 seconds. Why is it not accurate? How can I create an accurate timer?
has answer: http://stackoverflow.com/a/67531113
accepted answer: http://stackoverflow.com/a/29972322
upvote count: 177
linked to: http://stackoverflow.com/q/10739835
has answer: http://stackoverflow.com/a/73929764
has answer: http://stackoverflow.com/a/61340507
has answer: http://stackoverflow.com/a/57981688
has answer: http://stackoverflow.com/a/67821759
has answer: http://stackoverflow.com/a/66011886
linked to: http://stackoverflow.com/q/985670
downvote count: 0
tagged with: javascript
answer count: 16
has comment: http://stackoverflow.com/comment/75554461
favorite count: 0
has comment: http://stackoverflow.com/comment/122695072
possible better answer: http://stackoverflow.com/a/44337628
tagged with: time
has answer: http://stackoverflow.com/a/69759466
has answer: http://stackoverflow.com/a/44337628
tagged with: setinterval
has comment: http://stackoverflow.com/comment/48063652
has comment: http://stackoverflow.com/comment/48063517
has answer: http://stackoverflow.com/a/77018921
has answer: http://stackoverflow.com/a/43032890
has comment: http://stackoverflow.com/comment/90865781
has answer: http://stackoverflow.com/a/29972322
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/70019023
has answer: http://stackoverflow.com/a/55266303

http://stackoverflow.com/comment/47926014
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29901613
has text: @PatrickEvans i didn't want to do that because the php i run is decided based on the user so, i have put a if-else statement to decide that ! so i have to pass a parameter in the form u see, so clicking on button will start php based on the category of user
type: Comment

http://stackoverflow.com/a/29863490
downvote count: 0
has body: use this code : see fiddle &lt;div ng-app&gt; &lt;div ng-controller="TodoCtrl"&gt; &lt;div&gt; {{parseDate(test)}} &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; function TodoCtrl($scope) { $scope.test = "1429831430363" $scope.parseDate=function(date) { var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; return months[(new Date()).getUTCMonth()] + ' ' + (new Date()).getUTCDate(); } }
type: Answer
accepted answer of: http://stackoverflow.com/q/29863382
upvote count: 3
answers question: http://stackoverflow.com/q/29863382
score: 3
type: AcceptedAnswer

tablesorter
tags question: http://stackoverflow.com/q/29873053
type: Tag
tag name: tablesorter

http://stackoverflow.com/a/34825639
score: 0
type: Answer
has body: I think what you want is not camera.rotation.y, but instead the azimuth of the camera's world direction. vector = camera.getWorldDirection(); azimuth= Math.atan2(vector.x,vector.z);
answers question: http://stackoverflow.com/q/29999931

http://stackoverflow.com/comment/47918859
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29897540
has text: @Arpit you should be able too though right? it was working on friday
score: 0

http://stackoverflow.com/a/29967684
upvote count: 1
score: 1
accepted answer of: http://stackoverflow.com/q/29965209
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/29965209
has body: Change grandparent.find(".sub-menu:visible").not(current).hide(); to grandparent.find("li .submenu:visible").not(current).hide(); and it worked for me. Here's a working jsFiddle with most of the styling stripped away - http://jsfiddle.net/3xz39smb/
type: Answer

http://stackoverflow.com/q/29889984
has answer: http://stackoverflow.com/a/29890007
possible better answer: http://stackoverflow.com/a/29890100
tagged with: onchange
favorite count: 0
has body: I am having a select box like this Volvo Saab Mercedes Audi If am changing dropdown values carName function is calling and working as expected. If suppose I change the value using jQuery like this $('.cars').val('Audi'); I want that carName() function to be called.How can I do this?
has title: how can i call select box on change while changing select value using jquery?
accepted answer: http://stackoverflow.com/a/29890007
type: AnsweredQuestion
score: 7
tagged with: select
upvote count: 7
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/29890100
downvote count: 0
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/48086202
comment on: http://stackoverflow.com/a/29973193
has text: Well, this is my page structure : Article (right) and two aside (left; on under the other) but it seems like when I load the page, the second aside go under the article and after a seconde take his normale position under the first aside. Have you got an idea if there is a way to make this run directly ? You can see what's going on on the website page i've put in my question :).
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/29938833
has body: I need to get an HTML from another domain, highlight some words in it and display it in an iframe, keeping the look and behaviour of original page. So, I pass the page's URL with Ajax script to a PHP file, which retrieves HTML content with CURL, processes it, and returns it to Ajax script. Then I put processed content into an iframe. Now, everything is OK except that paths to all website's resources are relative to another domain's root (beginning with just '/'), so naturally page inside my iframe is rendered without any CSS, JS, images etc. Also, all website's navigation links are naturally dead. What's the best way to handle this? Especially considering that obtained HTML can also contain paths relative to the document as well.
has answer: http://stackoverflow.com/a/29938995
tagged with: javascript
score: 0
answer count: 1
accepted answer: http://stackoverflow.com/a/29938995
has title: Resolving paths within HTML from another domain
tagged with: path
tagged with: http://stackoverflow.com/tag/html
tagged with: php
type: AnsweredQuestion
tagged with: iframe
type: Question

http://stackoverflow.com/a/29963405
type: Answer
answers question: http://stackoverflow.com/q/29941099
accepted answer of: http://stackoverflow.com/q/29941099
score: 0
type: AcceptedAnswer
has body: Finally made it to work. For posterities... var starr = [ 'bloop the boop', 'cammy the shadow', 'i like cauliflower', 'bro, i kick u hard', 'like measels? I dont.', 'eat fish and pie' ]; var writer = function(){ var timer; this.writeStat = function(str,dest) { var options = { "step" : 8, "fps" : 25, "text" : "" } str = str.split(''); clearTimeout(timer); var ll = ''; (function shuffle(start){ // This code is run options.fps times per second // and updates the contents of the page element var i, len = str.length, el; if(start&gt;=len){ return; } ll = ll + str[start]; $('.'+dest).text(ll); timer = setTimeout(function(){ shuffle(start+1); },1500/options.fps); })(0); } } $(document).ready(function(){ var index = 0; w = new writer; y = new writer; $(document).click(function(){ w.writeStat(starr[index],'t1'); y.writeStat(starr[index],'t2'); if (index == 5) index = 0; else index++; }); }); &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"&gt;&lt;/script&gt; &lt;div class="t1"&gt;&lt;/div&gt; &lt;div class="t2"&gt;&lt;/div&gt;

http://stackoverflow.com/a/29942609
has body: main body: ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Javascript", "javascript:showstring();", true);
answers question: http://stackoverflow.com/q/29942314
type: Answer
has comment: http://stackoverflow.com/comment/48120223
score: 0

http://stackoverflow.com/comment/48079528
type: QuestionComment
comment on: http://stackoverflow.com/q/29979913
has text: What version of jQuery?
score: 0
type: Comment

http://stackoverflow.com/comment/48300063
score: 1
type: Comment
has text: I am trying to understand: When you open your page, the map is shown? Then you select the bbox, do the search and then what? You create a new map? The old map disappears? Maybe a JSFiddle showing your problem would help.
type: QuestionComment
comment on: http://stackoverflow.com/q/29954301

http://stackoverflow.com/comment/47879960
score: 0
has text: Thank you dear. Now ajax request is ok. But have a problem when I get this file to my PHP script. Any idea?
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29877896

http://stackoverflow.com/q/29982289
has body: I need to show a map with multiple markers, Ive found this question which has what I am looking for but the problem is I need to show the marker of each item next to it. &lt;c:forEach var="product" items="products"&gt; ${product.name} &lt;/c:forEach&gt; I also checked the answer of this question but did not help much. Google Map Code var pinColor = "FE7569"; var marker, i; var address=[]; address[0] = "New york"; address[1] = "las vegas"; address[2] = "san francisco"; address[3] = "chicago"; // Set default map center location var latlng = new google.maps.LatLng(latcenter,longcenter); // Create pinShadow for each marker var pinShadow = new google.maps.MarkerImage("http://chart.apis.google.com /chart?chst=d_map_pin_shadow", new google.maps.Size(40, 37), new google.maps.Point(0, 0), new google.maps.Point(12, 35)); // Function to create the dynamic marker function pinImage(i){ return image = new google.maps.MarkerImage("http://www.googlemapsmarkers.com/v1/"+i+"/"+pinColor+"/", new google.maps.Size(21, 34), new google.maps.Point(0,0), new google.maps.Point(10, 34)); } // Function to run once page has loaded function initialize(){ var geocoder=new google.maps.Geocoder(); // Set Default settigns for google map var settings = { zoom: 3, center: latlng, mapTypeControl: true, mapTypeControlOptions: {style: google.maps.MapTypeControlStyle.DROPDOWN_MENU}, navigationControl: true, navigationControlOptions: {style: google.maps.NavigationControlStyle.SMALL}, mapTypeId: google.maps.MapTypeId.ROADMAP}; // Start Google Maps and assign it to div on site var map = new google.maps.Map(document.getElementById("map_canvas"), settings); // loop though total numner of address in array for (var i = 0; i &lt; address.length; i++) { (function(i) { // Use geocoder to grab latlong for user inputed address geocoder.geocode( { 'address': address[i]}, function(results, status) { if (status == google.maps.GeocoderStatus.OK) { // Redefine map center location if (i == 1){ map.setCenter(results[0].geom…
has comment: http://stackoverflow.com/comment/48113521
has answer: http://stackoverflow.com/a/30113653
linked to: http://stackoverflow.com/q/10441537
score: 14
type: AnsweredQuestion
upvote count: 14
has comment: http://stackoverflow.com/comment/48092646
type: Question
linked to: http://stackoverflow.com/q/23185664
tagged with: google-maps
tagged with: jsp
tagged with: javascript
tagged with: jquery
has title: How to show items on google map similar to the way google shows its results
has answer: http://stackoverflow.com/a/30074759
tagged with: google-maps-api-3
answer count: 2
downvote count: 0
accepted answer: http://stackoverflow.com/a/30074759
favorite count: 0
possible better answer: http://stackoverflow.com/a/30113653

http://stackoverflow.com/q/29977389
type: AnsweredQuestion
upvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29977554
favorite count: 0
type: Question
tagged with: http://stackoverflow.com/tag/html
has title: Smooth CSS animation in reverse
tagged with: css
has answer: http://stackoverflow.com/a/29977554
score: -1
downvote count: 1
answer count: 1
has body: I recently came across GotoMeeting's website and I was very taken with the animated footer that slides away after you scroll down a bit. I wanted to re-create it myself and I mostly have it working. Here is my fiddle. The issue I have is that when you scroll up it 'snaps' into place rather than animating back up. What can I do to fix that? Here is my code as well. TRY FOR FREE
tagged with: css-animations

http://stackoverflow.com/comment/47994191
score: 0
has text: @JamesWong, I already edited the question.
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29918859

http://stackoverflow.com/comment/47946891
has text: I do not know jsp very well. I assume that you can visit database and get your sports name list in your jsp file.Then you can write a Java for circle to out.print element
type: Comment
comment on: http://stackoverflow.com/a/29912035
type: AnswerComment
score: 0

http://stackoverflow.com/q/29881132
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/47886484
has comment: http://stackoverflow.com/comment/47886690
answer count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/47886438
has comment: http://stackoverflow.com/comment/47886699
favorite count: 0
downvote count: 5
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
upvote count: 4
has comment: http://stackoverflow.com/comment/47886384
has body: Is it possible to remove all strong tags from HTML page?
has comment: http://stackoverflow.com/comment/47886464
type: Question
has title: How to remove All strong tags from HTML page?
has answer: http://stackoverflow.com/a/29882624

http://stackoverflow.com/comment/47963037
type: AnswerComment
comment on: http://stackoverflow.com/a/29919491
type: Comment
has text: @CraigStanley which part of it doesn't make sense? Do you understand the 1st line? If not, read the documentation for `scandir` at php.net and put `var_dump($images)` after the 1st line. Repeat for the next lines. If you have a specific question I'll be glad to answer it.
score: 0

http://stackoverflow.com/comment/140218429
score: 0
has text: Take a look at UTF "Downwards Arrow Leftwards of Upwards Arrow" - ⇵
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29921896

http://stackoverflow.com/q/29848021
downvote count: 0
accepted answer: http://stackoverflow.com/a/29848271
score: 1
tagged with: spacebars
type: Question
tagged with: mongodb
has answer: http://stackoverflow.com/a/29848271
tagged with: javascript
upvote count: 1
answer count: 1
tagged with: meteor
has title: Meteor JS: How to use Spacebars to display contents inside an array retrieved from Meteor Collection
favorite count: 0
has comment: http://stackoverflow.com/comment/47823783
has comment: http://stackoverflow.com/comment/47823415
has body: I have a collection: MenuItems = new Mongo.Collection('menu_items'); and I also have an array: var arrayToInsert = ['Gemstone', 'Rings']; I then insert this array into the collection via: MenuItems.insert(arrayToInsert); The resulting document inside my mongodb as shown in RoboMongo is: { "_id" : "yRXmFGxLCZXLf9Ynh", "0" : "Gemstone", "1" : "Rings" } In my Template Helper I have: menuItems: function(){ return MenuItems.find(); }, In my .html file I do this: {{#each menuItems}} {{this}} {{/each}} But I only get this output: [object Object] How do I use Spacebars to iterate through this array of data so I may get it to display 'Gemstone' and 'Rings'???? Thank you very much.
type: AnsweredQuestion

http://stackoverflow.com/comment/48020679
has text: @mascaliente check this SO link. http://stackoverflow.com/questions/12945891/responsive-css-circles/14013200#14013200
score: 1
type: Comment
comment on: http://stackoverflow.com/q/29949146
type: QuestionComment

dygraphs
tags question: http://stackoverflow.com/q/30002429
tag name: dygraphs
type: Tag

http://stackoverflow.com/comment/47878603
type: Comment
comment on: http://stackoverflow.com/a/29868736
score: 0
has text: What might work is to embed ` ` instead of extending it, but you still can't get a Dart `Document` instance from `contentDocument`.
type: AnswerComment

http://stackoverflow.com/a/36615836
type: Answer
downvote count: 0
has body: You can use this syntax: const myObject = { first: "one", second: "two", }; for (const [key, value] of Object.entries(myObject)) { console.log(key, value); // first one, second two } However, Object.entries has poor support right now does not work in IE or iOS Safari . You'll probably might need a polyfill. See https://caniuse.com/mdn-javascript_builtins_object_entries for the latest scoop. See also Object.keys to iterate just the keys, or Object.values for just the values.
upvote count: 66
answers question: http://stackoverflow.com/q/29885220
score: 66

http://stackoverflow.com/comment/48116082
type: Comment
comment on: http://stackoverflow.com/a/29998330
type: AnswerComment
score: 0
has text: Thanks. That was very helpful. I didn't know in fact that it was so different.

http://stackoverflow.com/q/29881426
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29881594
score: 1
has title: customizing html5 audio tag, how to add a volume button?
upvote count: 1
has body: I just create a directive in order to set up a live streaming based on the HTML5 tag, but I need to add a volume button, how can I implement it ? Look at the directive var app = angular.module('app', []); app.directive('audioPlay', function() { return { restrict: 'E', link: function(scope, element, attr) { scope.playOrPause = true; var player = element.children('.player')[0]; scope.playMusic = function() { scope.playOrPause = false; player.play(); } scope.stopMusic = function() { scope.playOrPause = true; player.pause(); } } }; }); and here the corresponding html PLAY PAUSE I don't want to implement the basic html5 audio with the controlsattr, I am doing this by myself and all I need is some help with volume button.
type: Question
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29881594
downvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/47886994
favorite count: 0
tagged with: angularjs
tagged with: http://stackoverflow.com/tag/html
tagged with: audio

http://stackoverflow.com/a/29952052
accepted answer of: http://stackoverflow.com/q/29951952
score: 2
answers question: http://stackoverflow.com/q/29951952
downvote count: 0
has body: You wouldn't want to try accomplishing this through styles alone. What you want is a script to help you with syntax highlighting, such as highlight.js, perhaps (https://highlightjs.org/) From the usage site, you can do something like this: This is an example If you'd like to highlight static content rather than anything dynamically, there are tools online to help you with that, such as http://tohtml.com/
has comment: http://stackoverflow.com/comment/48025474
upvote count: 2
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/comment/47890566
has text: Setting "Access-Control-Allow-Origin" to "*" whitelists the entire Internet. It can be useful to test something out. But it shouldn't be done in production. It basically negates the security benefits of CORS.
type: AnswerComment
type: Comment
score: 1
comment on: http://stackoverflow.com/a/29883134

http://stackoverflow.com/a/29956672
type: AcceptedAnswer
downvote count: 0
score: 3
type: Answer
upvote count: 3
accepted answer of: http://stackoverflow.com/q/29955732
answers question: http://stackoverflow.com/q/29955732
has body: I assume you use the jQuery.Chosen plugin. Here's the code: $(document).ready(function() { $('#myModal').on('show.bs.modal', function(e) { console.debug('modal shown!'); $('.chosen-select', this).chosen({width: "350px"}); }); $("#myModal").modal('show'); }); &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.1/jquery.min.js"&gt; &lt;/script&gt; &lt;script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"&gt; &lt;/script&gt; &lt;link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet"&gt; &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/chosen/1.4.2/chosen.jquery.min.js"&gt; &lt;/script&gt; &lt;link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/chosen/1.4.2/chosen.min.css"&gt; &lt;!-- Modal --&gt; &lt;div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"&gt; &lt;div class="modal-dialog"&gt; &lt;div class="modal-content"&gt; &lt;div class="modal-header"&gt; &lt;button type="button" class="close" data-dismiss="modal" 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; Add Group &lt;/h4&gt; &lt;/div&gt; &lt;div class="modal-body"&gt; &lt;div class="form-group"&gt; &lt;label&gt; Class name &lt;/label&gt; &lt;input type="name" placeholder="Choose a name for your group" class="form-control"&gt; &lt;/div&gt; &lt;div class="form-group"&gt; &lt;label&gt; Description &lt;/label&gt; &lt;input type="desc" placeholder="Add a description for your group" class="form-control"&gt; &lt;/div&gt; &lt;div class="form-group"&gt; &lt;label class="font-noraml"&gt; Select &lt;/label&gt; &lt;div class="input-group"&gt; &lt;select data-placeholder="Select a grade..." class="form-control chosen-select" style="width:350px;" tabindex="2"&gt; &lt;option value=""&gt; &lt;/option&gt; &lt;option value="Prekindergarten"&gt; Prekindergarten &lt;/opt…

http://stackoverflow.com/comment/48043217
comment on: http://stackoverflow.com/q/29960326
type: Comment
type: QuestionComment
score: 0
has text: You may want to look at [sleep](https://www.npmjs.com/package/sleep)

http://stackoverflow.com/a/29852103
downvote count: 0
type: Answer
has body: Convert to range the initial value from 1 > 16777216 from 0 > 360 Technique here: Convert a number range to another range, maintaining ratio Then use the HSL colour model, and increment from H0 S100 L100 > H360 S100 L100
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/29851873

http://stackoverflow.com/a/30702194
answers question: http://stackoverflow.com/q/29978957
type: Answer
score: 1
has body: I might have a solution. This might be more of a workaround; I'm kind of new to this as well, and this is just a solution that has worked for me. The solution I've found is to have two sets of data. What you need to do is create a blank set of data — data that has the same length of values, but have them all set to 0 — that gets rendered first. So create a global variable like so: //create before passing data var emptyVar = 0; D3 returns the data as an array of objects. So, you'll need to create an empty array as well: var emptyData = []; The remaining steps take place once the data has been parsed in your "type" function (or while). Within the code you're passing the csv, you'll have to fill in your empty data set with your empty variables. Do this, you'll create a for() statement and pass your imported data as the length of the emptyData's length. That way, your emptyData will be filled with just as many emptyVars as there are variables within your imported data. You do that like so: d3.csv("data2.csv", type, function(error, data) { x.domain([0, d3.max(data, function(d) { return d.value; })]); for(var i = 0;i&lt;data.length;i++){ emptyData[i] = {value:empty[i]}; } Unfortunately, this will return undefined variables, so if you console log emptyData[0].value (note: the data is an array of objects, not just an array. That's how the csv is interpreted, so that's how we're building our empty array) you'll get "undefined". To remedy this, you'll have to pass an if statement that converts all "undefined"s into a 0. That code looks like this: for(i = 0;i&lt;emptyData.length;i++){ if(emptyData[i].value === undefined){ emptyData[i].value = 0; } } If done in the order, you'll have an emptyData set — where all of the values are 0 — that's just as long as your initial, imported csv data set. Now that you have an empty set of data, you can tell D3 to create your bar chart based on the blank data. To fake the "onload" portion of this question, you can then set the second, actual…
upvote count: 1
downvote count: 0

http://stackoverflow.com/comment/48090356
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29985545
type: Comment
has text: Hey, thank you! With your solution i have no black bar, but another problem. Now the image looks squished, when i make the browser smaler :-/

http://stackoverflow.com/a/29943214
has comment: http://stackoverflow.com/comment/54346766
score: -1
has comment: http://stackoverflow.com/comment/54471531
type: AcceptedAnswer
downvote count: 1
has comment: http://stackoverflow.com/comment/54346861
type: Answer
accepted answer of: http://stackoverflow.com/q/29936825
answers question: http://stackoverflow.com/q/29936825
upvote count: 0
has body: Flashfox works.My code has no peoblem.

http://stackoverflow.com/comment/48075937
comment on: http://stackoverflow.com/q/29977782
score: 0
has text: Why not try it out? Nobody's clear as to what your actual problem is.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29850865
type: Question
has title: autoFocus Directive not working in firefox
upvote count: 2
answer count: 1
has comment: http://stackoverflow.com/comment/47835247
has answer: http://stackoverflow.com/a/29851188
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47835465
has body: I wrote a directive that didn't work in firefox (version 36.00) . this should be the same with atuofocus attribute in html 5. Here is the code : app.directive('autoFocus', function($timeout) { return { restrict: 'AC', link: function(_scope, _element) { $timeout(function(){ _element[0].focus(); }, 0); } }; }); DEMO Any idea ? Thanks
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/47828186
favorite count: 0
tagged with: angularjs

http://stackoverflow.com/q/29877192
has title: Minecraft Color Formatting
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/30280245
downvote count: 2
upvote count: 1
type: Question
tagged with: minecraft
tagged with: javascript
tagged with: jquery
score: -1
tagged with: colors
has answer: http://stackoverflow.com/a/30280245
answer count: 1
has body: I'd like to format this to css colors: &lt;div id="test"&gt;§2§l&lt;&lt;§6§lStack§6§lOverflow§6§lIV§2§l&gt;&gt;&lt;/div&gt; I've found a Jquery plugin, but I don't know how to use it. There is no sample code / documentation. JsFiddle: https://jsfiddle.net/jeroen_13/rhydg6Le/ Github plugin: https://gist.github.com/JLChnToZ/bde5ea7ade5db37d5e72 Minecraft Color Codes: http://ess.khhq.net/mc/ Could anyone point me in the right direction on how to use the library?
has comment: http://stackoverflow.com/comment/47879082
favorite count: 0
tagged with: css

http://stackoverflow.com/comment/47827153
type: Comment
type: QuestionComment
has text: then why don't you enlarge the viewbox?
comment on: http://stackoverflow.com/q/29850521
score: 0

http://stackoverflow.com/comment/48237830
has text: re Firefox: it will slowly go "weird" after a while… hard to explain but becomes evident when changing tabs, zooming and such: http://mgiraldo.github.io/inspectorviz/
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29998551
type: Comment

http://stackoverflow.com/comment/48071096
comment on: http://stackoverflow.com/q/29973075
has text: does the `onClick` that was added above to the ContentPane get **fired**? you can check by adding a console.log statement in the onClick function handler. I hope you have added the onClick function handler to **All** the content panes.
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/48005004
score: 0
type: AnswerComment
has text: I tried this code, but doesn't loads data. I don't need any database actions, Is there any other ways to write back excel file, other than this database 'query2'.
type: Comment
comment on: http://stackoverflow.com/a/29940418

http://stackoverflow.com/a/29948359
downvote count: 0
answers question: http://stackoverflow.com/q/29948301
type: Answer
upvote count: 3
score: 3
has body: When you set a variable to a reference to an object (a function, in this case), it gets a copy of that reference value. Subsequent changes to other variables or object properties that share that reference value won't have any effect on the copy you made. It should be clear what's going on here, right? var a = 2; var b = a; console.log(b); // 2 a = 3; console.log(b); // still 2 Object references work the same way: var a = { hello: "world" }; var b = a; console.log(b.hello); // world a = { hello: "goodbye" }; console.log(b.hello); // still world Variable a got a new value, but that didn't affect b at all. The assignment operator = makes copies of values. There's no way to make one JavaScript variable (object property) be an alias for another.
has comment: http://stackoverflow.com/comment/48044392

http://stackoverflow.com/a/29877996
has comment: http://stackoverflow.com/comment/47992424
has body: Make sure that you are using a local server in order to run your application, as the XMLHttpRequest denotes that your application is making an asynchronous call. Just try deploying your application on a local server(you can use apache tomcat). Else you don't have one, use can make use of any IDE that's having its own local server(like brackets), so will not require to create/install a local server manually.
type: Answer
answers question: http://stackoverflow.com/q/29876454
has comment: http://stackoverflow.com/comment/47941966
score: 0

http://stackoverflow.com/comment/48040530
type: AnswerComment
has text: Oh, I forgot "var" before the Availablewimdows and before newWindow
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29953878

http://stackoverflow.com/comment/47873200
type: Comment
has text: Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/76269/discussion-between-deb-and-jwatts1980).
comment on: http://stackoverflow.com/q/29873733
score: 0
type: QuestionComment

http://stackoverflow.com/comment/47991249
comment on: http://stackoverflow.com/q/29934596
has text: where is the script in this line
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29990393
tagged with: javascript
score: 0
answer count: 1
tagged with: tinymce
has comment: http://stackoverflow.com/comment/48100182
has title: Using Javascript to detect real text, not HTML tags
tagged with: angularjs
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/48100304
type: Question
has answer: http://stackoverflow.com/a/29990677
accepted answer: http://stackoverflow.com/a/29990677
has body: I'm having an issue where I use a WYSIWYG editor (TinyMCE) to save content into the database, and sometimes values get saved that don't real content, but only tags like: &lt;p&gt;&lt;br data-mce-bogus="1"&gt;&lt;/p&gt; which isn't real content. So my application can't tell when there's real content versus some invisible HTML tags. How can I use JS to reliably detect when there's real content, or invisible tags? Note that simple checks for "&lt;br&gt;" won't work because additional attributes like data-mce-bogus="1" may exist, and others I haven't seen before. Ideally my editor will detect this when content is updated, and save an empty string in the DB if there's no "real" content detected. My app is in Angular JS, so I need it in JS, not server-side.

http://stackoverflow.com/a/29880517
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/47899378
upvote count: 1
has body: Here's a short PHP solution $pageid = uniqid(); copy('template.html', $pageid . '.html'); print "Editable page is at: " .$pageid . ".html"; Add this somewhere in the template.html: &lt;?php if (str_replace(' ', '', preg_replace('/\.html/', '', basename($_SERVER['PHP_SELF']))) !== 'template') { print "&lt;script&gt; var elems = document.getElementsByTagName('*'), i; for (i = 0; i &lt; elems.length; i += 1) { elems[i].setAttribute('contentEditable', 'true'); } window.onbeforeunload = function(){ var a = new XMLHttpRequest() || new ActiveXObject('Microsoft.XMLHTTP'); a.onreadystatechange = function (b) { if(a.readyState==4&amp;&amp;a.status==200){ } } xmlhttp.open('POST','remove_template.php',true); xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded'); xmlhttp.send('id=" . str_replace(' ', '', preg_replace('/\.html/', '', basename($_SERVER['PHP_SELF']))) . "'); } //Custom JavaScript goes here &lt;/script&gt;"; } ?&gt; Then remove_template.php is: if ($_POST['id'] != 'template' &amp;&amp; ctype_alnum($_POST['id'])) { unset($_POST['id']); } You should obviously change what urls to your needs, also remove_template.php is kinda insecure. I haven't tested this yet. If you ever add a user system. Made the $pageid link to their user account. Then just pass an if to not add the window.onbreforeunload
score: 1
answers question: http://stackoverflow.com/q/29880363

http://stackoverflow.com/comment/47877777
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29874816
has text: How less? Every line of code we used is necessary to achieve this.
score: 0

http://stackoverflow.com/q/29928748
linked to: http://stackoverflow.com/q/4609279
type: Question
has title: CSS line break after n list item `inline-block`
tagged with: javascript
answer count: 2
accepted answer: http://stackoverflow.com/a/29929761
linked to: http://stackoverflow.com/q/17768902
tagged with: angularjs
has comment: http://stackoverflow.com/comment/47980273
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47980476
tagged with: css
possible better answer: http://stackoverflow.com/a/29930024
has comment: http://stackoverflow.com/comment/47980360
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29930024
has comment: http://stackoverflow.com/comment/47980131
has body: I have a problem to add a line break after a N (3 for example) elements of a list: I have tried to do like this Q/A solution (using :nth-child(3):after { content:"\A"; white-space:pre; }) tells but id didn't work for me. Here is my css .lk-color-chooser { list-style-type: none; padding-left: 0; } .lk-color-chooser__color { display: inline-block; width: 30px; height: 30px; border-radius: 50%; margin-right: 5px; cursor: pointer; opacity: 0.5; filter: alpha(opacity=50); } .lk-color-chooser__color:hover, .lk-color-chooser__color.selected { opacity: 1; filter: alpha(opacity=100); } .lk-color-chooser__color:last-child { margin-right: 0; } Here is a plunker The code is done in angular but the problem is a css one. Here is one of the list element : &lt;li class="lk-color-chooser__color ng-scope ng-isolate-scope" style="background-color: #72C2FF" ng-repeat="color in colors track by $index" color="color" ng-class="{'selected': selectedColor == color}"&gt;&amp;nbsp;&lt;/li&gt; Thanks in advance,
score: 0
has answer: http://stackoverflow.com/a/29929761
has comment: http://stackoverflow.com/comment/47981395
has comment: http://stackoverflow.com/comment/47980418

http://stackoverflow.com/comment/48095907
comment on: http://stackoverflow.com/a/29987245
score: 0
type: AnswerComment
type: Comment
has text: Wow, that was your article? I totally read that one a few times already! However, I felt intimidated with the "pending requests" idea. I wasn't sure how to apply it.

http://stackoverflow.com/comment/47946175
type: QuestionComment
has text: Why are you not using http://getbootstrap.com/javascript/#tabs for your tabbed interface. if you use this you don't have to write your own js for this
comment on: http://stackoverflow.com/q/29912015
score: 0
type: Comment

http://stackoverflow.com/comment/47866544
comment on: http://stackoverflow.com/q/29870586
has text: Check your "searchVal" if you're passing in the right value when you do your Meteor.call().
score: 1
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/48006571
type: QuestionComment
score: 2
has text: Try saving the resulting page source and trying that directly, to cut PHP out of the equation.
comment on: http://stackoverflow.com/q/29942813
type: Comment

http://stackoverflow.com/comment/48063344
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29971384
has text: I have this KeyboardService that tracks when keys are pressed and stores events. It should only do it on page A. When I click a link to page B, the KeyboardService messes with the functionality of the page. Upon refreshing page B, the KeyboardService disappears and the page functions normally.
score: 0

http://stackoverflow.com/comment/48078950
type: Comment
has text: As a side note it is good to know that I can inject providers into any function.Although its frequency of use is another discussion.
type: AnswerComment
comment on: http://stackoverflow.com/a/29976957
score: 0

http://stackoverflow.com/a/29952216
has comment: http://stackoverflow.com/comment/48026517
score: 2
has comment: http://stackoverflow.com/comment/48026296
upvote count: 2
has comment: http://stackoverflow.com/comment/48029890
answers question: http://stackoverflow.com/q/29949483
has comment: http://stackoverflow.com/comment/48026096
has comment: http://stackoverflow.com/comment/48026142
downvote count: 0
has body: So, like others, I am puzzled a bit by what you are trying to do. There seems to be a break in consistency with the examples you gave. If you want to highlight along the x,y axis then it would be a little different than what you have shown. Either way, I threw this together, perhaps it will get you started: Plunker It does what is shown in picture 1 and 3, though not picture 2. $scope.boxes = ['one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine'] $scope.boxClass = ['cOne', 'cTwo', 'cThree', 'cFour', 'cFive', 'cSix', 'cSeven', 'cEight', 'cNine'] $scope.boxes.reverse(); console.log($scope.boxes) $scope.findChecked = function () { for (var i = 0; i &lt; $scope.boxes.length; i++){ if ($scope[$scope.boxes[i]]) { $scope.currentBox = 9 - i console.log($scope.currentBox) break; } } for (var x = 0; x &lt; $scope.boxClass.length; x++) { if (x &lt; $scope.currentBox) { $scope[$scope.boxClass[x]] = 'checked' } else { $scope[$scope.boxClass[x]] = '' } } } If you want to highlight along along x,y coordinates, you can do it like this: var row1 = ['cOne', 'cTwo', 'cThree']; var row2 = ['cFour', 'cFive', 'cSix']; var row3 = ['cSeven', 'cEight', 'cNine']; var col1 = ['cOne', 'cFour', 'cSeven']; var col2 = ['cTwo', 'cFive', 'cEight']; var col3 = ['cThree', 'cSix', 'cNine']; var rows = [row1, row2, row3]; var cols = [col1, col2, col3]; $scope.setXY = function(x, y) { console.log(x, y) var i = 0, z = 0; for(i = 0; i &lt; rows.length; i++) { for(z = 0; z &lt; rows[i].length; z++) { $scope[rows[i][z]] = ''; $scope[cols[i][z]] = ''; } } for(i = 0; i &lt; 3; i++) { $scope[rows[y][i]] = 'checked'; $scope[cols[x][i]] = 'checked'; } } Plunker (I used buttons this time...works a bit better)
has comment: http://stackoverflow.com/comment/48026215
type: Answer
has comment: http://stackoverflow.com/comment/48026027

http://stackoverflow.com/q/29944004
accepted answer: http://stackoverflow.com/a/29944034
type: AnsweredQuestion
has title: getElementsByTagName is not a function
upvote count: 10
possible better answer: http://stackoverflow.com/a/29944103
type: Question
has answer: http://stackoverflow.com/a/29944103
score: 10
tagged with: javascript
has answer: http://stackoverflow.com/a/29944051
has answer: http://stackoverflow.com/a/29944396
has comment: http://stackoverflow.com/comment/48008767
linked to: http://stackoverflow.com/q/10693845
has answer: http://stackoverflow.com/a/29944034
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
answer count: 4
duplicate of: http://stackoverflow.com/q/10693845
favorite count: 0
has body: I am really struggling this. I am wanting to change the src attribute of an img tag and get the error message getElementsByTagName is not a function. The following is my test markup &lt;html&gt; &lt;body&gt; &lt;div class="logo"&gt; &lt;img src="/a.jpg"&gt; &lt;/div&gt; &lt;script&gt; document.getElementsByClassName('logo').getElementsByTagName('img')[0].src ="/b.jpg"; &lt;/script&gt; &lt;/body&gt; &lt;/html&gt; Any advice is appreciated.

http://stackoverflow.com/q/29856507
tagged with: php
answer count: 1
has title: push javascript array through jquery
has answer: http://stackoverflow.com/a/29856556
has body: I need to pass in a javascript array into jquery but my code is only returning [object object] $( "#enviar" ).click(function() { var data = {}; var i = 0; var u = -1; $.each($('.ui'), function() { data[i] = this.value; i++; }); console.log(data); $.ajax({ type: "POST", url: "send_car.php", data: "photo="+data+"&amp;u="+u, success: function(data){ }//end success })//end ajax submit*/ }); console log is showing the array Object {0="d-170", 1="d-171"} but the data is being pass as [object object] ui class is a hidden input with the same name and different values. I have read various post and tried with serialize but I get the same results.
type: AnsweredQuestion
tagged with: arrays
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
accepted answer: http://stackoverflow.com/a/29856556
type: Question
score: 1
upvote count: 1

http://stackoverflow.com/a/30001209
has body: Be carefull with object "this" inside a setTimeout or setInterval function, because maybe could not be the object that you expect, try this: jQuery(document).ready(function($) { $( '.ubermenu-responsive-toggle' ).on( 'click touchend' , function() { var $myToggles = $(this).find( '.fa' ); setTimeout(function() { $myToggles.toggleClass('fa-bars fa-times'); }, 1000); }); });
score: 3
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/48159480
type: Answer
upvote count: 3
answers question: http://stackoverflow.com/q/30001027
accepted answer of: http://stackoverflow.com/q/30001027

http://stackoverflow.com/a/29872708
downvote count: 0
answers question: http://stackoverflow.com/q/29872603
type: Answer
upvote count: 1
score: 1
has body: The good news is the single-threaded nature of javascript works to your advantage here. The bad news is that if your work requires any form of asynchronous input, you'll have to A) write thread-blocking/locking code, or B) get creative with recursion and setTimeout. The simpler solution (A) goes something like this. Let's assume you need to prompt the user every two loops to continue the operation. for( var i=0, n=0; i &lt; 10000; i++, n++ ){ if ( n == 2 ) { /* Example of thread blocking operation "confirm" function blocks the thread, so the loop will stop executing until the user clicks "ok" */ if ( !confirm("Keep looping?") ){ break; }; // Reset n so that it fires again in 2 iterations n = 0; } } Of course, if your work doesn't require asynchronous input from the user or an ajax call, all the better. Fortunately, a more graceful solution is just around the corner. The latest javascript spec (ES6) uses something called generators to accomplish exactly what you're trying to do (you can think of them as an async-await). Unfortunately, support for generators varies and is generally considered a more advanced topic, so your mileage may vary.

http://stackoverflow.com/a/29986310
type: Answer
has body: It will work fine : JavaScript: (function($){ $('.list-group').hide(); $('#slide-submenu').on('click',function() { $(this).closest('.list-group').fadeOut('slide',function(){ $('.mini-submenu').fadeIn(); }); }); $('.mini-submenu').on('click',function(){ $(this).next('.list-group').toggle('slide'); $('.mini-submenu').hide(); }) })(jQuery);
score: 0
answers question: http://stackoverflow.com/q/29985943

http://stackoverflow.com/a/63719104
score: 0
type: Answer
has body: WordPress TinyMCE Users: Dave's answer above solved my issue with this implementation in WordPress: (using TinyMCE plugin and Advanced TinyMCE Configuration plugin) Use the following TinyMCE Config overrides: Name : Value keep_styles : true paste_retain_style_properties : true Image: The settings page implementation Big thanks to Dave.
answers question: http://stackoverflow.com/q/29997908

http://stackoverflow.com/a/29848111
type: Answer
has comment: http://stackoverflow.com/comment/47824625
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/47822295
has comment: http://stackoverflow.com/comment/47824153
has comment: http://stackoverflow.com/comment/47822914
answers question: http://stackoverflow.com/q/29847985
upvote count: 2
has body: That's why you have the minDate and maxDate. On the initializer: $( ".selector" ).datepicker({ minDate: new Date(2007, 1 - 1, 1) }); Setting after initialized: $( ".selector" ).datepicker( "option", "minDate", new Date(2007, 1 - 1, 1) ); You don't need to post all your code here. Be specific. :)

http://stackoverflow.com/a/29865269
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/47855684
type: Answer
score: 2
answers question: http://stackoverflow.com/q/29865129
upvote count: 2
has body: What you should do is somehting like this, load in the controller with the template: var app = angular.module('plunker', []); app.controller('MainCtrl', function($scope) { $scope.name = 'First '; }); app.directive('exampleDirective', function() { return { restrict: 'E', template: ' Hello {{name}}! ', scope: true, controller: "MainCtrl" } })
accepted answer of: http://stackoverflow.com/q/29865129
has comment: http://stackoverflow.com/comment/47855608

http://stackoverflow.com/comment/48044896
type: QuestionComment
comment on: http://stackoverflow.com/q/29962318
has text: How are you hiding the element on click? Is it using `hide()`, or via an animation?
type: Comment
score: 1

http://stackoverflow.com/comment/48054221
type: Comment
comment on: http://stackoverflow.com/a/29967295
has text: I don't have any concern weather it removes it or not but I want the classname that is not third. var yourlastclass = arr.pop(); console.log(yourlastclass is third);
score: 0
type: AnswerComment

canvas
tags question: http://stackoverflow.com/q/29982228
tags question: http://stackoverflow.com/q/29920129
tags question: http://stackoverflow.com/q/29853547
tags question: http://stackoverflow.com/q/29871666
tags question: http://stackoverflow.com/q/29939272
tags question: http://stackoverflow.com/q/29885866
tags question: http://stackoverflow.com/q/29984974
tags question: http://stackoverflow.com/q/29936190
tags question: http://stackoverflow.com/q/29924984
tags question: http://stackoverflow.com/q/29926987
tags question: http://stackoverflow.com/q/29976068
tags question: http://stackoverflow.com/q/29934252
tags question: http://stackoverflow.com/q/29852588
tags question: http://stackoverflow.com/q/29853930
tags question: http://stackoverflow.com/q/29866647
tags question: http://stackoverflow.com/q/30002361
tags question: http://stackoverflow.com/q/30000698
tags question: http://stackoverflow.com/q/29868936
tags question: http://stackoverflow.com/q/29946178
tags question: http://stackoverflow.com/q/29961112
tags question: http://stackoverflow.com/q/29870262
tags question: http://stackoverflow.com/q/29972238
tags question: http://stackoverflow.com/q/29910022
tags question: http://stackoverflow.com/q/29884837
tags question: http://stackoverflow.com/q/30001999
tags question: http://stackoverflow.com/q/29910502
tags question: http://stackoverflow.com/q/29940280
tags question: http://stackoverflow.com/q/29939425
tags question: http://stackoverflow.com/q/29888125
tags question: http://stackoverflow.com/q/29884621
tags question: http://stackoverflow.com/q/29911143
tags question: http://stackoverflow.com/q/29922621
tag name: canvas
tags question: http://stackoverflow.com/q/29903659
tags question: http://stackoverflow.com/q/29862699
tags question: http://stackoverflow.com/q/29920851
tags question: http://stackoverflow.com/q/29914286
tags question: http://stackoverflow.com/q/29952400
tags question: http://stackoverflow.com/q/29998635
tags question: http://stackoverflow.com/q/29861127
tags question: http://stackoverflow.com/q/29959103
tags question: http://stackoverflow.com/q/29886422
tags question: http://stackoverflow.com/q/29904445
type: Tag
tags question: http://stackoverflow.com/q/29926391
tags question: http://stackoverflow.com/q/29859198
tags question: http://stackoverflow.com/q/29980226
tags question: http://stackoverflow.com/q/29892965
tags question: http://stackoverflow.com/q/29972949
tags question: http://stackoverflow.com/q/29940653
tags question: http://stackoverflow.com/q/29957819
tags question: http://stackoverflow.com/q/29891352
tags question: http://stackoverflow.com/q/29867085
tags question: http://stackoverflow.com/q/29955955
tags question: http://stackoverflow.com/q/29888523
tags question: http://stackoverflow.com/q/29875010
tags question: http://stackoverflow.com/q/29937306
tags question: http://stackoverflow.com/q/29992688
tags question: http://stackoverflow.com/q/29879582
tags question: http://stackoverflow.com/q/29928987
tags question: http://stackoverflow.com/q/29982756
tags question: http://stackoverflow.com/q/29887216
tags question: http://stackoverflow.com/q/29927187
tags question: http://stackoverflow.com/q/29963462
tags question: http://stackoverflow.com/q/29850823
tags question: http://stackoverflow.com/q/29880676
tags question: http://stackoverflow.com/q/29846318
tags question: http://stackoverflow.com/q/29952881
tags question: http://stackoverflow.com/q/29865487
tags question: http://stackoverflow.com/q/29975694
tags question: http://stackoverflow.com/q/29963418

http://stackoverflow.com/comment/47891646
has text: @PaulFitzgerald I'm not getting any errors
comment on: http://stackoverflow.com/q/29883720
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47966016
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29913222
has text: @JB11 is it pseudo code, or you are actually running? `new Date("Text"+i)` would possibly give you an **invalid date**, so that `ut - t` will be `NaN`, definitely fails the comparison. You may take a look at the [doc](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) on how to insantiate a valid date with `Date` constructor. One more thing, get the `t` out of the loop, you don't have to do it in every iteration.

http://stackoverflow.com/comment/48032317
type: Comment
type: QuestionComment
has text: It depends on what the link does, what kind of routing you're using, etc etc
comment on: http://stackoverflow.com/q/29955743
score: 0

http://stackoverflow.com/comment/53055315
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29897260
has text: Why it is not played without flash player? I want to use html5 video for this, is it possible?

http://stackoverflow.com/q/29891004
score: 0
answer count: 3
has title: Creating a Number Guessing Game in Javascript - Need Help on Loop
type: UnansweredQuestion
has body: So far I have created a basic number guessing game,the number is currently set to 50 for testing purposes. I would like to know how to add a loop so the user can guess again. I would also like to see the previous guesses on the screen. So it would should something like: Number Guessing Game! Guess #1 : 49 was LOW Guess #2 : 51 was HIGH Guess #3 : 50 was CORRECT For the loop i know i need to use something like "while( !guessed )" but not sure how to implement it at all, i'm pretty new to this, any help would be fantastic! var canvas; canvas = openGraphics(); var max; max = 100; var numberToGuess; numberToGuess = 50; // will become Math.floor( Math.random() * max ) + 1; later // canvas.setFont("comic sans ms", "15px", Font.Bold); canvas.drawString("Number Guessing Game!"); var guess; guess = prompt( "Please input your first guess" ); if(guess &gt; numberToGuess){ var message1; message1 = " was HIGH"; var messageanswer; messageanswer = "Guess #1 : " + guess + message1; canvas.drawString(messageanswer, 20,20); } if (guess &lt; numberToGuess){ var message2; message2 = " was LOW"; var messageanswer2; messageanswer2 = "Guess #1 : " + guess + message2; canvas.drawString(messageanswer2, 20,20); } if (guess == numberToGuess){ var message3; message3 = " was CORRECT"; var messageanswer3; messageanswer3 = "Guess #1 : " + guess + message3; canvas.drawString(messageanswer3, 20,20); } canvas.paint();
has answer: http://stackoverflow.com/a/29891136
tagged with: numbers
has answer: http://stackoverflow.com/a/29891150
tagged with: loops
type: Question
has answer: http://stackoverflow.com/a/29891079
tagged with: javascript

http://stackoverflow.com/comment/48153891
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29976705
has text: No. This detects only when the very same page instance is opened more than once. If the page instances are different than you can store the date in the page hierarchy. It won't clash with the ones from the other pages.
type: AnswerComment

http://stackoverflow.com/comment/47915999
comment on: http://stackoverflow.com/q/29885532
has text: Your question is a bit poor, please provide more details. Do you mean open a diaglog (e.g. 'Confirm Save' on a form) or do you mean the Wicket modal window, that requires AjaxRequestTarget that is not available in onSubmti() function on a form or SubmitLink?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29860159
answers question: http://stackoverflow.com/q/29860132
accepted answer of: http://stackoverflow.com/q/29860132
has body: Why is it used in a function? 1. To return back the results of the function The return does what is says - it returns back some values to the function caller function sum(num1, num2) { var result = number1 + number2 return result } var result = sum(5, 6) // result now holds value '11' 2. To stop the execution of the function Another reason that return is used is because it also breaks the execution of the function - that means that if you hit return, the function stops running any code that follows it. function sum(num1, num2) { // if any of the 2 required arguments is missing, stop if (!num1 || !num1) { return } // and do not continue the following return number1 + number2 } var result = sum(5) // sum() returned false because not all arguments were provided Why we should use it? Because it allows you to reuse code. If for example you're writing an application that does geometric calculations, along the way you might need to calculate a distance between 2 points; which is a common calculation. Would you write the formula again each time you need it? What if your formula was wrong? Would you visit all the places in the code where the formula was written to make the changes? No - instead you would wrap it into a function and have it return back the result - so you write the formula once and you reuse it everywhere you want to: function getLineDistance(x1, y1, x2, y2) { return Math.sqrt((Math.pow((x2 - x1), 2)) + (Math.pow(( y2 - y1), 2))) } var lineDistance1 = getLineDistance(5, 5, 10, 20); var lineDistance2 = getLineDistance(3, 5, 12, 24);
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 8
upvote count: 8

http://stackoverflow.com/comment/47825662
score: 1
type: AnswerComment
has text: Well, this is definitely what I want and need. Thanks for all the extra info about canvases. You really saved my ass mate! :)
comment on: http://stackoverflow.com/a/29848855
type: Comment

http://stackoverflow.com/comment/47992264
type: Comment
has text: Oh no, yeah, it was just an encoding thing. I'm glad this worked for you :)
comment on: http://stackoverflow.com/a/29935019
score: 1
type: AnswerComment

http://stackoverflow.com/comment/47941448
has text: use string manipulation
type: QuestionComment
comment on: http://stackoverflow.com/q/29909528
score: 0
type: Comment

http://stackoverflow.com/comment/48107645
type: QuestionComment
comment on: http://stackoverflow.com/q/29992447
score: 0
type: Comment
has text: You're welcome. I'm sorry I couldn't help more. I am curious though, where were you outputing the json in the console. I added `console.log(JSON.stringify(this.fields));` inside both the success and error callback functions of the ajax call.

http://stackoverflow.com/comment/47867621
comment on: http://stackoverflow.com/q/29870563
score: 0
has text: i've managed to reproduce it [here](http://jsfiddle.net/7d9ttatq/2/)
type: QuestionComment
type: Comment

http://stackoverflow.com/q/29985527
tagged with: angularjs-scope
has body: Currently I have two ideas for passing data from one view to other in angulajs and using "ui.router". Set the data using local storage in one view and then retrieve that data on next view .(This does not seem to be an efficient way) Create a service and share the same object created using service with both the views. I have seen second idea example over here . But I don't know how services are able to share data between views. If any experienced Angularjs programmer can help me understand this concept it would be a lot of help to me. I have seen this angular-share-data-between-controllers it tell how you can share data but does not explain how it works behind the scene. I want to know how it works
downvote count: 0
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/48090306
tagged with: service
score: 2
has title: How data sharing between services in angularjs work?
answer count: 0
upvote count: 2
type: Question
linked to: http://stackoverflow.com/q/21919962
tagged with: javascript

http://stackoverflow.com/q/29847647
has comment: http://stackoverflow.com/comment/47821526
answer count: 1
tagged with: ternary-operator
favorite count: 0
has answer: http://stackoverflow.com/a/29848091
upvote count: 2
type: UnansweredQuestion
has title: Accessing property on object in an array in a ternary
has comment: http://stackoverflow.com/comment/47821165
has comment: http://stackoverflow.com/comment/47821014
score: 1
has body: I had an interesting situation and was wondering if anyone knew why. I had this statement in my code var score = (typeof k.rewards !== 'undefined') ? k.rewards[0].value : k.value; This would throw an error of value being undefined within the array (on the truthy side of the ternary). However, I know the value is there and this will print it just fine. var score = (typeof k.rewards !== 'undefined') ? k.rewards : k.value; Console.log(score[0].value); does anyone know why it would be undefined when I try to access it directly in the ternary?
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/47820980
tagged with: arrays
tagged with: javascript

http://stackoverflow.com/a/29872478
has body: Solution was, strangely enough, adding "display:block" to the img tag css. Thanks to all for your help.
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29852731
answers question: http://stackoverflow.com/q/29852731
score: 0
type: Answer

http://stackoverflow.com/q/29985602
tagged with: javascript
tagged with: jquery
favorite count: 0
type: Question
has body: I have a table and on button click i am adding row using .clone and adding id using .prop now What i want to do is i want to find text boxes with in tr and change ids for it How can i do it Here is My html Product Description* No's* Capacity* Quantity Full/Empty js $(".purchasemore").on('click', function() { var cloneCount = 1; // var row = $(".purchasemanagement tr:last").clone().find(':input').val('').end(); var row = $(".purchasemanagement tr:last").clone().prop('id', 'klon' + cloneCount); // var test = $(this).find('input[name$="nos"]').attr("id"); // alert(test); $('.purchasemanagement').append(row); }); For my code It is Adding id for tr i want to change id for nos,capacity Thanks
accepted answer: http://stackoverflow.com/a/29986680
has title: Add new Id For Text Box inside tr on clone jquery
score: -1
downvote count: 1
answer count: 1
has answer: http://stackoverflow.com/a/29986680
tagged with: jquery-plugins
type: AnsweredQuestion
upvote count: 0

http://stackoverflow.com/a/29965985
has body: Just add a listener that gets your text and put it somewhere else: var get = document.getElementById('getcontenthere'); var put = document.getElementById('putcontenthere'); var updateInput = function() { put.value = get.innerText; } get.oninput = updateInput; updateInput(); This is a paragraph. It is editable. Try to change this text. This is type=text so you can see it, but it could be hidden as well
answers question: http://stackoverflow.com/q/29965886
type: Answer
downvote count: 1
score: -1
upvote count: 0

http://stackoverflow.com/q/29859048
has comment: http://stackoverflow.com/comment/47844179
tagged with: javascript
tagged with: browser-history
score: 6
accepted answer: http://stackoverflow.com/a/29859214
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
has body: I'm having problems getting URL to update when hitting the back button on the browser (I'm on testing on Firefox). After updating the "src" property of the iframe I use replaceState to update the history. If I hit the back button after this the iframe will go back to the previous page but the URL does not update to reflect this. function updateURLBar(urlInfo) { var stateObj = { foo: "bar" }; document.getElementById("iframeContent").src = urlInfo[1]; window.history.replaceState(stateObj, "page 2", urlInfo[0]); } Am I going about this the wrong way or am I just missing something. Thanks for any help in advanced!
favorite count: 0
type: Question
tagged with: iframe
answer count: 1
upvote count: 6
has comment: http://stackoverflow.com/comment/47844231
has answer: http://stackoverflow.com/a/29859214
has title: Updating an iframe, history and URL. Then making it work with back button
has comment: http://stackoverflow.com/comment/47843974

http://stackoverflow.com/q/29965643
has comment: http://stackoverflow.com/comment/48051432
type: Question
tagged with: d3.js
accepted answer: http://stackoverflow.com/a/29965833
tagged with: css
has comment: http://stackoverflow.com/comment/48053489
tagged with: http://stackoverflow.com/tag/svg
score: 0
has body: I am trying to link my tooltip in d3.js to my bar graph data, however I cannot seem to find an appropriate method for this. Could anyone help me out? I have seen methods using tipsy, but I don't know the relative benefits of this. I am just trying to link the data to the tooltip to start. Then I will try to build a smaller graph into the tooltip, but that is very much the end goal! Any help would be much appreciated! Here is my code so far:
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/29965833
type: AnsweredQuestion
has title: Linking bar graph data to d3 tooltip
has comment: http://stackoverflow.com/comment/48053547
has comment: http://stackoverflow.com/comment/48053008
has comment: http://stackoverflow.com/comment/48051134
has comment: http://stackoverflow.com/comment/48052730

http://stackoverflow.com/a/29864141
has comment: http://stackoverflow.com/comment/98747956
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/98748089
has comment: http://stackoverflow.com/comment/47855308
has comment: http://stackoverflow.com/comment/98747802
has comment: http://stackoverflow.com/comment/47855714
has comment: http://stackoverflow.com/comment/47853678
has comment: http://stackoverflow.com/comment/47855415
has comment: http://stackoverflow.com/comment/98747158
has comment: http://stackoverflow.com/comment/47855352
has comment: http://stackoverflow.com/comment/47855876
type: Answer
upvote count: 4
accepted answer of: http://stackoverflow.com/q/29863531
downvote count: 0
has comment: http://stackoverflow.com/comment/47855600
answers question: http://stackoverflow.com/q/29863531
has body: Your use of naming (a computed named reformatPhoneNumber) suggests that you think of computeds as functions. While they are, technically, functions, they represent values. Treat them as values, just like you treat observables. In your case this means it should be called more like formattedPhoneNumber and should live as a property of the phone number, not as a property of the contact. Separate your models into individual units that can bootstrap themselves from raw data. The smallest unit of information in your model hierarchy is a phone number: function PhoneNumber(data) { var self = this; self.phoneType = ko.observable(); self.phoneNumber = ko.observable(); self.formattedPhoneNumber = ko.pureComputed(function () { return '+(1) ' + ko.unwrap(self.phoneNumber); }); ko.mapping.fromJS(data, PhoneNumber.mapping, self); } PhoneNumber.mapping = {}; Next in the hierarchy is a contact. It contains phone numbers. function Contact(data) { var self = this; self.name = ko.observable(); self.email = ko.observable(); self.phones = ko.observableArray(); ko.mapping.fromJS(data, Contact.mapping, self); } Contact.mapping = { phones: { create: function (options) { return new PhoneNumber(options.data); } } }; Next is a contact list (or phone book), it contains contacts: function PhoneBook(data) { var self = this; self.contacts = ko.observableArray(); ko.mapping.fromJS(data, PhoneBook.mapping, self); } PhoneBook.mapping = { contacts: { create: function (options) { return new Contact(options.data); } } }; Now you can create the entire object graph by instantiating a PhoneBook object: var phoneBookData = { contacts: [{ name: 'John', email: 'address@domain.com', phones: [{ phoneType: 'Home Phone', phoneNumber: '999-888-777' }, { phoneType: 'Business Phone', phoneNumber: '444-888-777' }] }] }; var phoneBook = new PhoneBook(phoneBookData); Read through the documentation of the mapping plugin. Expand the following code snippet to see it work. function PhoneBook(data) { var self = this; self.c…
has comment: http://stackoverflow.com/comment/47855820
has comment: http://stackoverflow.com/comment/47855340
score: 4

http://stackoverflow.com/q/29965731
has comment: http://stackoverflow.com/comment/48051354
answer count: 1
downvote count: 0
has title: Function is being called without trigger event
tagged with: jquery
has comment: http://stackoverflow.com/comment/48051305
favorite count: 0
linked to: http://stackoverflow.com/q/7969088
accepted answer: http://stackoverflow.com/a/29965761
score: 1
has body: I have a function that I want to use in order to expand menus in various places. I expect it to be triggered on a click of menu associated button, but at the moment it is being called on page load (I assume from within document ready), and class 'expanded' is added without clicking on a buton. I am confused to why this happens, as it should be called .on('click' .. jQuery(document).ready(function ($) { 'use strict'; $('#btn-expand-mobile-nav').on('click', showMenu('#side-navigation')); }); function showMenu(menu) { var x = $(menu), y = 'expanded'; if (x.hasClass(y)) x.removeClass(y); else x.addClass(y); }
upvote count: 1
type: Question
type: AnsweredQuestion
tagged with: javascript
has answer: http://stackoverflow.com/a/29965761

http://stackoverflow.com/a/30000747
answers question: http://stackoverflow.com/q/30000375
score: 0
has body: Use above code. this will work.
type: Answer

http://stackoverflow.com/comment/47938749
score: 0
type: QuestionComment
type: Comment
has text: It's really simple to make a loop create this.
comment on: http://stackoverflow.com/q/29908121

http://stackoverflow.com/comment/47954338
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29916329
has text: Thats a good question. Loading 1 image `must` be faster that load more images. So everything depends on your lazy loading method.
score: 0

http://stackoverflow.com/a/29920522
score: -1
downvote count: 2
upvote count: 1
type: Answer
has comment: http://stackoverflow.com/comment/47962367
has comment: http://stackoverflow.com/comment/47962561
has body: You can do it with this: $("#formTbl tr td h3").not("h3:contains('Name'):contains('Title')").closest('tr').remove();
answers question: http://stackoverflow.com/q/29920326

http://stackoverflow.com/comment/47922071
type: AnswerComment
comment on: http://stackoverflow.com/a/29899545
type: Comment
has text: How is that different from the OP's fiddle?
score: 0

http://stackoverflow.com/comment/48119288
type: QuestionComment
comment on: http://stackoverflow.com/q/30000021
score: 0
has text: Yes, exactly! For my blog.
type: Comment

http://stackoverflow.com/q/29933522
score: 5
tagged with: function
upvote count: 5
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/29933563
accepted answer: http://stackoverflow.com/a/29933813
has title: Anonymous Callback Function Clarification
possible better answer: http://stackoverflow.com/a/29933563
tagged with: callback
favorite count: 0
tagged with: node.js
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29933813
has body: I'm brushing up on callback functions and came across the following passage from http://javascriptissexy.com/understand-javascript-callback-functions-and-use-them/# "When we pass a callback function as an argument to another function, we are only passing the function definition. We are not executing the function in the parameter. In other words, we aren’t passing the function with the trailing pair of executing parenthesis () like we do when we are executing a function. And since the containing function has the callback function in its parameter as a function definition, it can execute the callback anytime." Can someone explain that? Here are two examples they provided. ​//The item is a callback function $("#btn_1").click(function() { alert("Btn 1 Clicked"); }); Here is another example: var friends = ["Mike", "Stacy", "Andy", "Rick"]; ​ friends.forEach(function (eachName, index){ console.log(index + 1 + ". " + eachName); // 1. Mike, 2. Stacy, 3. Andy, 4. Rick​ }); "Note that the callback function is not executed immediately. It is “called back” (hence the name) at some specified point inside the containing function’s body. So, even though the first jQuery example looked like this: //The anonymous function is not being executed there in the parameter. ​ ​//The item is a callback function $("#btn_1").click(function() { alert("Btn 1 Clicked"); }); the anonymous function will be called later inside the function body. Even without a name, it can still be accessed later via the arguments object by the containing function." For the first example with jquery, what are they saying exactly. If the #btn_1 element is clicked, will the anonymous function be executed? I am assuming it will be executed if the button is clicked, but the wording from the passage was confusing? Similarly, for the second example, do they not need to call the function that they passed as an argument bc its anonymous?
type: Question
answer count: 2

http://stackoverflow.com/a/30091117
accepted answer of: http://stackoverflow.com/q/29995337
answers question: http://stackoverflow.com/q/29995337
type: Answer
has comment: http://stackoverflow.com/comment/48305224
score: 0
type: AcceptedAnswer
has body: Check this code snippet: $(window).on("load", function() { var chargeInterval; /*CREATE BULB-------------------------------------------*/ function createBulb(divider, chargeValue) { var newBulb = document.createElement("div"); //dynamically create new bulb newBulb.setAttribute("id","bulb"+divider); //set new bulb's ID newBulb.setAttribute("class","bulb"); //set new bulb's class //fill new bulb newBulb.innerHTML = ' ' + ' ' + ' ' + ' ' + ' '+chargeValue+'W ' + ' '; //start charge-counter chargeInterval = setInterval(function() { var value = parseInt($("#bulb" + divider + " .W").html(), 10); value++; $("#bulb" + divider + " .W").html(value); }, 10); //add bulb to bulbs-container $("#bulbs").append(newBulb); //fade-in bulb $("#bulb" + divider + " .bulb_dark").fadeIn(500); } /*CLICK CHARGE-BUTTON-----------------------------------*/ $("#bulbs").on("click", ".bulb .Wsender", function() { var bulb = '#' + $(this).closest(".bulb").attr("id"); //get bulb's ID var divider = parseInt(bulb.substr("#bulb".length)); //get divide-amount from ID var clipTop = parseInt($(bulb + " .bulb_light").css("clip").split(" ")[0].replace("rect(", ""), 10); //extract top-clipping from "rect(260px 160px 260px 0px)" var value = parseInt($(bulb + " .W").html(), 10); //Watt var valuee = value / divider; var newTop = clipTop - valuee; //calculate new value if (valuee > clipTop) { value -= valuee; } else { value = 0; } //update bulb's charge-level, and (re)set wattage $(bulb + " .bulb_light").css("clip", "rect(" + newTop + "px,160px,260px,0px)"); $(bulb + " .W").html(value); //bulb is fully charged if (newTop <= 0) { $(bulb + " .Wsender").prop("disabled", true); //disable button $(bulb + " .Wsender").prop("value", "Charged"); //change button-label $(bulb + " .charged").css("display", "block"); //show fully charged bulb-image clearInterval(chargeInterval); //stop charge-interval $(bulb + " .Watt").remove(); //remove Watt-counter and charge-button //initiatie new bulb setTimeout(function() { var times…

http://stackoverflow.com/comment/47936163
comment on: http://stackoverflow.com/q/29906739
has text: Do you have the script at the bottom of your page? After all of your html?
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/a/29976949
score: 0
has body: Please try the following for your header. SCript File: // Create a clone of the menu, right next to original. $('.topmenu').addClass('original').clone().insertAfter('.topmenu').addClass('cloned').css('position', 'fixed').css('top', '0').css('margin-top', '0').css('z-index', '500').removeClass('original').hide(); scrollIntervalID = setInterval(stickIt, 10); function stickIt() { var orgElementPos = $('.original').offset(); orgElementTop = orgElementPos.top; if ($(window).scrollTop() &gt;= (orgElementTop)) { // scrolled past the original position; now only show the cloned, sticky element. // Cloned element should always have same left position and width as original element. orgElement = $('.original'); coordsOrgElement = orgElement.offset(); leftOrgElement = coordsOrgElement.left; widthOrgElement = orgElement.css('width'); $('.cloned').css('left', leftOrgElement + 'px').css('top', 0).css('width', widthOrgElement).show(); $('.original').css('visibility', 'hidden'); } else { // not scrolled past the menu; only show the original menu. $('.cloned').hide(); $('.original').css('visibility', 'visible'); } } This works for me
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/48073521
type: Answer
has comment: http://stackoverflow.com/comment/48073473
has comment: http://stackoverflow.com/comment/48073774
answers question: http://stackoverflow.com/q/29976879

http://stackoverflow.com/a/29975531
type: AcceptedAnswer
type: Answer
upvote count: 6
answers question: http://stackoverflow.com/q/29975484
has body: Examine this code: $("li.clickedli").removeAttr("class"); This removes the entire class attribute, thus removing all classes. Just set/clear the specific classes you need/don't need.
downvote count: 1
has comment: http://stackoverflow.com/comment/48070994
accepted answer of: http://stackoverflow.com/q/29975484
score: 5

http://stackoverflow.com/q/29929641
has body: Some of our dev groups are using JSHint for code quality and we are looking to adopt SonarQube for greater transparency. Sonar explained they want to maintain their own rules list here: The Sonarway Is there a way to easily map existing JSHint rules into the "Sonarway" equivalents? We'd like to maintain 1 set of rules for JS.
answer count: 1
has answer: http://stackoverflow.com/a/36397170
favorite count: 0
type: UnansweredQuestion
score: 11
has title: Convert JSHint rules to Sonar
tagged with: sonarqube
downvote count: 1
tagged with: jshint
type: Question
upvote count: 12
tagged with: javascript

http://stackoverflow.com/comment/47906986
comment on: http://stackoverflow.com/a/29891684
has text: Actually `/(:\))\B/` is working the way I want, how do you explain that ?
type: AnswerComment
score: 0
type: Comment

uikit
tag name: uikit
type: Tag
tags question: http://stackoverflow.com/q/29896828
tags question: http://stackoverflow.com/q/29883478

http://stackoverflow.com/q/29869910
tagged with: javascript
has comment: http://stackoverflow.com/comment/47865310
favorite count: 0
has title: Is there anyway that I can give a div a function in p5.js
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29986927
type: UnansweredQuestion
upvote count: 1
downvote count: 1
type: Question
has body: Im trying to take a div that I created and make it move across the screen every hour using p5.js and I'm wondering if that is at all possible I was also wonderig if that div can change color randomly every hour in p5.js
has answer: http://stackoverflow.com/a/29870475
tagged with: p5.js
score: 0
answer count: 2

http://stackoverflow.com/q/29923961
tagged with: clientscript
type: UnansweredQuestion
has title: ClientScript not working properly on class C#
score: 0
has body: I want to deploy a script on C# which usually uses methods like: ClientScript.RegisterStartupScript(GetType(), "script", "Details('" + hdnId.Value + "');", true); However I wanted to make a class that runs that code: public class WebUtilities { public static void CustomScript(Page objPage, string strScript) { objPage.ClientScript.RegisterStartupScript(objPage.GetType(), "script", strScript, true); } } When I call WebUtilities.CustomScript, sometimes it works, but leaves a // at the bottom of the page. And there is one occasion that it does not work at all. I only noticed that the first method works, and the second one doesn't. How can I make the class version to work properly?
type: Question
tagged with: c#
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/29924444
tagged with: asp.net

http://stackoverflow.com/comment/47840588
score: 0
type: Comment
type: QuestionComment
has text: It is nested inside a "playProgress" event using the vimeo API.
comment on: http://stackoverflow.com/q/29857337

http://stackoverflow.com/q/29990529
tagged with: http://stackoverflow.com/tag/r
has body: I am building a web tool using Shiny Server.R and try to add a functionality to download csv file. Because the tool is currently built with html and javascript instead of ui.R, I am running the such function to pass in user input dynamically to server to generate the content of csv file. in .html Download in .js file Shiny.onInputChange("mydata", JSON.stringify(itemList)); in server.R output$downloadData = downloadHandler( filename = paste("filename",format(Sys.Date(),"%Y%m%d"),"csv",sep="."), content = function(file){ print(input$mydata) write.csv(input$mydata,file,row.names=FALSE) } ) By click Download button, it does generate a csv file but the content (input$mydata) is always based on the previous input. for example, when first load the page and set itemList to 1 and click the Download button, it doesn't generate any file but says error with NULL on a separate page. example of error message: unable to find an inherited method for function ‘fromJSON’ for signature ‘"NULL", "missing"’ Then if i update itemList to 2 and click the Download button again, server.R generates a csv file but when i open the file, it contains 1 instead of 2. I tried alternate approach as below as well. When below codes are triggered, i do see the up-to-date input$mydata and itemList on my console, but when it reaches to output$downloadData, these values are not being updated but generate a file with previous value.. observe({ if(!is.null(input$mydata)){ isolate({ itemList <- fromJSON(input$mydata) itemList <- lapply(itemList, function(x) { x[sapply(x, is.null)] <- NA unlist(x) }) itemList <- do.call("rbind", itemList) print(input$mydata) print(itemList) itemList <- as.data.frame(itemList, stringsAsFactors=FALSE) output$downloadData <- downloadHandler( filename = paste("filename",format(Sys.Date(),"%Y%m%d"),"csv",sep="."), content = function(file){ write.table(itemList,file,sep=",",row.names=FALSE) }) }) }}) Has anyone seen such issue while using downloadHandler with onInputChange()? Pleas…
tagged with: shiny
downvote count: 0
favorite count: 0
type: UnansweredQuestion
has title: downloadHandler does not work well with Shiny.onInputChange()
answer count: 0
score: 1
upvote count: 1
type: Question
tagged with: javascript

http://stackoverflow.com/q/29870713
has answer: http://stackoverflow.com/a/32915942
has body: I'm trying to generate a query like the following via Knex.js: INSERT INTO table ("column1", "column2") SELECT "someVal", 12345 WHERE NOT EXISTS ( SELECT 1 FROM table WHERE "column2" = 12345 ) Basically, I want to insert values only if a particular value does not already exist. But Knex.js doesn't seem to know how to do this; if I call knex.insert() (with no values), it generates an "insert default values" query. I tried the following: pg.insert() .into(tableName) .select(_.values(data)) .whereNotExists( pg.select(1) .from(tableName) .where(blah) ); but that still just gives me the default values thing. I tried adding a .columns(Object.keys(data)) in hopes that insert() would honor that, but no luck. Is it possible to generate the query I want with knex, or will I just have to build up a raw query, without Knex.js methods?
has answer: http://stackoverflow.com/a/68147623
upvote count: 12
downvote count: 0
tagged with: javascript
favorite count: 0
answer count: 3
type: UnansweredQuestion
has title: Knex.js insert from select
has answer: http://stackoverflow.com/a/70772099
tagged with: node.js
score: 12
tagged with: knex.js
type: Question

http://stackoverflow.com/a/29976638
answers question: http://stackoverflow.com/q/29976561
has comment: http://stackoverflow.com/comment/48072838
score: 15
upvote count: 15
accepted answer of: http://stackoverflow.com/q/29976561
type: AcceptedAnswer
downvote count: 0
has body: Yes, you can: moment('12:59:01', 'HH:mm:ss').format('HH:mm') Or, if the format is consistent, you could just chop the last 3 chars: '12:59:01'.slice(0, -3)
type: Answer

http://stackoverflow.com/comment/47842010
comment on: http://stackoverflow.com/a/29857955
has text: Your function returns a jQuery object, not an HTML string and the jsFiddle doesn't appear to do anything (it reports an error in the console).
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/29941868
upvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/48008322
tagged with: javascript
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
has title: Force Http status when requesting a particolar html page in Angular js
downvote count: 0
tagged with: http
type: Question
score: 1
has body: there is a way in Angular to force an http status code after requesting a particolar html page? I want to force a 404 status when requesting a page with an particolar url for example: https://www.example.com/path/path?query=3.com
has answer: http://stackoverflow.com/a/29945421
has comment: http://stackoverflow.com/comment/48004798

http://stackoverflow.com/comment/49368152
has text: Not sure what you're trying to do but that `_patternToRegExp` is just a simple wildcard replacement of `*?` that drops anchors around it. Its actually dangerous as it doesn't account for literal metacharacters.
comment on: http://stackoverflow.com/q/29969286
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47904041
comment on: http://stackoverflow.com/a/29889578
has text: try just logging `req.session`
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/47893149
score: 0
type: AnswerComment
type: Comment
has text: I just used Anchor tags as an example of a .clickable thing btw.
comment on: http://stackoverflow.com/a/29884409

http://stackoverflow.com/comment/48047288
has text: What is the language?
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29963553

http://stackoverflow.com/comment/48067605
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29973815
has text: Might be a typo, but your URL contains "endpoit" instead of "endpoint".
score: 0

http://stackoverflow.com/q/29957123
has comment: http://stackoverflow.com/comment/48034918
has comment: http://stackoverflow.com/comment/48034881
tagged with: regex
possible better answer: http://stackoverflow.com/a/29957174
accepted answer: http://stackoverflow.com/a/29957147
favorite count: 0
has title: Regex to replace certain characters on first line
has body: I'm thinking that this is something very simple, but I can't find an answer anywhere online. I've found results on how to match the whole first line in a multiline string, but not how to find all occurrences of a certain character ONLY on the first line. So for instance: HelloX dXudXe How areX yXou? FxIXne? Matching all capital Xs only on the first line, and replacing that with nothing would result in: Hello dude How areX yXou? FxIXne? This matches only the first X: /X/m This matches all Xs: /X/g So I'm guessing the answer is the regex version of one of these statements: "Replace all X characters until you find a newline" "Replace all X characters in the first line" This sounds like such a simple task, is it? And if so, how can it be done? I've spent hours looking for a solution, but I'm thinking that maybe I don't get the regex logic at all.
has comment: http://stackoverflow.com/comment/48034966
has answer: http://stackoverflow.com/a/29957147
type: AnsweredQuestion
score: 3
downvote count: 0
has comment: http://stackoverflow.com/comment/48034847
has comment: http://stackoverflow.com/comment/48034916
has answer: http://stackoverflow.com/a/29957174
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/48034873
has comment: http://stackoverflow.com/comment/48034927
tagged with: javascript
has comment: http://stackoverflow.com/comment/48034890
upvote count: 3

http://stackoverflow.com/comment/47894453
type: AnswerComment
has text: still not functioning i tried deleting one of the attributes
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29885104

http://stackoverflow.com/q/29895988
possible better answer: http://stackoverflow.com/a/29902019
tagged with: browser
answer count: 2
has answer: http://stackoverflow.com/a/29897011
has comment: http://stackoverflow.com/comment/47914952
accepted answer: http://stackoverflow.com/a/29897011
has comment: http://stackoverflow.com/comment/47915730
tagged with: javascript
has comment: http://stackoverflow.com/comment/47926151
tagged with: jquery
has comment: http://stackoverflow.com/comment/47915322
has comment: http://stackoverflow.com/comment/47915888
score: 0
has comment: http://stackoverflow.com/comment/47915462
has answer: http://stackoverflow.com/a/29902019
has comment: http://stackoverflow.com/comment/47926364
tagged with: http://stackoverflow.com/tag/html
tagged with: input
has comment: http://stackoverflow.com/comment/47926875
has comment: http://stackoverflow.com/comment/47915907
has comment: http://stackoverflow.com/comment/47914931
has comment: http://stackoverflow.com/comment/47915563
has comment: http://stackoverflow.com/comment/47915641
has title: Cmd + a text selection not working on only allowing numeric input at textfield
type: Question
has body: I'm trying to solve a weird issue on Firefox for Mac where I cannot select a text with CTRL + A if I only allow numbers as input for a textfield. I found this fiddle to explain the problem: LINK Does anyone have an idea why, and how I can solve that?
type: AnsweredQuestion

http://stackoverflow.com/comment/47925169
type: Comment
has text: So you basicly want to pause the timeout as soon as the user leaves the page?
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29901053

http://stackoverflow.com/a/29895850
has comment: http://stackoverflow.com/comment/47928702
has body: You will find it easier to work from $('.finheader').not(this) . You also need to remove any 'finsel'/'selbdy' classes previously added. $('.finheader').click(function(e) { $(this).addClass('finsel').next().slideDown().addClass('selbdy'); $('.finheader').not(this).removeClass('finsel').next().slideUp().removeClass('selbdy'); });
has comment: http://stackoverflow.com/comment/47924265
has comment: http://stackoverflow.com/comment/47928513
score: 0
answers question: http://stackoverflow.com/q/29895590
type: Answer

http://stackoverflow.com/comment/133249378
has text: Why do you do `const today = new Date();, const tomorrow = new Date(today)`? Isn't that the same as ` const tomorrow = new Date()`?
score: 0
type: Comment
comment on: http://stackoverflow.com/a/75477786
type: AnswerComment

http://stackoverflow.com/comment/47971495
type: QuestionComment
comment on: http://stackoverflow.com/q/29924852
has text: xyEvent is triggered by Blockly: [link](https://code.google.com/p/blockly/), but I don't think that's the problem. And myClosure should return anyString!?
score: 0
type: Comment

http://stackoverflow.com/a/29945600
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 5
has comment: http://stackoverflow.com/comment/48012259
accepted answer of: http://stackoverflow.com/q/29945470
answers question: http://stackoverflow.com/q/29945470
has body: ng-style should not use {{}} interpolation directive, you could use direct scope variables there. Markup <span class="green" ng-style="{width: videoRating + '%'}"
score: 5

http://stackoverflow.com/a/29974643
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/29973674
has comment: http://stackoverflow.com/comment/48069230
answers question: http://stackoverflow.com/q/29973674
has body: You are missing a " after popupText+ for the closing H3 tag in your second popup binding. See "&lt;h3&gt;"+popupText+&lt;/h3&gt;"
score: 0

http://stackoverflow.com/a/29922451
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/47967682
has body: jQuery creates elements with createElement() function, but for SVG you need use createElementNS(). Solutions: Easy way: Use d3.js library instead jQuery; Hacker friendly way: Rewrite part of the jQuery code: // line 526 in jquery-X.X.X.js, in my case it is jquery-1.9.1.js // Single tag if ( parsed ) { // ---------------------------------------------------- var xml_html_element; if ( parsed[1] == "svg" || parsed[1] == "path" ) { xml_html_element = context.createElementNS( "http://www.w3.org/2000/svg", parsed[1] ); } else { xml_html_element = context.createElement( parsed[1] ); } return [xml_html_element]; // ---------------------------------------------------- //return [ context.createElement( parsed[1] ) ]; } Now, you can use jQuery like: var $svg = $("&lt;svg&gt;").attr({'version': "1.1"}); var $path = $("&lt;path&gt;").attr({ 'd': 'M' + 10 + ',' + 100 + ' C' + 200 + ',' + 150 + ' ' + 200 + ',' + 170 + ' ' + 300 + ',' + 250, 'fill': "none", 'stroke': "rgba(100,100,100,0.9)", 'stroke-width': "1" }); var $body = $("body"); $body.append($svg.append($path)); Of course, for your personal necessary you should expand the number of SVG tags in this hack (line 530): if ( parsed[1] == "svg" || parsed[1] == "g" || parsed[1] == "path" || parsed[1] == "line") { ... }
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/29922093

http://stackoverflow.com/comment/48122676
type: QuestionComment
score: 0
has text: Can you plz help me on how to solve the problem?
comment on: http://stackoverflow.com/q/30002000
type: Comment

http://stackoverflow.com/q/29991865
tagged with: node.js
possible better answer: http://stackoverflow.com/a/29992212
tagged with: geolocation
type: AnsweredQuestion
tagged with: database
type: Question
tagged with: mongodb
has body: I am working with nodejs (expres framwork) and mongodb with mongoose. And I am trying to save the geolocation coordinates to my db. This is how my schema looks like: //defining a schema var TopicSchema = mongoose.Schema({ topicTitle: String, topicDescription: String, topicDateCreated: { type: Date, default: Date.now }, fbId: String, twId: String, location: { type: { type : String }, coordinates: [Number] } }); TopicSchema.index({ location: '2dsphere' }); var Topic = restful.model('topic', TopicSchema); Topic.methods(['get', 'put', 'post', 'delete']); Topic.register(app, '/data'); Via socket.io I pass the data to the server. The server receives the data but upon saving it I get the following error: MongoError: Can't extract geo keys
answer count: 3
has answer: http://stackoverflow.com/a/30018572
accepted answer: http://stackoverflow.com/a/30018572
tagged with: javascript
has answer: http://stackoverflow.com/a/29992860
has title: Can't extract geo keys (nodejs and mongo)
has answer: http://stackoverflow.com/a/29992212
score: 0
linked to: http://stackoverflow.com/q/16635955

http://stackoverflow.com/q/29869327
has answer: http://stackoverflow.com/a/30785171
type: UnansweredQuestion
has body: I write an application where AJAX loads an XSLT which has a </xsl:template> </xsl:stylesheet> apps.xml <?xml version="1.0" encoding="UTF-8"?>
has comment: http://stackoverflow.com/comment/47864997
upvote count: 1
tagged with: xslt
score: 1
type: Question
has title: XSLT loaded with AJAX, contains fired only in Firefox
has comment: http://stackoverflow.com/comment/47864814
downvote count: 0
tagged with: http://stackoverflow.com/tag/xhtml
tagged with: javascript
has comment: http://stackoverflow.com/comment/47864662
tagged with: ajax
has comment: http://stackoverflow.com/comment/47864393
answer count: 1
favorite count: 0

http://stackoverflow.com/comment/47922048
type: AnswerComment
comment on: http://stackoverflow.com/a/29899103
type: Comment
has text: Yes, obviously you are going to get data from those checkboxes later on, and IDs has to be unique in the document
score: 0

http://stackoverflow.com/q/29929164
tagged with: wordpress
has title: Issue with Wordpress and Varnish breaking loadscript.php
type: Question
upvote count: 4
has answer: http://stackoverflow.com/a/35898184
has answer: http://stackoverflow.com/a/30744507
answer count: 2
downvote count: 0
has body: I've hit a snag with a Varnish - Nginx - Wordpress set up. The server is running multiple Joomla based sites (all fine) and should be running one Wordpress one too apart from it breaks with Varnish. Basically when Varnish is enabled I get the following error: Uncaught ReferenceError: _ is not defined on the Dashboard and various JQuery not defined errors elsewhere. With Varnish off it all works perfectly. I'm scratching my head now as to where the issue lies with my Varnish set up. I can't find anything on the web that is a similar issue and any help would be appreciated!
tagged with: javascript
tagged with: jquery
score: 4
favorite count: 0
type: UnansweredQuestion
tagged with: nginx
tagged with: varnish

http://stackoverflow.com/q/29877172
has body: Hi I am using redis in a node.js app for user caching. After the user has been loged-in, the user information is cached, and accessed on every other request to determine what access the user has and the client receives information, views etc. based on that. Right now the app creates a redisClient at the beginning and passes that to the needed express route callbacks(which is pretty much all of them). To be honest I don't really like the extra argument that is being passed everywhere - especially when it is the same. Is there a better way to do it, and for instance if I a initialise the redisClient in every module will it have extra overhead var express = require('express'), loginFunctionality = require('./routes/login'), homeFunctionality = require('./routes/home') ... // Connect to redis var redisClient = redis.createClient(); redisClient.on("error", function(err){ console.log("An error occurred with redis:" + err); }); ... app.get('/', homeFunctionality.home); app.post('/register', loginFunctionality.createNewUser); app.post('/login', loginFunctionality.login(redisClient, secret)); ... what I am wondering is, if there is a good way to remove the redisClient parameter.
favorite count: 0
tagged with: redis
tagged with: node.js
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29877279
downvote count: 1
has title: Redis client in decoupled node.js app
type: Question
tagged with: javascript
tagged with: express
upvote count: 4
has comment: http://stackoverflow.com/comment/47878567
score: 3
has answer: http://stackoverflow.com/a/29877279
answer count: 1

http://stackoverflow.com/comment/47843873
has text: Right but if I do that, how do I tell `connectListener` that it needs to look at that specific `client` and `args` variables?
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29858997
type: Comment

http://stackoverflow.com/q/29928449
score: 0
has answer: http://stackoverflow.com/a/29928587
accepted answer: http://stackoverflow.com/a/29928587
tagged with: http://stackoverflow.com/tag/html
answer count: 1
tagged with: jenkins
has body: I am writing this simple html in the editable email notification dialog box: However I am unable to see the string " this is from JS" in the generated email. Not sure what am I doing wrong ? Any pointers?
type: AnsweredQuestion
has title: Using tag within editable email notification dialog in Jenkins
type: Question
tagged with: javascript

http://stackoverflow.com/a/30006888
type: Answer
upvote count: 1
has body: I had a really similar problem with the custom player that I was developing. I would work perfectly on desktop, but on mobile it wouldn't play on the first click. It would play however when I paused it and then pressed play again. I was trying to run the debugMode so I could see what the difference was between desktop and mobile. I couldn't get the debugMode to work, without linking to the soundmanager JS as well. As soon as I added it the player worked perfectly on mobile too. Not sure what the root issue was, but it seems that you need to load the soundmanager JS along with the SoundCloud SDK and to get all of the functionality. Doesn't really get to the bottom of it, but I hope it helps.
answers question: http://stackoverflow.com/q/29931378
has comment: http://stackoverflow.com/comment/48134009
has comment: http://stackoverflow.com/comment/48151129
has comment: http://stackoverflow.com/comment/48150935
has comment: http://stackoverflow.com/comment/48141733
downvote count: 0
score: 1

http://stackoverflow.com/q/29865128
has body: $(document).ready(function(e) { function clickme() { alert('heyy'); } )}; HTML in the popup: example
accepted answer: http://stackoverflow.com/a/29911985
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47855429
has comment: http://stackoverflow.com/comment/47855278
upvote count: 0
score: -2
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47936142
favorite count: 0
has comment: http://stackoverflow.com/comment/47855291
has answer: http://stackoverflow.com/a/29911985
has title: How to execute Javascript or jQuery on newly opened popup?
has comment: http://stackoverflow.com/comment/47855729
has comment: http://stackoverflow.com/comment/47855923
downvote count: 2

http://stackoverflow.com/comment/47829427
has text: @Faran Al what is it?
score: 0
comment on: http://stackoverflow.com/q/29851331
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29935042
tagged with: video
answer count: 0
type: UnansweredQuestion
has title: HTML5 video player seek bar not working
type: Question
has comment: http://stackoverflow.com/comment/47992274
has body: I have embedded html5 video player in my application. When I open the web page for the first time, then video player seek bar doesn't work. If I refresh the page and seek the video then it works fine. function seekToTime(value) { var vidPlayer = $("#myVideo")[0]; var seekToTime = value; if (seekToTime &lt; 0 || seekToTime &gt; vidPlayer.duration) return; vidPlayer.currentTime = seekToTime; $("#myVideo")[0].play(); }
score: 0
has comment: http://stackoverflow.com/comment/47992232
tagged with: javascript
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/a/29960769
type: Answer
upvote count: 3
has body: The best way I found is $viewContentLoaded: faraWorkspaceApp.run(function ($rootScope, $location, $state, $templateCache) { $rootScope.$on('$viewContentLoaded', function (e) { FaraFunctions(); }); });
score: 3
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29892919
answers question: http://stackoverflow.com/q/29892919

http://stackoverflow.com/comment/47958235
type: QuestionComment
has text: @meena yes I got your question.. But m asking that what problem are you facing?? Are you getting any error? have you tried `echo` the lat and long variables?? have you tried putting static lat long???
score: 0
comment on: http://stackoverflow.com/q/29918257
type: Comment

http://stackoverflow.com/a/29948732
has body: Create a factory that returns an object for each function. //RiskFacade angular.module('App').factory('RiskFacade', ['RiskService', 'RiskEventTypeInfo', 'RiskCauseCategoryInfo', function (RiskService, RiskEventTypeInfo, RiskCauseCategoryInfo) { return { getRisk: RiskService.get, getRiskEventType: RiskEventTypeInfo.get, getRiskCauseCategory: RiskCauseCategoryInfo.get }; }]); RiskFacade.getRisk({id: 123}, function () {}); The same as before but with the $http service. angular.module('App').factory('RiskFacade', ['$http', function ($http) { return { getRisk: function (id) { return $http.get('app/risk/rest/risk/' + id); }, getRiskEventType: function (id) { return $http.get('app/risk/rest/risk/getRiskEventTypeInfo/' + id); }, getRiskCauseCategory: function (id) { return $http.get('app/risk/rest/risk/getRiskCauseCategoryInfo/' + id); } }; }]); //then RiskFacade.getRisk(123).success(successMethod).error(errorMethod);
upvote count: 1
answers question: http://stackoverflow.com/q/29948187
accepted answer of: http://stackoverflow.com/q/29948187
has comment: http://stackoverflow.com/comment/48018553
has comment: http://stackoverflow.com/comment/48044315
type: AcceptedAnswer
downvote count: 0
score: 1
type: Answer

http://stackoverflow.com/q/29965085
tagged with: java
has body: I want to execute a command which deletes an element from the canvas in selenium . The command is this " window.app.design.internalLayer().find('.deletebutton').fire('click')] " . this will find the particular image and delete it. and Its not working . When I open consle and type the above command it deletes an existing image I have . I have no object/values to return Thanks in advance, Sampath
tagged with: selenium
has answer: http://stackoverflow.com/a/29965217
type: Question
has comment: http://stackoverflow.com/comment/48049999
has title: I want an action to be performed not get any object value or any other.
tagged with: javascript
score: -1
duplicate of: http://stackoverflow.com/q/24098520
answer count: 1
downvote count: 1
favorite count: 0
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/24098520
has comment: http://stackoverflow.com/comment/48050035
tagged with: selenium-webdriver
upvote count: 0

http://stackoverflow.com/comment/47935311
comment on: http://stackoverflow.com/a/29906058
type: Comment
has text: I updated my answer to clarify. However, just because it's the first time you heard it, doesn't mean it's not true. There is a first time we each heard everything ;) I think anything that helps avoid confusion, like me looking at your code and seeing expressions[28] and thus assuming there is an expressions[27] is a good practice. Others read your code too, so if they read it and are confused, that's bad.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/48229415
comment on: http://stackoverflow.com/a/29856967
type: AnswerComment
has text: Please do not circumvent the quality filter. Either include the code from the fiddle within your answer, or don't link to the fiddle at all.
score: 0
type: Comment

http://stackoverflow.com/comment/48080703
has text: By nothings happens, I mean that my database is not updated. About the "oldAlbumName", It was to explain what I wanted to do. Shouldn't I try to get a $_POST['textID'] instead of a $_POST['Rouge_text'] here ?
type: QuestionComment
type: Comment
score: 0
comment on: http://stackoverflow.com/q/29980149

http://stackoverflow.com/comment/48054959
comment on: http://stackoverflow.com/a/29890286
has text: I can't see any other options, it looks like the plugin just doesn't support this feature yet. You could contact the developer, or fork the repo and make the changes yourself.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/47965248
type: Comment
comment on: http://stackoverflow.com/q/29918117
has text: Apart from what @Brewal is saying, you should learn about SQL injection and how to prevent it, because your code is subject to it: you sanitize the values but not the keys, and then use the keys in dynamic SQL statements. You should use [PDO](http://php.net/manual/en/book.pdo.php) or [mysqli_*](http://php.net/manual/en/book.mysqli.php), **AND** prepared statements instead.
score: 0
type: QuestionComment

http://stackoverflow.com/a/29887265
type: Answer
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/29885619
has body: I was able to solve the problem by saving the reference to the current scope to the variable "vm": app.controller('mainController', function(myApi) { var vm = this var results = [] var _init = function() { myApi.get({param: 1234}, function(data) { vm.results = data.results }); } _init(); return { results: results } }); Thus, the "results" object in the controller's scope is updated with the results of the resource call.
downvote count: 0

http://stackoverflow.com/comment/47978361
type: QuestionComment
comment on: http://stackoverflow.com/q/29927709
has text: Hmm, well I see you are doing some code after a return statement. Try it before. Is sym. a Greensocks thing?
score: 0
type: Comment

http://stackoverflow.com/q/29849019
tagged with: jquery
has comment: http://stackoverflow.com/comment/47824600
favorite count: 0
tagged with: three.js
type: AnsweredQuestion
has title: three.js black/White screen before moving mouse
has answer: http://stackoverflow.com/a/29849443
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/47824107
type: Question
has comment: http://stackoverflow.com/comment/47824280
tagged with: javascript
has body: I decided to use a 3D WebGL viewer to put on my website, but i have a small issue. Everything work fine, I can move my object and see it, but when I load the page, the screen is black before I move the mouse while clicking. So it's not an issue for me, but for people visiting my website : they can't guess they should move my object, and enjoy the viewer, and they could think it's a bug. here is my webpage : http://urlz.fr/1SQj I thought about a solution, but I'm not able (not yet !!) to do this : when the script is load, just rotate the object until the user click on the item (I think, as the object is moving, the black screen will disapear immediatly, because it does when I move the mouse). What do you think about ? Thank you very much, ngt78
accepted answer: http://stackoverflow.com/a/29849443
score: 0
has comment: http://stackoverflow.com/comment/47824608
answer count: 1

http://stackoverflow.com/q/29927911
has comment: http://stackoverflow.com/comment/47977753
upvote count: 3
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/29928118
has title: How can I dynamically create input elements with different Ids?
type: AnsweredQuestion
score: 3
has answer: http://stackoverflow.com/a/29927959
accepted answer: http://stackoverflow.com/a/29927959
has body: I have inputs that I dynamically generate with JavaScript. However, I'm unsure of how it is possible to add ids to those. Let me be clear: I want different ids for each, I know how to add just one id for all of them. This is what I've tried: $(document).ready(function() { var wrapper = $(".wayptHolder"); //Fields wrapper var add_button = $(".add_field_button"); //Add button ID var x = 0; //initial text box count //add input element $(add_button).click(function(event){ event.preventDefault(); if(x < 8){ $(wrapper).append(' Remove ');//add inputbox x++; } }); $(wrapper).on("click",".remove_field", function(event){ //user click on remove text event.preventDefault(); $(this).parent('div').remove(); x--; }) }); However, on the new element, it shows the id as just waypt. I've researched and it doesn't look like JavaScript has string interpolation. Ruby for example, solves this problem with being able to have waypt#{x} so that the string interprets x as a variable. How can JS replicates this behavior?
has comment: http://stackoverflow.com/comment/47977799
type: Question
answer count: 2
possible better answer: http://stackoverflow.com/a/29928118
tagged with: javascript
tagged with: jquery

filesystemobject
type: Tag
tags question: http://stackoverflow.com/q/29996030
tag name: filesystemobject

http://stackoverflow.com/a/29877468
has comment: http://stackoverflow.com/comment/47882436
has comment: http://stackoverflow.com/comment/47886195
accepted answer of: http://stackoverflow.com/q/29872126
score: 4
type: AcceptedAnswer
has body: While I agree with @Tom Sarduy approach and actually would recommend it since it is a one-time creation of HTML elements but just to provide you with another idea, here is what I have been able to create quickly. CSS changes: .counter .next, .counter .count { position:absolute; } .counter .next { transform:translateY(-12px); left:0; } JavaScript changes: //added before your [photos_change] method var counter = $('.counter'); var currentCount = $('&lt;span class="count"&gt;1&lt;span/&gt;'); counter.append(currentCount); // //and then inside your [photos_change] event handler var prevCount = $('.count'); currentCount = $('&lt;span class="count next"&gt;' + index + '&lt;span/&gt;'); counter.append(currentCount); TweenMax.to(prevCount, dur, { y: -12, opacity: 0, onCompleteParams: [prevCount], onComplete: function (prevCount) { prevCount.remove(); }, ease: Power2.easeOut }); TweenMax.fromTo(currentCount, dur, { y: 12, opacity: 0 }, { y: 0, opacity: 1, ease: Power2.easeOut }); // So I guess it is up to you to take whichever approach you like i.e. one-time creation of HTML elements on load or on click like the one I am proposing. Apologies for the ugliness of the code, just something I cooked up in a hurry. Hope it helps in some way though.
downvote count: 0
has comment: http://stackoverflow.com/comment/47888889
type: Answer
upvote count: 4
answers question: http://stackoverflow.com/q/29872126

http://stackoverflow.com/comment/48025598
score: 0
type: AnswerComment
type: Comment
has text: Hi @iran-rodrigues thanks for your reply, I'm trying your method but I think I'm making a mistake, I'm using your code, and have set the div to: `` `` however it's not working for me, I think I'm doing something very basic wrong?
comment on: http://stackoverflow.com/a/29951629

http://stackoverflow.com/a/29991369
accepted answer of: http://stackoverflow.com/q/29990416
has body: The height property does not account for margin, padding, and border. You should use jQuery's outerHeight to get the full height of your div. function xfromtop(el) { var elHeight = $(el).outerHeight(); var windowHeight = $(window).height(); if ((mousey + elHeight) &gt; windowHeight) { fromtop = windowHeight - elHeight; fromtop = fromtop.toString() + "px"; } else { fromtop = mousey.toString() + "px"; } return fromtop; }
type: Answer
answers question: http://stackoverflow.com/q/29990416
upvote count: 1
score: 1
type: AcceptedAnswer
downvote count: 0

conditional-statements
tags question: http://stackoverflow.com/q/29870983
tags question: http://stackoverflow.com/q/29987969
tags question: http://stackoverflow.com/q/29984763
tag name: conditional-statements
tags question: http://stackoverflow.com/q/29990514
type: Tag

http://stackoverflow.com/comment/48046439
type: AnswerComment
type: Comment
has text: Thank you for the solution. Sorry to say that, I tried but the browser still not responding..
comment on: http://stackoverflow.com/a/29942480
score: 0

http://stackoverflow.com/q/29918487
tagged with: sql
answer count: 1
downvote count: 0
favorite count: 0
tagged with: sql-server
tagged with: http://stackoverflow.com/tag/html
type: UnansweredQuestion
has title: Synchronize data across all web users
has body: I have a website with a rational DB (SQL SERVER). I have a table that have 100,000 (not exactly) records across 20 columns. On my site, there is a page that you can see the table (with pagination, sorting and filtering), 100 records at a time, all fields are editable. Changes are made about every second, how can I keep the table In sync per client, including sorting, filtering, page number? Thanks in advance.
has comment: http://stackoverflow.com/comment/47958124
score: 1
has comment: http://stackoverflow.com/comment/47958449
tagged with: javascript
has comment: http://stackoverflow.com/comment/47958856
type: Question
has answer: http://stackoverflow.com/a/29919028
upvote count: 1

http://stackoverflow.com/q/29923879
linked to: http://stackoverflow.com/q/55214957
has answer: http://stackoverflow.com/a/52755547
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/35443130
tagged with: es6-modules
favorite count: 0
has comment: http://stackoverflow.com/comment/47969719
tagged with: module
has answer: http://stackoverflow.com/a/70321564
answer count: 9
has body: Is it possible to pass options to ES6 imports? How do you translate this: var x = require('module')(someoptions); to ES6?
has answer: http://stackoverflow.com/a/56743269
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/51018333
upvote count: 186
type: Question
has answer: http://stackoverflow.com/a/29924193
has comment: http://stackoverflow.com/comment/75439037
score: 186
has answer: http://stackoverflow.com/a/73934806
has answer: http://stackoverflow.com/a/43212897
has title: Pass options to ES6 module imports
tagged with: ecmascript-6
has answer: http://stackoverflow.com/a/29924708

http://stackoverflow.com/q/29889599
type: Question
has answer: http://stackoverflow.com/a/29889771
tagged with: javascript
has comment: http://stackoverflow.com/comment/47902989
answer count: 3
upvote count: 1
has title: AngularJS: How to change url in $http.get on select event
favorite count: 0
has body: I have customers.php file which produce json data. List of json data are changing when we change variable in the url like this customers.php?var=5 In AngularJS I have made html file with two separate part. 1st part is a select options with specific values. 2nd part is part who shows json data. It is clear that 2nd part use $http.get(url) where url is customers.php?var=selected_number in controller. How can I change url in controller which use $http.get when user select specific options in &lt; select > ... &lt; / select > html file. Footnote: Here is example of controller file var Pajsije = angular.module('CodeOverflow', ['ngRoute']); Pajsije.config(function($routeProvider) { $routeProvider // route for the home page .when('/viewa', { templateUrl : 'viewa.html', controller : 'ViewAController' }) // route for the about page .when('/viewb', { templateUrl : 'viewb.html', controller : 'ViewBController' }) // route for the contact page .when('/viewc', { templateUrl : 'viewc.html', controller : 'ViewCController' }) .otherwise({ redirectTo: '/viewa' }); }); // create the controller and inject Angular's $scope Pajsije.controller('ViewAController', function($scope) { // create a message to display in our view $scope.message = 'Good look!'; }); Pajsije.controller('ViewBController', function($scope) { $scope.message = 'Look about page.'; }); Pajsije.controller('ViewCController', ['$scope','$http', '$templateCache', function($scope, $http, $templateCache) { $scope.myChange = function() { $http({method: 'GET', url: '../json-data/customers.php?idstudm=12', cache: $templateCache}).success(function (response) {$scope.names = response.records;}); }; }]);
tagged with: angularjs
type: UnansweredQuestion
tagged with: php
downvote count: 0
score: 1
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/47905550
has answer: http://stackoverflow.com/a/29889807
has answer: http://stackoverflow.com/a/29912021

http://stackoverflow.com/comment/48060042
has text: @Adam If `items` is updated by assigning a new value to it then the view won't update and your very first statement may turn out wrong eventually. But as you said: We don't know how `items` is updated.
comment on: http://stackoverflow.com/a/29969129
score: 1
type: AnswerComment
type: Comment

onunload
tags question: http://stackoverflow.com/q/29957521
type: Tag
tag name: onunload

http://stackoverflow.com/comment/47896530
score: 0
type: Comment
type: AnswerComment
has text: Tried without auto-index: "start": "http-server -a 0.0.0.0 -p 8000 -P http://localhost:8000/app/", still same 'Not Found'. I'm restarting the server everytime
comment on: http://stackoverflow.com/a/29886084

http://stackoverflow.com/q/29983457
has body: Cannot read property 'email' of undefined I'm very new in node and mongo and i'm tryin to learn them . here is my simple app and I want to save data with form using Jade . JADE form.form-horizontal(method="post", id="loginForm" action="/new") label Email input.span3(id="email", type="text", name="email", placeholder="Enter your Email") label Name input.span3(id="name", type="text", name="name", placeholder="Your Name") label Age input.span3(id="age", type="number", name="age", placeholder="Your Age") div.login input.btn.warning(type="submit", value="Log In") app.js mongoose.connect("mongodb://localhost/mean"); var Schema = new mongoose.Schema( { _id :"string", name:"string", age :"number" } ); var user = mongoose.model("emp", Schema); app.get('/', routes.index); app.get('/users', users.list); app.post("/new", function(res, req){ new user({ _id : req.body.email, name: req.body.name, age : req.body.age }).save(function(err, doc){ if(err){ res.json(err); }else{ res.send("Data inserted successfully !"); } }); }); after submit i get this error : Cannot read property 'email' of undefined
tagged with: node.js
type: AnsweredQuestion
has title: Error after submit form in Nodejs
has answer: http://stackoverflow.com/a/29983581
type: Question
tagged with: mongodb
tagged with: javascript
score: 0
accepted answer: http://stackoverflow.com/a/29983581
answer count: 1

http://stackoverflow.com/comment/48124470
comment on: http://stackoverflow.com/q/30001713
score: 0
type: Comment
type: QuestionComment
has text: @slebetman thanks for this other link. it is helpful to some extent as well. i like hot it ends by showing what async code looks like, i.e. with a great deal of nesting!

http://stackoverflow.com/comment/47906801
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29882133
has text: You probably edited your manifest for the example, but do note that the correct match pattern for your content script is `*://google.com/*` (one less slash). I suspect it's just a typo. Edit: I edited it in the question, since it's not related to your problem.
score: 1

http://stackoverflow.com/a/29865732
type: Answer
upvote count: 1
score: 1
type: AcceptedAnswer
has body: At first, in this case any modifications are not required :) But answering to your question forking ui-grid repo would be perfect. And you can still use bower :) ui-grid is able to handle sorting and pagination with only config object. I'm using ui-router as well to modify page URL with current page number or name of the sorted column. I mixed up two examples from the docs - external sorting and external pagination, to show them both working together. So if you want to re-use it in easy way, just make a service or simple decorator. Cheers! http://plnkr.co/edit/XD06tjcTQsg6YiWpjRsN?p=preview
accepted answer of: http://stackoverflow.com/q/29864939
answers question: http://stackoverflow.com/q/29864939
downvote count: 0

http://stackoverflow.com/comment/48001610
type: Comment
comment on: http://stackoverflow.com/q/29940202
type: QuestionComment
has text: As .on() works to delegate event, i thought and was hoping .off() could take then out also in a deleagated sort of way
score: 0

http://stackoverflow.com/q/29938383
has answer: http://stackoverflow.com/a/29938828
accepted answer: http://stackoverflow.com/a/29938828
tagged with: javascript
has comment: http://stackoverflow.com/comment/47998299
has body: I'm trying to display some data using a ng-repeat. I want to have a filter on the displayed data and when I click on a specific item the filter should be removed. When I click again on that specific item, the filter should be added again. I've started with an idea, in my view I have: &lt;ion-item class="row" ng-repeat="t in tickets"&gt; &lt;div class="col" ng-click="toggleFilter(t.name)"&gt;{{t.name}}&lt;/div&gt; &lt;/ion-item&gt; In my controller: .controller('TicketCtrl', function ($scope, $filter) { $scope.toggleFilter = function (name) { name = $filter('getSlice')(name); alert(name); } }); When I alert the name it gives the correct filtered item, but it's not updating in the view. I think this has to do something with a child scope of the ng-repeat, but I don't know how to do this with toggling a filter. Does anyone has any suggestions or a solution to solve this problem?
possible better answer: http://stackoverflow.com/a/29939060
favorite count: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/29939060
answer count: 3
has title: Angular toggle filter in ng-repeat
tagged with: angularjs-ng-repeat
type: AnsweredQuestion
downvote count: 0
score: 6
type: Question
has comment: http://stackoverflow.com/comment/47998748
has answer: http://stackoverflow.com/a/29938865
upvote count: 6

http://stackoverflow.com/q/30002591
favorite count: 0
has answer: http://stackoverflow.com/a/30002675
type: UnansweredQuestion
downvote count: 2
upvote count: 1
has answer: http://stackoverflow.com/a/30002890
has answer: http://stackoverflow.com/a/30002659
has title: Why can't I name a JavaScript function 'function'?
score: -1
has body: I have an input button and when the user clicks it's supposed to change background. What's wrong here? &lt;input type="button" value="" onclick="function()" id="sqr1" /&gt; &lt;script&gt; var vsqr1 = document.getElementById("sqr1"); function function() { vsqr1.style.backgroundColor = "#000"; } &lt;/script&gt;
type: Question
tagged with: function
has comment: http://stackoverflow.com/comment/48124325
tagged with: javascript
has comment: http://stackoverflow.com/comment/48123792
has comment: http://stackoverflow.com/comment/48123871
has answer: http://stackoverflow.com/a/30002671
answer count: 4

http://stackoverflow.com/comment/47854516
comment on: http://stackoverflow.com/q/29864623
score: 0
has text: what to do with `enter` , `backspace` ? Any Idea?
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29895590
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47913996
has comment: http://stackoverflow.com/comment/47913822
downvote count: 1
has comment: http://stackoverflow.com/comment/47913948
type: Question
has answer: http://stackoverflow.com/a/29895777
upvote count: 0
has answer: http://stackoverflow.com/a/29895746
tagged with: javascript
has title: jQuery's `.not` not working
tagged with: jquery
score: -1
has answer: http://stackoverflow.com/a/29895850
has body: I'm accomplishing a collapsible menu in jQuery. After clicking on any header it's next sibling (the box) should be expanded and all other boxes should be collapsed. HTML &lt;div class="finbox" id="finbox1"&gt; &lt;div class="finheader" id="finheader1"&gt; &lt;div class="finleft"&gt;1. Before you place your order &amp;gt; sign in &lt;/div&gt; &lt;div class="finright"&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="finbody"&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="finbox" id="finbox2"&gt; &lt;div class="finheader" id="finheader2"&gt; &lt;div class="finleft"&gt;2. Delivery Address &lt;/div&gt; &lt;div class="finright"&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="finbody"&gt; &lt;/div&gt; &lt;/div&gt; ... ... ... jQuery $('.finheader').click(function(e){ $(this).next().slideDown(); // .finbody slide down $(this).next().addClass('selbdy'); $(this).addClass('finsel'); $('.finbody:not(.selbdy)').slideUp(); // All .finbody except '.selbdy' slide down console.log('Slide Down'); });
answer count: 3
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47913953

http://stackoverflow.com/a/29922842
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/47974922
type: Answer
upvote count: 2
score: 2
answers question: http://stackoverflow.com/q/29922704
has comment: http://stackoverflow.com/comment/47972260
accepted answer of: http://stackoverflow.com/q/29922704
has body: Change it to use: alert(elem.html()); Example here

http://stackoverflow.com/comment/48008327
has text: @mplungjan Could you please modify my sample code to reflect what you are recommending?
type: Comment
comment on: http://stackoverflow.com/q/29943445
type: QuestionComment
score: 0

http://stackoverflow.com/a/29853354
answers question: http://stackoverflow.com/q/29853126
has body: You can convert a javascript object to json with JSON.stringify()
score: 0
type: Answer

http://stackoverflow.com/q/29867862
linked to: http://stackoverflow.com/q/8888491
has comment: http://stackoverflow.com/comment/47860692
has answer: http://stackoverflow.com/a/29868028
has comment: http://stackoverflow.com/comment/47860626
downvote count: 0
possible better answer: http://stackoverflow.com/a/41734080
has answer: http://stackoverflow.com/a/41734080
favorite count: 0
has body: I have a Javascript in which I need to paste the current time in a format HH:MM AM/PM. There's one catch - I need to put the time that starts in two hours from now, so for example, instead of 7:23PM I need to put 9:23PM, etc. I tried to do something like: var dateFormat = new Date("hh:mm a") but it didn't work. I also tried to use: var today = new Date(); var time = today.toLocaleTimeString().replace(/([\d]+:[\d]{2})(:[\d]{2})(.*)/, "$1$3") alert(time); but all I've seen was e.g. 18:23 instead of 6:23 PM (probably because of toLocaleTimeString() and my location in Europe) - maybe there's some unified way to do that that will work all around the World?. Also, I don't know exactly how to add the 2 hours to the final result. Can you help me? Thanks!
linked to: http://stackoverflow.com/q/24315100
tagged with: datetime
answer count: 4
accepted answer: http://stackoverflow.com/a/29868028
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/58892934
has answer: http://stackoverflow.com/a/29869623
has comment: http://stackoverflow.com/comment/47860753
type: Question
has comment: http://stackoverflow.com/comment/104586405
score: 10
tagged with: javascript
tagged with: date
upvote count: 10
tagged with: datetime-format
has title: How to get current time in a format hh:mm AM/PM in Javascript?

webmethod
tags question: http://stackoverflow.com/q/29973237
type: Tag
tag name: webmethod

http://stackoverflow.com/comment/48046425
has text: JSON is better because it's lighter for client side ;-)
type: Comment
comment on: http://stackoverflow.com/q/29963009
type: QuestionComment
score: 0

http://stackoverflow.com/q/29893903
has body: I'm writing some trigger code in Azure DocumentDB. Is there a way of using/referencing JavaScript libraries (such as underscore) within server Stored Procedures, Triggers and User Defined Functions? Thanks
accepted answer: http://stackoverflow.com/a/29900071
tagged with: javascript
tagged with: azure
type: AnsweredQuestion
downvote count: 0
score: 1
favorite count: 0
type: Question
upvote count: 1
answer count: 1
has answer: http://stackoverflow.com/a/29900071
tagged with: nosql
tagged with: stored-procedures
tagged with: azure-cosmosdb
has title: Is there a way of using JavaScript libraries in Azure DocumentDB server code?

yii
tags question: http://stackoverflow.com/q/29912620
tag name: yii
type: Tag
tags question: http://stackoverflow.com/q/29975374

http://stackoverflow.com/a/29876640
has comment: http://stackoverflow.com/comment/47877534
has body: Within the index page on your site you have links to the javascript files e.g. &lt;script src="vendors/jquery.easings.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="jquery.fullPage.js"&gt;&lt;/script&gt; Neither of these files that you refer to are in the location that is specified, i.e. the browser cannot find the files to download. If the files are supposed to be in a directory "vendor" then there should be a "vendor" directory underneath the directory of the index.html file. The jquery.fullPage.js file should be in the same directory as the index.html file. The above said, try to keep all your js files in a single directory or it get very confusing.
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29875967
upvote count: 2
answers question: http://stackoverflow.com/q/29875967
type: Answer
score: 2

http://stackoverflow.com/q/29935868
has comment: http://stackoverflow.com/comment/47993772
has answer: http://stackoverflow.com/a/29936094
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47993630
has answer: http://stackoverflow.com/a/29936216
has comment: http://stackoverflow.com/comment/47993548
has comment: http://stackoverflow.com/comment/47993968
type: Question
answer count: 2
tagged with: javascript
has body: How to initilize dynamic number with in css selector? Ex-pageUrl.QuerySelector(.attachment-type-table .qa-type-id-label-for-25) The above line given only one Result Photograph. I need to get all names with in span tag ( qa-type-id-label-for-26,qa-type-id-label-for-25, qa-type-id-label-for-27 etc)
tagged with: jquery
score: 0
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/190253
has comment: http://stackoverflow.com/comment/47994159
has comment: http://stackoverflow.com/comment/47993718
has title: How to initialize dynamic input with css selector using query selector?
has comment: http://stackoverflow.com/comment/47993842

rtmp
tag name: rtmp
tags question: http://stackoverflow.com/q/29897260
type: Tag

http://stackoverflow.com/comment/47953767
score: 0
type: Comment
type: QuestionComment
has text: Yes i am looking for a better cleaner way that i dont know and getting all these negatives. Well the requirement says there are a list of items and one can select as many items and click on open button. On open button click all these items details open. The details of these items are maintained by another URL. So we simply have a loop which window opens these different items. But for some reason we want the next window to open only after previous one has loaded. What do you think is the right approach.
comment on: http://stackoverflow.com/q/29915700

http://stackoverflow.com/q/29990147
type: AnsweredQuestion
score: 1
possible better answer: http://stackoverflow.com/a/36738980
has answer: http://stackoverflow.com/a/36738980
answer count: 2
has title: Calling a Service function from a Controller in AngularJS
accepted answer: http://stackoverflow.com/a/29990356
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: controller
tagged with: service
tagged with: angularjs
upvote count: 1
has answer: http://stackoverflow.com/a/29990356
has body: Controller Code 'use strict'; angular.module('MyApp').controller('ArticleContribEmailController', [ '$scope', 'ArticleAppState', 'fbsUserDataService', 'contribEmailService', function ($scope, ArticleAppState, fbsUserDataService, contribEmailService ) { this.userChanged = function () { if (fbsUserDataService.initialized &amp;&amp; fbsUserDataService.user &amp;&amp; ArticleAppState.page_data) { // user has authenticated. contribEmailService.initForm(); } }; // watch for when user data is available, run userChanged. $scope.$watch(function() { return fbsUserDataService.user; }, this.userChanged); $scope.$watch(function() { return fbsUserDataService.initialized; }, this.userChanged); } ]); Service Code 'use strict'; angular.module('forbesArticleApp').service('contribEmailService', [ '$injector', '$route', 'ArticleAppState', 'fbsUserFormFactory', 'fbsUserDataService', function initForm ($injector, $route, ArticleAppState, fbsUserFormFactory, fbsUserDataService) { console.log("Hello world!"); } ]); I only want to fire the contribEmailService.initForm() function from the call in my controller, but it is firing as soon as the page loads. How do I set when the service function initForm() is called?
type: Question

http://stackoverflow.com/comment/48113543
comment on: http://stackoverflow.com/q/29996934
has text: If you want code reviewed, there's [CodeReview](https://codereview.stackexchange.com/).
score: 1
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/48077318
comment on: http://stackoverflow.com/q/29977701
type: Comment
type: QuestionComment
has text: This is one of many reasons we use moment.js for all of our javascript dates.
score: 0

http://stackoverflow.com/comment/47898673
score: 1
has text: well thats why you are not deleting anything, i never use reactive table but is this table inside some helper? where the context of this is on the object collection?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29886550

http://stackoverflow.com/q/29918109
has comment: http://stackoverflow.com/comment/47957413
score: 3
has comment: http://stackoverflow.com/comment/47957255
has comment: http://stackoverflow.com/comment/47958071
tagged with: javascript
has answer: http://stackoverflow.com/a/29918388
answer count: 2
downvote count: 0
tagged with: jquery
favorite count: 0
tagged with: ajax
has body: I am trying to get CRM data using the Ajax call. Data is being returned with 'd' and 'result' properties but I can't get it on client side. It says ajaxdata.d is undefined. A sample Ajax call: var context = Xrm.Page.context; var serverUrl = context.getClientUrl(); var ODATA_ENDPOINT = context.prependOrgName("/xRMServices/2011/OrganizationData.svc"); var filter = "?&amp;$select=cc_TypeID,cc_customentityId,cc_anotherAttribute&amp;$filter=cc_TypeID eq '2'"; var odataUri = ODATA_ENDPOINT + "/cc_customentitySet" + filter; console.log("odataUri: " + odataUri); //Asynchronous AJAX function to Retrieve a CRM record using OData $.ajax({ type: "GET", contentType: "application/json; charset=utf-8", datatype: "json", url: odataUri, async: false, beforeSend: function (XMLHttpRequest) { //Specifying this header ensures that the results will be returned as JSON. XMLHttpRequest.setRequestHeader("Accept", "application/json"); }, success: function (ajaxdata, textStatus, XmlHttpRequest) { //console.log("cc_campaignSynch.htm &gt; ready &gt; $.ajax success: " + data); debugger; }, error: function (XmlHttpRequest, textStatus, errorThrown) { console.log("cc_campaignSynch.htm &gt; ready &gt; $.ajax error: " + XmlHttpRequest.responseText); } }); Snapshot of data returned: Updated Snapshot (JSON.parse used):
accepted answer: http://stackoverflow.com/a/29918388
type: AnsweredQuestion
has title: jQuery ajax data.d undefined
upvote count: 3
possible better answer: http://stackoverflow.com/a/29918740
has answer: http://stackoverflow.com/a/29918740
tagged with: dynamics-crm
type: Question

http://stackoverflow.com/comment/47877494
type: Comment
type: QuestionComment
has text: possible duplicate of [How to return the response from an asynchronous call?](http://stackoverflow.com/questions/14220321/how-to-return-the-response-from-an-asynchronous-call)
score: 3
comment on: http://stackoverflow.com/q/29876606

http://stackoverflow.com/a/29953648
upvote count: 3
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29953409
answers question: http://stackoverflow.com/q/29953409
type: Answer
has body: Why not use oncanplay event? Something like: var audio=new Audio("sample.mp3"); audio.oncanplay = function(){ alert(audio.duration); }; The oncanplay event fires when enough information has been and the audio is ready to start playing.
score: 3

http://stackoverflow.com/a/29968159
answers question: http://stackoverflow.com/q/29966629
upvote count: 1
type: Answer
downvote count: 0
score: 1
has body: Your problem is that this.$("#tags") searches for a DOM element with id: tags inside your components DOM element. To solve your problem, you should use this.$().tagsInput({..}) instead. Also see this JSBin for a working example.

myo
tag name: myo
type: Tag
tags question: http://stackoverflow.com/q/29864623

http://stackoverflow.com/comment/48015774
type: Comment
has text: what u want.. extract `filename` ? can u explain?
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29947379

http://stackoverflow.com/a/29909604
answers question: http://stackoverflow.com/q/29909528
type: Answer
upvote count: 1
has body: You can just use normal string comparison or searching functions. if (window.location.href.indexOf('/folder/' !== -1) { // found partial match } Or, you can be more specific if you want it to be only at the top part of the path: if (window.location.href.indexOf('http://domain.com/folder/' !== -1) { // found partial match } Or, if you want to see if the path starts with "/folder/", you can use a regex on just the pathname: if (window.location.pathname.test(/^\/folder\//)) { // pathname starts with /folder/ }
score: 1
downvote count: 0

http://stackoverflow.com/q/29910621
tagged with: css
has answer: http://stackoverflow.com/a/29910709
has comment: http://stackoverflow.com/comment/48134379
has comment: http://stackoverflow.com/comment/47943642
type: UnansweredQuestion
score: -3
has comment: http://stackoverflow.com/comment/47943705
has answer: http://stackoverflow.com/a/29910699
has comment: http://stackoverflow.com/comment/47943568
downvote count: 3
has body: I am having small of daily visitor 400 per-day. I planed to create the popup ads first I created the popup ads to open in new window . It was quit irritating the visitors . My New window popup code var firstClick = true; document.body.onclick = function() { if (firstClick) { window.open('popup creating website', 'poppage', 'toolbars=0, scrollbars=1, location=0, statusbars=0, menubars=0, resizable=1, width=950, height=650, left = 300, top = 50'); window.open('popup creating second website', 'poppage2', 'toolbars=0, scrollbars=1, location=0, statusbars=0, menubars=0, resizable=1, width=950, height=650, left = 200, top = 10'); firstClick = false; } } what i planed to get is first click on the web page to open the new tab . Thank you
type: Question
answer count: 2
has title: How to Open the popup ads in new tab insted of new window
upvote count: 0
tagged with: javascript
linked to: http://stackoverflow.com/q/4907843
favorite count: 0
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/a/29990509
type: AcceptedAnswer
score: 4
type: Answer
upvote count: 4
has comment: http://stackoverflow.com/comment/48100466
downvote count: 0
has comment: http://stackoverflow.com/comment/48100317
accepted answer of: http://stackoverflow.com/q/29990434
has comment: http://stackoverflow.com/comment/48100419
answers question: http://stackoverflow.com/q/29990434
has body: Rework it with jQuery promises like this: function init() { xmlPreparer().then(function(data){ parseXml(data); pointOnMap(); }); } //add source - returns the Ajax promise function xmlPreparer() { return $.ajax({ type: "GET", url: "./mesta.xml", dataType: "xml" }); } Note: the difference between then and done is that then allows for a second fail function to be passed. done is like success: in Ajax and has a matching fail() function so you could also write. function init() { xmlPreparer().done(function(data){ parseXml(data); pointOnMap(); }).fail(function(){ alert("arggh!"); }); }

http://stackoverflow.com/q/29894781
has answer: http://stackoverflow.com/a/66878952
tagged with: getselection
tagged with: javascript
has answer: http://stackoverflow.com/a/29985896
has answer: http://stackoverflow.com/a/30093007
accepted answer: http://stackoverflow.com/a/30093007
downvote count: 1
answer count: 7
favorite count: 0
has answer: http://stackoverflow.com/a/29895300
has answer: http://stackoverflow.com/a/30120669
has answer: http://stackoverflow.com/a/29895126
upvote count: 22
has body: I have a html page with text content. On selecting any text and pressing the highlight button, I can change the style of the selected text to highlight the same. To implement this feature, i have written the following method. sel = window.getSelection(); var range = sel.getRangeAt(0); var span = document.createElement('span'); span.className = "highlight" + color; range.surroundContents(span); This is working fine if you choose a text with no html tag, but when the text has any html tag in between, it is giving error Failed to execute 'surroundContents' on 'Range': The Range has partially selected a non-Text node. How to solve this problem. Is it possible to highlight the same separately for each part(divided by html tags)?
has title: Javascript selected text highlighting prob
has comment: http://stackoverflow.com/comment/47912619
type: AnsweredQuestion
score: 21
has answer: http://stackoverflow.com/a/30095398
possible better answer: http://stackoverflow.com/a/29895300
type: Question

http://stackoverflow.com/a/29995860
has body: This regex will match all of the cases: *while +\( *([a-z]\w*) *([=&lt;&gt;]=?) *([a-z]\w*|\d+) *\) * Have a look at the updated regex I mainly added a quantifier + to [=&lt;&gt;]+, and removed anchors ^ and $ for better visualization (you may revert them if you test individual strings). I replaced [a-zA-Z0-9_] with \w (they are identical), and [0-9] with almost identical \d. Case insensitive i option should work well with [a-z] character class. If you also plan to add != support, try: *while +\( *([a-z]\w*) *((?:!=|[=&lt;&gt;]=?)) *([a-z]\w*|\d+) *\) * Demo 2
has comment: http://stackoverflow.com/comment/48111282
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/48111449
downvote count: 0
has comment: http://stackoverflow.com/comment/48111613
accepted answer of: http://stackoverflow.com/q/29995820
type: Answer
has comment: http://stackoverflow.com/comment/48111468
has comment: http://stackoverflow.com/comment/48111633
score: 2
upvote count: 2
has comment: http://stackoverflow.com/comment/48111346
answers question: http://stackoverflow.com/q/29995820

storage
tag name: storage
tags question: http://stackoverflow.com/q/29883328
type: Tag

chart.js
tags question: http://stackoverflow.com/q/29928522
tags question: http://stackoverflow.com/q/29930297
tags question: http://stackoverflow.com/q/29938945
tags question: http://stackoverflow.com/q/29856304
type: Tag
tags question: http://stackoverflow.com/q/29861670
tags question: http://stackoverflow.com/q/29903702
tags question: http://stackoverflow.com/q/29973533
tag name: chart.js
tags question: http://stackoverflow.com/q/29894577
tags question: http://stackoverflow.com/q/29865168
tags question: http://stackoverflow.com/q/29934701
tags question: http://stackoverflow.com/q/29925431
tags question: http://stackoverflow.com/q/29885809

http://stackoverflow.com/a/29928815
upvote count: 2
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29928734
type: Answer
accepted answer of: http://stackoverflow.com/q/29928734
score: 2
downvote count: 0
has body: Wrong syntax. Let me re-indent your code, with comments: "content_scripts": [ // An array { // An object inside this array // Properties of that object "matches": [ "*://solecarts.com/monitor/run.html*", "*://www.solecarts.com/monitor/run.html*" ], "js": ["query.js"], // Same properties within the same object? "matches": [ "*://solecarts.com/monitor/shopify.html*", "*://www.solecarts.com/monitor/shopify.html*" ], "js": ["shopify.js"] } ], Instead, it should be an array containing two separate objects: "content_scripts": [ { "matches": [ "*://solecarts.com/monitor/run.html*", "*://www.solecarts.com/monitor/run.html*" ], "js": ["query.js"] }, { "matches": [ "*://solecarts.com/monitor/shopify.html*", "*://www.solecarts.com/monitor/shopify.html*" ], "js": ["shopify.js"] } ], Do note that comments are not allowed in JSON format. First snippet was just informational.

http://stackoverflow.com/comment/47980306
has text: Same errors for both - `Failed: stale element reference: element is not attached to the page document` - it seems like because the DOM is changing, I'm required to once again fetch all the 'multiSelectLi' elements.
score: 1
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29929028

http://stackoverflow.com/q/29883256
type: AnsweredQuestion
has body: I am not able to change the css properties of a div when calling the onClick function. hello × Well done! You successfully posted to Facebook! @using (Html.BeginForm("distShare", null, new { area = "" })) { Share this to Facebook } function facebookButton2() { document.getElementById("notification").style.visibility = visible; document.getElementById("notification").style.color = red; document.getElementById("hello").style.color = red; } The "hello" was simply for testing purposes. I have tried using JQuery and the onSubmit function as well. The notification div starts off as visibility: hidden.
possible better answer: http://stackoverflow.com/a/29883306
score: 1
upvote count: 1
has answer: http://stackoverflow.com/a/29883294
type: Question
accepted answer: http://stackoverflow.com/a/29883294
downvote count: 0
tagged with: javascript
answer count: 3
favorite count: 0
tagged with: twitter-bootstrap
has answer: http://stackoverflow.com/a/29883626
has title: How to call a onClick javascript function using bootstrap buttons and inside a form?
has answer: http://stackoverflow.com/a/29883306
has comment: http://stackoverflow.com/comment/47890492

http://stackoverflow.com/comment/47909880
type: QuestionComment
type: Comment
score: 0
comment on: http://stackoverflow.com/q/29880071
has text: Lookup "one hot encoding"

http://stackoverflow.com/comment/47864957
score: 0
type: Comment
comment on: http://stackoverflow.com/q/29859521
type: QuestionComment
has text: why not just use ruby's csv library? here's an example : http://www.sitepoint.com/guide-ruby-csv-library-part/

http://stackoverflow.com/a/29930617
has comment: http://stackoverflow.com/comment/47983685
type: Answer
has comment: http://stackoverflow.com/comment/47983830
answers question: http://stackoverflow.com/q/29930552
has comment: http://stackoverflow.com/comment/47983976
score: 0
has body: if you can add a reference to jQuery, then this can be done in one line using the :checked selector when you do a $('#mySection input:checked'), it returns you an array of checked checkboxes which you can further process as required.

http://stackoverflow.com/q/29852408
downvote count: 4
answer count: 3
score: 5
has answer: http://stackoverflow.com/a/29853360
has body: I'm looking for a way to get "tomorrow" and "the day after tomorrow" returned from a function that receives to dates: The current date: "2015/04/24 18:15:00" The date in the future: "2015/04/25 02:40:00" The function should return "tomorrow" here. I tried looking up some functions but they all return 0 not 1. function days_between(date1, date2) { // The number of milliseconds in one day var ONE_DAY = 1000 * 60 * 60 * 24 // Convert both dates to milliseconds var date1_ms = date1.getTime() var date2_ms = date2.getTime() // Calculate the difference in milliseconds var difference_ms = Math.abs(date1_ms - date2_ms) // Convert back to days and return return Math.round(difference_ms/ONE_DAY) } Any ideas?
favorite count: 0
tagged with: date-arithmetic
has title: Check if a date is "tomorrow" or "the day after tomorrow"
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29853360
has answer: http://stackoverflow.com/a/75477786
possible better answer: http://stackoverflow.com/a/66907719
has answer: http://stackoverflow.com/a/66907719
type: Question
has comment: http://stackoverflow.com/comment/47830737
upvote count: 9
has comment: http://stackoverflow.com/comment/47830708
tagged with: javascript
tagged with: date

http://stackoverflow.com/comment/47866109
comment on: http://stackoverflow.com/a/29870527
has text: My pleasure -- it was fun!
type: Comment
score: 1
type: AnswerComment

http://stackoverflow.com/comment/47951912
type: Comment
type: AnswerComment
has text: Yes, that made wonders! Now, the last thing. I would like to rotate the blue cube 120degrees to the right when hitting >. The thing is, it returns to it's primal form after it have rotate. Also, I can only click once, then the buttons sort of lock itself. The same goes if you hit the < but then the blue cube rotates 120degrees to the left.
comment on: http://stackoverflow.com/a/29877212
score: 0

hyperlink
tags question: http://stackoverflow.com/q/29920428
tags question: http://stackoverflow.com/q/29895032
tags question: http://stackoverflow.com/q/29933597
tag name: hyperlink
type: Tag
tags question: http://stackoverflow.com/q/29878791

http://stackoverflow.com/comment/48093734
type: QuestionComment
comment on: http://stackoverflow.com/q/29987238
has text: What's `city`? Can't you already take what you've done with `countNames` and just add each to an array instead?
score: 4
type: Comment

http://stackoverflow.com/comment/48112704
has text: just combine the hover and active rules into one. rules can have as many comma separated selectors as you want
type: AnswerComment
comment on: http://stackoverflow.com/a/29996525
score: 0
type: Comment

http://stackoverflow.com/q/29885866
has answer: http://stackoverflow.com/a/29885944
type: AnsweredQuestion
downvote count: 0
score: 1
type: Question
has title: How do I make one image appear in random locations on a canvas each time it is loaded?
tagged with: canvas
upvote count: 1
answer count: 1
tagged with: javascript
favorite count: 0
accepted answer: http://stackoverflow.com/a/29885944
tagged with: http://stackoverflow.com/tag/html
has body: I am making a simple game in which the player must find an image somewhere on a canvas. However, I would like to make this single image appear at different locations on the canvas and then stay there until the canvas is loaded again. In other words, I do not want the image to just keep randomly appearing on the canvas after a certain time interval. Instead, I would like for the position of the image to be randomized every time the canvas is loaded. Any suggestions?

http://stackoverflow.com/comment/48078084
score: 0
type: Comment
type: AnswerComment
has text: Glad that you figured it out. Added it to the answer just in case it helps someone.
comment on: http://stackoverflow.com/a/29950973

http://stackoverflow.com/q/29850394
has comment: http://stackoverflow.com/comment/47827640
score: 0
has comment: http://stackoverflow.com/comment/47827581
answer count: 2
has answer: http://stackoverflow.com/a/29851358
tagged with: css-position
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has body: A relatively (I hope) simple question about CSS that I'm clearly just not getting. I have a modal on my page with the following style definition: .modal { position: fixed; width: 86% !important; left: 7% !important; height: 86% !important; top: 3% !important; background-color: #ffffff; border-radius: 5px; text-align: left; margin: 10px; padding: 10px; z-index: 10000; } Inside the modal I would like to have 4 items: 1) An image on the left hand-side, proportionately resized to the height of the modal 2) A text box to the right of the image 3) Another text box, also to the right of the image, and below the first text box 4) A 'Close' button in the upper-right corner Here is the mock-up: My issue is that when the content of Text 2 goes beyond the end of the modal, instead of the text wrapping, it moves the entire text box below the modal, thus making it effectively invisible. I need to allow the text in both Text 1 and Text 2 to wrap, especially in Text 2. Here is the html code driving this: &lt;div id="modal" class="modal" style="visibility: hidden;"&gt; &lt;img align="middle" class="modalImg" id="modalImg" /&gt; &lt;span style="float:left;"&gt; &lt;h2 id="textBox1"&gt;&lt;/h2&gt; &lt;br/&gt; &lt;h3 id="textBox2"&gt;&lt;/h3&gt; &lt;img id="close" src="images/css/close.png" /&gt; &lt;/div&gt; And the related css styles: .modalImg { height: 100%; width:auto; margin: 0px 25px 0px 0px; float: left; } .modal #close { position: absolute; top: 5px; right: 5px; } h2 { color:#384D73; font-size:20px; margin:20px 0 10px 0; clear:both; } h3 { color:#384D73; font-size:18px; margin:20px 0 5px 0; clear:both; line-height: 125%; } Can anyone help me configure this properly? Thanks in advance!
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/29851358
tagged with: css-float
has title: CSS Positioning: wrapping text inside a modal
has comment: http://stackoverflow.com/comment/47827523
type: Question
has answer: http://stackoverflow.com/a/29850819
accepted answer: http://stackoverflow.com/a/29850819
tagged with: javascript

http://stackoverflow.com/comment/47941063
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29909070
has text: @ShawnJacobson I've added screenshot to show what it gives me every time.
score: 0

http://stackoverflow.com/comment/47990706
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29933818
has text: where you are calling `info` function here??
score: 0

http://stackoverflow.com/comment/48401512
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29993216
has text: Hi, I've answered below. Please let me know about your findings in regards to loading speed. Thks
score: 0

http://stackoverflow.com/comment/47856389
type: AnswerComment
score: 0
type: Comment
has text: When you `put(doc1)`, you should never use the `doc1` object again, because it will not be decorated with the `_rev` member. You need to `get()` in order to get a new `doc2` object. That's why all the examples require you to `put()` and then `get()`. E.g. this page describes updating a document: http://pouchdb.com/guides/documents.html
comment on: http://stackoverflow.com/a/29853576

http://stackoverflow.com/comment/48257893
comment on: http://stackoverflow.com/a/30065988
score: 0
type: Comment
type: AnswerComment
has text: Hi, thanks. I have to be doing something wrong but I can't find what is it...it seems that everytime I call "PartnerDetail.getPartnerId" it uses the Module has if it was in his initial value with -1

http://stackoverflow.com/comment/139429383
type: Comment
type: QuestionComment
has text: This question is similar to: [What’s the use of an arrow function that returns an arrow function?](https://stackoverflow.com/questions/56857963/what-s-the-use-of-an-arrow-function-that-returns-an-arrow-function). If you believe it’s different, please [edit] the question, make it clear how it’s different and/or how the answers on that question are not helpful for your problem.
comment on: http://stackoverflow.com/q/29897402
score: 0

http://stackoverflow.com/comment/81116888
comment on: http://stackoverflow.com/q/29986657
type: Comment
has text: If you really think "Global Variable usage on document.readypage reload" is a worthy question title... Idek what to say. You're entitled to that opinion, you can roll it back and see if it gets approved.
score: 0
type: QuestionComment

http://stackoverflow.com/a/29940035
has body: Your problem here is async, you need to execute ajax call from a function: for (var i = 0; i &lt; lengthTotal; i++) { (function (i) { // this is a self-executing anonnymus function // lace ajax here })(i); } Your problem is simple. You are creating a loop with variable i. But inside th loop you are calling ajax call -async. Not let's say, your loop iterated in 0,001ms. And AJAX call takes 0.5 ms. When AJAX will return a response, your loop will have ended, but i variable will be already incremented, and it's value will be 2. To avoid this, you need to wrap your javascript call inside a function and pass i as a parameter. That way i will be copied, and incrementing it outside the function will not affect it.
answers question: http://stackoverflow.com/q/29939357
type: Answer
score: 0

http://stackoverflow.com/a/29917463
score: 0
answers question: http://stackoverflow.com/q/29917438
type: Answer
has comment: http://stackoverflow.com/comment/47956020
has body: You can use function onclick="exampl_function()" in html while generating it

http://stackoverflow.com/comment/47892656
comment on: http://stackoverflow.com/q/29884332
type: QuestionComment
has text: No, it's not actually CSS, it's javascript, and it does set inline styles, and those are valid CSS.
score: 6
type: Comment

http://stackoverflow.com/comment/48072714
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29976509
has text: Where would I insert this?

http://stackoverflow.com/a/29986376
upvote count: 2
downvote count: 2
has body: Simply change this $(document).ready(function(){ $("#flip").click(function(){ $("#panel").slideDown("slow"); }); }); to $(document).ready(function(){ $("#panel").slideDown("slow"); });
has comment: http://stackoverflow.com/comment/48092102
score: 0
answers question: http://stackoverflow.com/q/29986342
type: Answer

http://stackoverflow.com/a/30019088
has body: Seems there's no other way and I am using categories. Thanks @Ondkloss !
score: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29947062
type: Answer
answers question: http://stackoverflow.com/q/29947062

http://stackoverflow.com/comment/47985487
score: 0
has text: agreed I will do just that
type: AnswerComment
comment on: http://stackoverflow.com/a/29931406
type: Comment

http://stackoverflow.com/a/29912001
score: 0
type: Answer
has body: You can do something like this. HTML: &lt;input id="id" type="text" /&gt; JavaScript: var inputBox = document.getElementById("id"); inputBox.addEventListener("contextmenu", handler, useCapture); // useCapture: true or false //inputBox.attachEvent("oncontextmenu", handler); // IE &lt;9; use attachEvent for IE &lt;9 support. function handler(event) { // your code goes here alert("right click on inputbox") event.preventDefault(); event.returnvalue = false; // IE &lt;=9; } Here is my example: DEMO
answers question: http://stackoverflow.com/q/29911387

http://stackoverflow.com/a/29906460
has comment: http://stackoverflow.com/comment/47935972
type: Answer
upvote count: 1
has body: $(".txtAddEditDel").val(''); should work, assuming its getting there. Have you put some debugging information to check the if clause is true? It may be a better idea to check against the value of the option rather than the text, as the text could easily be misspelt or changed where as a default value will, in my experience, be '' or 0 in this scenario
score: 1
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29906273
answers question: http://stackoverflow.com/q/29906273

http://stackoverflow.com/a/29990833
answers question: http://stackoverflow.com/q/29990378
upvote count: 5
accepted answer of: http://stackoverflow.com/q/29990378
type: Answer
has body: Try this: var promisesTasksAll = $q.all(promisesTasks); var promisesPaymentsAll = $q.all(promisesPayments); $q.all([promisesTasksAll, promisesPaymentsAll]).then(function(data){ //data[0] will contain promisesTasks data //data[1] will contain promisesPayments data });
downvote count: 0
score: 5
type: AcceptedAnswer

http://stackoverflow.com/comment/47958561
type: AnswerComment
comment on: http://stackoverflow.com/a/29917797
score: 0
type: Comment
has text: You need to call `writeStats.call(this)`. `hangar` doesn't have a `writeTerminal` method, only its prototype does.

http://stackoverflow.com/comment/96168280
has text: My bad. Never saw the mentioned post. Just looked at the question and took a stab at it. Thanks for bringing it to my notice.
type: Comment
score: 1
comment on: http://stackoverflow.com/a/52755547
type: AnswerComment

http://stackoverflow.com/comment/48029682
type: Comment
comment on: http://stackoverflow.com/a/29954445
has text: Great explanation! Thanks! (I'll accept the answer when enough time has passed, SO won't let me accept one so quickly).
score: 0
type: AnswerComment

http://stackoverflow.com/q/29983163
has body: I'm putting together a page for a school and it contains jquery tabs, with a bit of style. The page works perfectly in dreamweaver, but when I upload it to the page the tabs will only very rarely render with styles. They appear to just not take the css or js, so I experimented with forcing it to render after the entire page loads, but it could very well be that it needs to render BEFORE the page loads. I know it works because occasionally i see them as tabs, and then after a reload they disappear and don't come back till I reload another 20 times. Here are a few options of the js I've used: $(window).load(function() { $("div.Tabs1").tabs(); }); and $("div.Tabs1").tabs(); etc. I've tried bind, load etc. and it just wont render the tabs consistently. Should I be rendering before or after the page load? Annoyingly it will render some other tabs in the UI of the page I'm tweaking in my style. (I'm putting the page into a learning management system). This works consistently. It just doesn't like mine. Any thoughts would be great.
tagged with: tabs
answer count: 0
type: UnansweredQuestion
tagged with: css
linked to: http://stackoverflow.com/q/3698200
score: 0
type: Question
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/48087958
has comment: http://stackoverflow.com/comment/48085588
has title: Jquery tabs always render without css styles
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/48104930

http://stackoverflow.com/comment/48084689
has text: The Next button only goes to the next element when `curQuantity1 + curQuantity2 + curQuantity3 == 3`. But they're all set to 0, so the total is 0, and you just do the alert.
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29982623
score: 0

http://stackoverflow.com/a/29874032
type: Answer
score: 4
has comment: http://stackoverflow.com/comment/47892025
accepted answer of: http://stackoverflow.com/q/29868977
has comment: http://stackoverflow.com/comment/70197505
answers question: http://stackoverflow.com/q/29868977
upvote count: 4
has comment: http://stackoverflow.com/comment/47890019
downvote count: 0
has body: You might want to try using a combination of the DOMContentLoaded event and requestAnimationFrame. DOMContentLoaded fires after the document has been completely loaded and parsed but before all of the images and other assets on the page have completed downloading. requestAnimationFrame will delay the removal of the class until after the page has been painted so the element will properly transition. var box = document.getElementById('box'), showBox = function (){ box.classList.remove('offscreen'); }; document.addEventListener("DOMContentLoaded", function(event) { window.requestAnimationFrame(showBox); }); jsfiddle
has comment: http://stackoverflow.com/comment/121472822
type: AcceptedAnswer

for-loop
tags question: http://stackoverflow.com/q/29952458
tags question: http://stackoverflow.com/q/29857293
tags question: http://stackoverflow.com/q/29972238
tags question: http://stackoverflow.com/q/29882412
tags question: http://stackoverflow.com/q/29883872
tags question: http://stackoverflow.com/q/29919394
tag name: for-loop
tags question: http://stackoverflow.com/q/29883259
tags question: http://stackoverflow.com/q/29977291
tags question: http://stackoverflow.com/q/29954782
tags question: http://stackoverflow.com/q/29855953
tags question: http://stackoverflow.com/q/29852143
tags question: http://stackoverflow.com/q/29909363
tags question: http://stackoverflow.com/q/29995747
tags question: http://stackoverflow.com/q/29987459
tags question: http://stackoverflow.com/q/29885220
tags question: http://stackoverflow.com/q/29882181
tags question: http://stackoverflow.com/q/29929781
tags question: http://stackoverflow.com/q/29939266
type: Tag
tags question: http://stackoverflow.com/q/29998595
tags question: http://stackoverflow.com/q/29885719
tags question: http://stackoverflow.com/q/29927021
tags question: http://stackoverflow.com/q/29860329
tags question: http://stackoverflow.com/q/29978007
tags question: http://stackoverflow.com/q/29905109
tags question: http://stackoverflow.com/q/29979787
tags question: http://stackoverflow.com/q/29979066

http://stackoverflow.com/comment/136237829
has text: This also give the warning: "Use of Mutation Events is deprecated. Use MutationObserver instead."
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/54642735

http://stackoverflow.com/comment/48069462
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/29974791
has text: well your question was pertaining to textures not objects.
type: Comment

http://stackoverflow.com/comment/48009055
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29943896
has text: Whats your modal id, `myModal` or `loanScenarioModal`?

http://stackoverflow.com/q/29940963
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29941501
has answer: http://stackoverflow.com/a/29941203
type: Question
score: 3
has answer: http://stackoverflow.com/a/29941342
has comment: http://stackoverflow.com/comment/48002751
tagged with: forms
upvote count: 3
answer count: 3
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: angularjs
has title: ng-form to submit dynamically created form without specific ng-model
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/48002852
tagged with: input
has body: Edited the code to ask the question better And thanks for all the help from everyone so far! I have some dynamically created input boxes that do not have a fix number of inputs and would like to submit them as you go.... how could I pass inputs from the input text boxes from the dynamically created form? Hopefully my question make sense? the form I am trying to submit is as follow: how do I pass values into the create()? passing a currently does not work... and referencing $scope.a gets 'undefined'... :( Please help thank you! {{ module.heading }} {{field.name}}

http://stackoverflow.com/comment/48098246
comment on: http://stackoverflow.com/q/29965136
score: 0
has text: I've answered the valid part of this question: `Why isn't this modal displaying correctly?` The first part about bootstrap doesn't fit the SO format. Each post should be only 1 question and questions like `Why doesn't X work?` require a [MVCE](http://stackoverflow.com/help/mcve).
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29957903
has body: I have the following code and I've been trying to get a multipurpose use out of this button/link. If no items are picked, I need it to be a link with static text to the items and it has to utilize the page-scroll class (its an animated scroll to the section then the link stays highlighted while you're in that section) The page scroll only seems to work when in an < li > element. Once an item is picked I want the link to change to a button (or enlighten me, if a link can do what I need) that shows the number of items picked and show loading text while new items are clicked. The button also drops down to show picked items. I've tried it every which way, using only buttons, or only links, but I can only get one of the features to work at a time - either the drop down item/loading feature, or the scroll/highlight feature. I'm think JQuery will help me switch between the link / button. Please help. <?php if ($items) { ?> <button type="button" data-toggle="dropdown" data-loading-text="<?php echo $text_loading; ?>" class="dropdown-toggle"> <?php echo $text_items; ?> <?php } else { ?> Item List <?php } ?> ... This was my other version, but this doesn't give me the animated scrolling or highlight feature, it gives me the static text first, then changes to loading and counts, but if items are removed, it does not revert back to static text, just shows zero items (zero items should = static text): <button type="button" data-toggle="dropdown" data-loading-text="<?php echo $text_loading; ?>" <?php if ($items) { ?> class="dropdown-toggle"><?php echo $text_items; ?> <?php } else { ?> Item List <?php } ?>
type: Question
tagged with: javascript
upvote count: 2
answer count: 1
tagged with: jquery
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: php
tagged with: css
score: 2
has title: Responsive conditional Link / Button with PHP and maybe JQuery
downvote count: 0
has answer: http://stackoverflow.com/a/31226662

http://stackoverflow.com/a/29919061
upvote count: 1
downvote count: 1
has body: Well, in fact you can't. But you can do something else. You can try to list all your properties with var properties = Object.keys(window). Then with a regexp you will select your properties starting with yaCounter : var reg = new RegExp("^yaCounter.*"); var goodProp = []; properties.forEach(function(prop) { if (reg.exec(prop) != null) goodProp.push(prop); } And them use these with : goodProp.forEach(function(val) { window[val]; }));
has comment: http://stackoverflow.com/comment/47959312
score: 0
has comment: http://stackoverflow.com/comment/47959733
type: Answer
answers question: http://stackoverflow.com/q/29918939

http://stackoverflow.com/comment/48049996
type: QuestionComment
comment on: http://stackoverflow.com/q/29948379
score: 0
has text: See http://getbootstrap.com/javascript/#modals-events
type: Comment

http://stackoverflow.com/a/29873420
downvote count: 0
upvote count: 2
answers question: http://stackoverflow.com/q/29860883
type: Answer
score: 2
has body: If number of sides is N and polygon side is defined by coordinates (x1, y1) and (x2, y2), then middle point of this side is (mx, my) = ((x1+x2)/2, (y1+y2)/2) perpendicular vector (left one for anticlockwise order) is (px, py) = (-(y2-y1), x2-x1) unit perpendicular vector (nx, ny) = (px/Len, py/Len), where Len = Sqrt(px*px + py*py) apothem length ApoLen = Len / (2*Tan(Pi/N)) apothem vector (ax, ay) = ApoLen * (nx, ny) = (px / (2 * Tan(Pi/N)), py / (2 * Tan(Pi/N))) polygon centher coordinates are (cx, cy) = (mx, my) + (ax, ay) circumradius R = ApoLen / Cos(Pi/N) Starting angle for vertice (x1, x2) is BaseAngle = ArcTan2(y1 - cy, x1 - cy) and ith vertice (one-based numbering) has angle Ai = BaseAngle + (i - 1) * 2 * Pi / N and coordinates (xi, yi) = (cx + R * Cos(Ai), cy + R * Sin(Ai))

http://stackoverflow.com/q/29979180
has comment: http://stackoverflow.com/comment/48078812
has comment: http://stackoverflow.com/comment/48078848
tagged with: css
has answer: http://stackoverflow.com/a/29979825
type: AnsweredQuestion
has body: I have a key frame animation that I animate on hover for a navigation menu. When I hover over, the animation works just fine but I want it to finish the animation if I move the mouse off. This function is working correctly in Chrome, but not Firefox and I can't figure out why. jsFiddle: http://jsfiddle.net/u95Lumm3/1/ One thing I have noticed, on FF the animation resets even if you keep the mouse on top. Simply removing 'mozAnimationEnd' does not fix the issue like it does in a different, but similar, question on Stackoverflow. HTML: Script: $('.nav-bnt').bind('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function() { $('.nav-bnt').removeClass("animation"); }); $('.nav-bnt').hover(function(){ $('.nav-bnt').addClass("animation"); }) CSS: .nav-bnt div, .nav-bnt div:nth-of-type(3) { top: -15px; bottom: 0; left: 0; right: 0; margin: auto; -moz-transform: translate3d(-1px, 0px, 0px) rotate(0deg); -webkit-transform: translate3d(-1px, 0px, 0px) rotate(0deg); -o-transform: translate3d(-1px, 0px, 0px) rotate(0deg); -ms-transform: translate3d(-1px, 0px, 0px) rotate(0deg); transform: translate3d(-1px, 0px, 0px) rotate(0deg); } .nav-bnt div:nth-of-type(2) { top: 0; -moz-transform: translate3d(-1px, 0px, 0px) rotate(0deg); -webkit-transform: translate3d(-1px, 0px, 0px) rotate(0deg); -o-transform: translate3d(-1px, 0px, 0px) rotate(0deg); -ms-transform: translate3d(-1px, 0px, 0px) rotate(0deg); transform: translate3d(-1px, 0px, 0px) rotate(0deg); } .nav-bnt div:nth-of-type(3) { top: 0; bottom: -16px; } .animation div:nth-of-type(2) { -webkit-animation: navanimateleft .5s; -moz-animation: navanimateleft .5s; -o-animation: navanimateleft .5s; -ms-animation: navanimateleft .5s; animation: navanimateleft .5s; } .animation div:nth-of-type(1), .animation div:nth-of-type(3) { -webkit-animation: navanimateright .5s; -moz-animation: navanimateright .5s; -ms-animation: navanimateright .5s; -o-animation: navanimateright .5s; animation: navanimateright .5s; …
has title: CSS3 Keyframe animation working in chrome, not firefox
has comment: http://stackoverflow.com/comment/48079230
type: Question
has comment: http://stackoverflow.com/comment/48078665
accepted answer: http://stackoverflow.com/a/29979825
score: 0
linked to: http://stackoverflow.com/q/27158301
answer count: 1
has comment: http://stackoverflow.com/comment/48078022
tagged with: javascript
tagged with: jquery
linked to: http://stackoverflow.com/q/16553344
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/48003106
comment on: http://stackoverflow.com/a/29940489
type: Comment
score: 0
type: AnswerComment
has text: i have a repeater which has buttons. And i have a button outside of repeater. when i click the button where is outside, it shows formview in popup. this formview has to be insert mode. Ande when i click the button where in on repeater, it shows formview in popup. this formview has to be edit mode. But i cant do this c#. may be if i do this with javascript, it will works.

http://stackoverflow.com/comment/48018138
type: Comment
type: QuestionComment
has text: Thank you Junius ! I added this line async : false to the ajax call and it solved the problem.
comment on: http://stackoverflow.com/q/29946739
score: 0

http://stackoverflow.com/q/29848473
has comment: http://stackoverflow.com/comment/47825012
has comment: http://stackoverflow.com/comment/47826763
has body: I have a fairly simple select field with options fetched from a database (Magento) and echoed via foreach ($groups as $a){ if($a['label'] != NULL){ echo "&lt;option value='".$a['value']."'&gt;" . $a['label'] . "&lt;option&gt;"; } } My problem is that even with server-side code preventing null fields, I still get empty option fields I also have this JavaScript to sort my options alphabetically, could this cause me to have blank options? function sortlist() { var cl = document.getElementById('group_id'); var clTexts = new Array(); for(i = 2; i &lt; cl.length; i++) { clTexts[i-2] = cl.options[i].text.toUpperCase() + "," + cl.options[i].text + "," + cl.options[i].value; } clTexts.sort(); for(i = 2; i &lt; cl.length; i++) { var parts = clTexts[i-2].split(','); cl.options[i].text = parts[1]; cl.options[i].value = parts[2]; } } sortlist(); How could one ensure with JavaScript that no blank options in a drop-down select are displayed? Particulars: Data source for my foreach contains no blank fields I get as many blank options as legitimate options The end result source code looks like this:
has answer: http://stackoverflow.com/a/29848901
possible better answer: http://stackoverflow.com/a/29848591
accepted answer: http://stackoverflow.com/a/29849480
has answer: http://stackoverflow.com/a/29848591
has comment: http://stackoverflow.com/comment/47827079
has comment: http://stackoverflow.com/comment/47826714
has comment: http://stackoverflow.com/comment/47823569
has comment: http://stackoverflow.com/comment/47826906
has answer: http://stackoverflow.com/a/29849159
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47824492
downvote count: 0
has comment: http://stackoverflow.com/comment/47823818
has comment: http://stackoverflow.com/comment/47823247
has comment: http://stackoverflow.com/comment/47824123
tagged with: javascript
has comment: http://stackoverflow.com/comment/47822986
favorite count: 0
has comment: http://stackoverflow.com/comment/47825899
has answer: http://stackoverflow.com/a/29848800
has comment: http://stackoverflow.com/comment/47823986
has comment: http://stackoverflow.com/comment/47826920
has answer: http://stackoverflow.com/a/29849053
has comment: http://stackoverflow.com/comment/47822979
type: Question
answer count: 8
score: 3
has answer: http://stackoverflow.com/a/29849541
has comment: http://stackoverflow.com/comment/47823139
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29849480
has title: Remove blank options from select field?
has comment: http://stackoverflow.com/comment/47822897
has comment: http://stackoverflow.com/comment/47823950
has comment: http://stackoverflow.com/comment/47824689
has comment: http://stackoverflow.com/comment/47826993
has comment: http://stackoverflow.com/comment/47826163
has comment: http://stackoverflow.com/comment/47827424
upvote count: 3
has answer: http://stackoverflow.com/a/29848639
tagged with: php
has comment: http://stackoverflow.com/comment/47824242

http://stackoverflow.com/comment/47846972
has text: `form.submit()` is **NOT** Ajax! And it would **NOT** go inside the `success` option. It only belongs in the `submitHandler ` option.
score: 1
comment on: http://stackoverflow.com/q/29860410
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29898944
has body: You're calling addtodo but the function is named handle. You're also not passing anything to the function. A working example: &lt;input type="text" onkeypress="addtodo(event)"&gt; function addtodo(e){ if(e.keyCode === 13){ alert('pressed'); } return false; } jsFiddle example
score: 0
type: Answer
answers question: http://stackoverflow.com/q/29898788

http://stackoverflow.com/q/29933317
has comment: http://stackoverflow.com/comment/47988929
has comment: http://stackoverflow.com/comment/47988915
has comment: http://stackoverflow.com/comment/47989039
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29933408
tagged with: search
score: 2
type: AnsweredQuestion
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/47989057
type: Question
upvote count: 2
answer count: 1
has answer: http://stackoverflow.com/a/29933408
has body: I have the following data object, and eventually there will be more similar ones within entities: function loadCardLibrary() { var cardLibrary = { entities: [ { name: "Spareparts", values: { sickness: 0, attack: 0, scrap: 3, manaCost: 0 }, apply: [ applyCreature("Mech"), applyHealth(1), applyNoAttack(true) ] } ] }; return cardLibrary; } I am trying to write a function (see this example) to search for a name value, then go in that object and search to check for a specific apply value, like so: function checkHasNoAttack(entityName) { for (var entity in cardLibrary.entities) { if (cardLibrary.entities[entity].name === entityName) { // for debugging console.log(cardLibrary.entities[entity]); console.log(); // blank line for (var applied in cardLibrary.entities[entity].apply) { if (cardLibrary.entities[entity].apply[applied].applyNoAttack === true) { console.log(entityName + " cannot attack."); } else { console.log("test"); break; } } } } } When I call it right after, like this: var canItAttack = checkHasNoAttack("Spareparts"); ...this is the result: { name: 'Spareparts', values: { sickness: 0, attack: 0, scrap: 3, manaCost: 0 }, apply: [ 'Mech', 1, true ] } test Instead of test which comes from the else, I am trying to log the get it to respond to the first if statement, and log: Spareparts cannot attack. With the understanding that more complicated logic will eventually replace the console.log there I really need this to work, but have been tinkering with it and I just can't seem to get it right. Any help very appreciated!
tagged with: http://stackoverflow.com/tag/json
has title: Searching JSON value multiple levels deep

http://stackoverflow.com/a/30033120
has body: I created a fiddle out of simplified code like below. This works for having the content fade in: var myself = $('#content'); var $htmlcontent = $(" "); var mybloc = $htmlcontent.insertAfter(myself); var currentcontent = 'More stuff here'; var htmlcontent = " "; htmlcontent += " "; htmlcontent += currentcontent + " "; // hide the block, add html and fade block in mybloc.hide().html(htmlcontent).fadeIn(2000);
score: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/29995478
answers question: http://stackoverflow.com/q/29995478
has comment: http://stackoverflow.com/comment/48214724
type: AcceptedAnswer

http://stackoverflow.com/comment/47936329
comment on: http://stackoverflow.com/q/29906739
has text: I just try the script in the part of in html
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/48144948
type: Comment
has text: I have found my way to do what I want, but your answer still interests me. What happen when you put two of (); like that? will it stop and never play again?--and what if it is player.play().stop();? I will try this when I'm free, but it would be appreciated if you can tell me. :D Thx anyway.
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/29986736

http://stackoverflow.com/comment/48069370
type: QuestionComment
has text: take a look at leaflet, lets you get tiles from multiple sources
comment on: http://stackoverflow.com/q/29974566
score: 0
type: Comment

state
tag name: state
tags question: http://stackoverflow.com/q/29931998
type: Tag
tags question: http://stackoverflow.com/q/29989899

http://stackoverflow.com/comment/48115641
comment on: http://stackoverflow.com/q/29998033
type: QuestionComment
has text: you can use adb console. That'll show you all the debug/error/info messages. However, you must filter them to have messages specific to your app only.
type: Comment
score: 0

http://stackoverflow.com/a/29985884
accepted answer of: http://stackoverflow.com/q/29985708
score: 1
has comment: http://stackoverflow.com/comment/48170879
has comment: http://stackoverflow.com/comment/48168831
upvote count: 1
answers question: http://stackoverflow.com/q/29985708
has comment: http://stackoverflow.com/comment/48170397
has comment: http://stackoverflow.com/comment/48167427
has body: If you change the URL that way, it will reload the whole page from the server, and that's not what you want to do. What you want to do it's an SPA. To do so you can only change the anchor part of the URL, i.e. add a hash followed by whatever you want, for example: www.mypage.com#page1 www.mypage.com#page2 Usually, apart from changing the url, you want to change the page content if the URL changes. This is knwon as routing, and most frameworks like Ember.js, Backbone, AngularJS, Durandal and so on include one. As you don't need a framework, you can use an independent one like router.js. Better than router documentation itself, look for some examples like this.
has comment: http://stackoverflow.com/comment/48171072
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/48170837
has comment: http://stackoverflow.com/comment/48093102
type: Answer

http://stackoverflow.com/q/29855880
has answer: http://stackoverflow.com/a/29855939
linked to: http://stackoverflow.com/q/14220321
has body: ok am starting on nodeJS and am stuck at this code, if i output inside the loop i get the array as i want, but if i do outside the loop it returns undefined. question is: What is wrong with this?, thx in advance; var array = []; var temp = ""; var http = require("http"); for (var i = 2; i &lt; 5; i++) { http.get(process.argv[i],function(res){ res.setEncoding("utf8"); res.on("data",function(data){ temp += data; }); res.on("end", function(){ array.push(temp); console.log(array[0]);//this returns the array[0] OK NP; temp = ""; });} ); } console.log(array[0]);//this returns undefined;
has title: undefined on this string to array
has comment: http://stackoverflow.com/comment/47838332
has comment: http://stackoverflow.com/comment/47837700
linked to: http://stackoverflow.com/q/750486
tagged with: node.js
has answer: http://stackoverflow.com/a/29856224
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47837771
possible better answer: http://stackoverflow.com/a/29855994
has comment: http://stackoverflow.com/comment/47838397
type: Question
has answer: http://stackoverflow.com/a/29855994
duplicate of: http://stackoverflow.com/q/14220321
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29855939
score: 0
answer count: 3
has comment: http://stackoverflow.com/comment/47837840
has comment: http://stackoverflow.com/comment/47838129
tagged with: undefined
has comment: http://stackoverflow.com/comment/47838066

http://stackoverflow.com/comment/48106856
type: QuestionComment
has text: But it doesent.. The animation runs good but if the ajax should work I most hold it a very short second @Sushil
comment on: http://stackoverflow.com/q/29992561
score: 0
type: Comment

http://stackoverflow.com/q/29995352
has body: I am running phpMyAdmin version 4.4.4 on a CentOS Linux (2.6.32-504.12.2) server. I keep getting get a pink banner at the bottom of the PMA window stating: A fatal JavaScript error has occurred. Would you like to send an error report? If I click on Send Report, nothing happens. If I display the report details, this is what I see: { "pma_version": "4.4.4", "browser_name": "FIREFOX", "browser_version": "37.0", "user_os": "Mac", "server_software": "Apache/2.4.12 (Unix) OpenSSL/1.0.1e-fips", "user_agent_string": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:37.0) Gecko/20100101 Firefox/37.0", "locale": "en", "configuration_storage": "disabled", "php_version": "5.6.7", "exception_type": "js", "exception": { "mode": "stack", "name": "TypeError", "message": "field_id.match(...) is null", "stack": [ { "func": "getFieldValidators", "args": "", "line": 302, "column": "16", "context": [ " * @return array of [function, parameters to be passed to function]", " */", "function getFieldValidators(field_id, onKeyUpOnly)", "{", " // look for field bound validator", " var name = field_id.match(/[^-]+$/)[0];", " if (typeof validators._field[name] != 'undefined') {", " return [[validators._field[name], null]];", " }", "", " // look for registered validators" ], "filename": "config.js" }, { "func": "validate_field", "args": "", "line": 418, "column": "21", "context": [ "{", " var args, result;", " var $field = $(field);", " var field_id = $field.attr('id');", " errors[field_id] = [];", " var functions = getFieldValidators(field_id, isKeyUp);", " for (var i = 0; i &lt; functions.length; i++) {", " if (typeof functions[i][1] !== 'undefined' &amp;&amp; functions[i][1] !== n//...", " args = functions[i][1].slice(0);", " } else {", " args = [];" ], "filename": "config.js" }, { "func": "?", "args": "", "line": 511, "column": "13", "context": [ " var $check_page_refresh = $('#check_page_refresh');", " if ($check_page_refresh.length === 0 || $check_page_refresh.val() == '1') {", " // run all…
type: Question
has answer: http://stackoverflow.com/a/39481633
tagged with: javascript
downvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/48320150
favorite count: 0
type: UnansweredQuestion
tagged with: phpmyadmin
has title: phpMyAdmin Fatal Javascript Error Has Occurred
tagged with: php
has comment: http://stackoverflow.com/comment/48512309
score: 1
upvote count: 1

http://stackoverflow.com/a/29849178
downvote count: 0
has comment: http://stackoverflow.com/comment/47826706
has body: Here you go: filterMenuInit: function(e) { if (e.field == "date") { var sels = e.container.find("select"); var sel1 = $(sels[0]).data("kendoDropDownList"); var sel2 = $(sels[2]).data("kendoDropDownList"); sel1.select(3); sel1.enable(false); sel2.select(5); sel2.enable(false); } } Fiddle. This doc helped me. e.container refers to the filter widget. With it you can play around freely. Note that the event is just called once, at the initialization of the filter widget, and not at each open/close. Updated code for columnMenu: Just change the filterMenuInit to columnMenuInit. Fiddle. Update 2: I have added the following code to the columnMenuInit event: var dates = $(e.container).find('[data-role="datepicker"]'); $(dates[0]).data("kendoDatePicker").unbind("change"); $(dates[1]).data("kendoDatePicker").unbind("change"); Fiddle. I just unbind the default change event of the datepickers, avoiding changing the dropdowns.
score: 1
has comment: http://stackoverflow.com/comment/47903739
upvote count: 1
answers question: http://stackoverflow.com/q/29847287
type: Answer

http://stackoverflow.com/a/33399022
upvote count: 1
accepted answer of: http://stackoverflow.com/q/29882975
type: AcceptedAnswer
has body: If the form only needs to remain the same, when printed, the simplest solution may be to go ahead and add the fields that you need. You can set them up, so that they are "visible but doesn't print". This option can be selected in the Form Field drop-down list, in the Text Field Properties, General Tab, under Common Properties. This way, you can still incorporate the data in your formulas, but it has no affect on the printed document.
type: Answer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/29882975

http://stackoverflow.com/q/29939741
type: AnsweredQuestion
upvote count: 7
type: Question
tagged with: charts
has comment: http://stackoverflow.com/comment/48002284
score: 7
tagged with: javascript
possible better answer: http://stackoverflow.com/a/52643989
has answer: http://stackoverflow.com/a/52643989
answer count: 2
tagged with: highcharts
downvote count: 0
has answer: http://stackoverflow.com/a/29941938
favorite count: 0
has comment: http://stackoverflow.com/comment/48018569
has title: highcharts, highstock without jQuery
has body: I understand you can use: $(element).highcharts("StockChart", {}) to get a chart on that element. However, I'd like to either be able to get gold of the highchart object so I can manipulate it afterwards, or I'd like to do: new Highcharts.Chart({ chart : { renderTo : 'container' type : 'StockChart' } ... }); Firstly: The latter does not work for type 'StockChart'. I get error code 17 which says: "The requested series type does not exist" Secondly: I'd prefer to set the renderTo option to an element rather than an id. By using an id it forces my element to also use an id, but where I can have a container and a subelement in it, it becomes hard to reference that. Now, if you have many graphs on a single html page, id's are not ideal. Rather I would like to use the actual dom element to pass. By using $(element).highcharts("StockChart", {}) I was able to set almost all other options as global ones, including the rangeSelector and get things to work. However, I still need to be able to access this, which is available in event functions, such as load, so I guess I could set a global one, but that might be a bit overkill.
accepted answer: http://stackoverflow.com/a/29941938

http://stackoverflow.com/comment/47843183
type: Comment
comment on: http://stackoverflow.com/a/29858403
has text: Children are not nested, are direct.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/47849618
comment on: http://stackoverflow.com/q/29861966
has text: sry its a bit late and im tired.. I didn't copy it right, fixed now.. i think, everything between `app.cursor[axis] =` and the end is on one line
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/45159899
score: 49
upvote count: 49
has body: You can use this moment().format("DD/MM/YYYY"); However, this returns a date string in the specified format for today, not a moment date object. Doing the following will make it a moment date object in the format you want. var someDateString = moment().format("DD/MM/YYYY"); var someDate = moment(someDateString, "DD/MM/YYYY");
has comment: http://stackoverflow.com/comment/111423482
type: Answer
answers question: http://stackoverflow.com/q/29861699
downvote count: 0

http://stackoverflow.com/comment/47893767
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29880715
score: 0
has text: If you have a promise object, it implies that the promise already has everything it needs to do its work, and all you need to do is wait for it to call you back (via a callback). If you already have a promise, and you somehow need to now do synchronization work, the way you're working with promises is broken. You need to go back and look at the phase where your promises are being created and revise that, chaining promises together if need be.

http://stackoverflow.com/a/29935412
type: Answer
answers question: http://stackoverflow.com/q/29935330
score: 1
has body: Here is the code $("&lt;a/&gt;",{"href":"http://"+aaa[2],"text":aaa[2]}).appendTo("#showlink");
has comment: http://stackoverflow.com/comment/47993155
upvote count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/47993728
has comment: http://stackoverflow.com/comment/47993819

http://stackoverflow.com/comment/48123420
score: 0
has text: What is `</>`? it's invalid tag.
type: QuestionComment
comment on: http://stackoverflow.com/q/30002384
type: Comment

http://stackoverflow.com/comment/47866770
type: QuestionComment
has text: You have a typo `var map = new google.maps.Map(c, {`, should be `var map = new google.maps.Map(canvas, {`
comment on: http://stackoverflow.com/q/29870563
score: 0
type: Comment

http://stackoverflow.com/comment/48108935
type: QuestionComment
comment on: http://stackoverflow.com/q/29994652
type: Comment
score: 2
has text: The error with `this.tickerRemoved = true;` is because `this`, in your example, refers to the function. You need to bind the function: `.then(function(data) { /* ... your code */ }.bind(this))` . However, it looks like it would affect every ticker - you probably want something more like `ticker.removed = true;` and `ng-hide="ticker.removed"` . You'd then also need to pass the actual ticker object in the `ng-click` code: `ng-click="removePortfolio(ticker)"`.

http://stackoverflow.com/a/29958080
type: Answer
upvote count: 2
accepted answer of: http://stackoverflow.com/q/29958072
answers question: http://stackoverflow.com/q/29958072
has comment: http://stackoverflow.com/comment/48036981
score: 2
type: AcceptedAnswer
downvote count: 0
has body: If you have single td with class photogalleryItem,You can use: $('.photogalleryItem').append('&lt;h3 style="text-align:center;"&gt;'+ $('.photogalleryItem').find('img').attr('alt')+'&lt;/h3&gt;'); If you have multiple td with class photogalleryItem: $('.photogalleryItem').each(function(){ $(this).append('&lt;h3 style="text-align:center;"&gt;'+ $(this).find('img').attr('alt')+'&lt;/h3&gt;'); })

http://stackoverflow.com/comment/48109691
has text: A second before you published this answer I discovered this: https://github.com/rniemeyer/knockout-postbox . Which is a bit nicer, because I don't need to include more dependencies on any of my VMs - it just adds some functionalities to Knockout :). However you answer the exact question I was asking, so I'm accepting your answer.
comment on: http://stackoverflow.com/a/29994974
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/47929827
comment on: http://stackoverflow.com/q/29903524
type: Comment
type: QuestionComment
has text: I'm not sure, but is the data in correct format?
score: 0

http://stackoverflow.com/a/29926708
upvote count: 1
has body: Are you minifying the code? You should add the dependencies as string before the function arguments. myApp.config(['$routeProvider', '$locationProvider', function($routeProvider, $locationProvider) { $routeProvider .when('/', { templateUrl: 'views/home.html', controller : 'mainController' }); $locationProvider.html5Mode(true); }]);
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/29925394
type: Answer
has comment: http://stackoverflow.com/comment/47975482

http://stackoverflow.com/a/29997879
has body: You've got a few problems here: your HTML is formatted incorrectly (you have h2, p, and br tags in the &lt;head&gt;, display tags only go within your &lt;body&gt; tags (you also have two opening &lt;body&gt; tags) you shouldn't use spaces in name attributes (e.g. document.forms[0].item total2.value= st2;) as it will make them difficult to reference with javascript, replace with an underscore or just remove the spaces you are jamming a ton of javascript in an inline event handler which is a mistake, it should all be moved to its own &lt;script&gt; tag Start off by giving your button an id attribute so you can access it more easily with Javascript: &lt;input type="button" value="Calculate Total" id="total" /&gt; Then, before your closing &lt;/body&gt; tag, add a new &lt;script&gt; tag and get a handle to your button and move all of your inline logic into an onclick event handler: // get a handle to your button by referencing its id attribute var button = document.getElementById('total'); // programmatically add your click handler button.onclick = function(){ var q1 = document.forms[0].quantity1.value; var q2= document.forms[0].quantity2.value; var q3= document.forms[0].quantity3.value; var cpi1 = document.forms[0].costperitem1.value; var cpi2= document.forms[0].costperitem2.value; var cpi3= document.forms[0].costperitem3.value; var st11= q1*cpi1; document.forms[0].itemtotal1.value= st11; var st2= q2*cpi2; document.forms[0].itemtotal2.value= st2; var st3= q3*cpi3; document.forms[0].itemtotal3.value= st3; var tc =st11+st2+st3 ; document.forms[0].total.value= tc; } There are still many improvements that could be made here, but that should be enough to get you started
downvote count: 0
answers question: http://stackoverflow.com/q/29997713
upvote count: 2
type: Answer
score: 2

http://stackoverflow.com/comment/47854391
type: Comment
comment on: http://stackoverflow.com/a/29864662
score: 1
has text: `;` is optional before `?>`
type: AnswerComment

http://stackoverflow.com/comment/47899060
comment on: http://stackoverflow.com/q/29887603
has text: Check out this http://stackoverflow.com/questions/16431136/how-can-i-animate-sorting-a-list-with-orderby-using-ng-repeat-with-ng-animate
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29958865
has answer: http://stackoverflow.com/a/29958935
type: Question
tagged with: firebase
has title: Persisting data in the DOM
tagged with: javascript
possible better answer: http://stackoverflow.com/a/29958935
tagged with: dom
has answer: http://stackoverflow.com/a/29958938
answer count: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/48038618
accepted answer: http://stackoverflow.com/a/29958938
favorite count: 0
has comment: http://stackoverflow.com/comment/48059939
tagged with: angularjs
has body: I am working in a Firebase app and I need to persist some data in the DOM, once the user logs in you are able to see the username and the email, but once you refresh the page, the user is still logged in but that data disappear from the DOM. &lt;div class="item"&gt; &lt;/div&gt; &lt;div class="item"&gt; &lt;/div&gt; here the JS $scope.signIn = function (user) { auth.$authWithPassword({ email: user.email, password: user.pwdForLogin }).then(function (authData) { ref.child("users").child(authData.uid).once('value', function (snapshot) { var val = snapshot.val(); $scope.$apply(function () { $rootScope.name = val; $scope.userDisplayInfo.name = $rootScope.name.displayName; $scope.userDisplayInfo.email = $rootScope.name.email; }); console.log(user); }); }).catch(function (error) { console.log(error); }); }; so, what should I do to persist the user and email in the DOM ?
has comment: http://stackoverflow.com/comment/48038715
type: AnsweredQuestion
score: 1
upvote count: 1

http://stackoverflow.com/comment/47844527
comment on: http://stackoverflow.com/a/29859297
type: Comment
has text: If you're chaining together unrelated functions, you need to wrap them in anonymous functions yes. They're unrelated because they don't operate on the same data.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/48026285
score: 1
has text: Why don't you combine both script?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29952626

http://stackoverflow.com/comment/48097300
score: 0
type: Comment
type: QuestionComment
has text: sorry @JeremyThille. I mean the foo.method();
comment on: http://stackoverflow.com/q/29988900

filesplitting
type: Tag
tag name: filesplitting
tags question: http://stackoverflow.com/q/29929788

http://stackoverflow.com/a/29855076
has comment: http://stackoverflow.com/comment/47869581
has comment: http://stackoverflow.com/comment/47867110
has comment: http://stackoverflow.com/comment/47840460
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/47930987
accepted answer of: http://stackoverflow.com/q/29855014
answers question: http://stackoverflow.com/q/29855014
type: Answer
has comment: http://stackoverflow.com/comment/48068643
has body: I think I misunderstood what you were doing with the variables. I have made a simplified fiddle to do what I think you want. To make it work: I assumed a dxList was more or less like a foreach I changed the name of the outer id_agenzia to selected_id_agenzia, as I was not able to get the comparison to work using $data and $root to distinguish them I made both items ko.observables, and used the function call on each in the comparison &lt;/div&gt; The code is all at the fiddle: http://jsfiddle.net/3ktq4b9s/
has comment: http://stackoverflow.com/comment/47866784
has comment: http://stackoverflow.com/comment/47841831
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/47886120

http://stackoverflow.com/q/29993749
has body: The red box increases in height from 0 to its full height, but it does it with swing easing. I can't work out how I can make it linear. I've tried this, and a few other things, but I can't get it to work: $("#movement").animate({"height": open_height}, {duration: slideDuration }, {easing: linear}); Full script: var sliderHeight = "0"; var initialDelay = 0; var slideDuration = 2500; $(document).ready(function(){ $('#movement').show(); $('#movement').each(function () { var current = $(this); current.attr("box_h", current.height()); }); $("#movement").css("height", sliderHeight); var delay = function() { sliderOpen(); }; setTimeout(delay, initialDelay); }); function sliderOpen() { var open_height = $("#movement").attr("box_h") + "px"; $("#movement").animate({"height": open_height}, {duration: slideDuration }); } JS Fiddle: http://jsfiddle.net/vs6yejag/
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/29993898
type: Question
answer count: 2
tagged with: jquery-animate
tagged with: javascript
tagged with: jquery
score: 0
has answer: http://stackoverflow.com/a/29993898
tagged with: jquery-easing
has title: Adding linear easing to animation
has answer: http://stackoverflow.com/a/29993913
accepted answer: http://stackoverflow.com/a/29993913
tagged with: easing

http://stackoverflow.com/q/29944552
tagged with: css
has answer: http://stackoverflow.com/a/29947304
has title: jExpand.js Expandable tables
type: UnansweredQuestion
has body: In the head i have these files only: &lt;script src="Expand.js"&gt;&lt;/script&gt; &lt;link href="style.css" rel="stylesheet" /&gt; ... Expand.js has only got this inside: (function ($) { $.fn.jExpand = function () { var element = this; $(element).find("tr:odd").addClass("odd"); $(element).find("tr:not(.odd)").hide(); $(element).find("tr:first-child").show(); $(element).find("tr.odd").click(function () { $(this).next("tr").toggle(); }); } })(jQuery); And the css file has only got styles for the table: #example_table { border-collapse: collapse; font-family: "Lucida Sans Unicode","Lucida Grande",Sans-Serif; font-size: 12px; margin: 20px; text-align: left; width: 100%; } #example_table th { color: #339; font-size: 15px; font-weight: normal; padding: 12px; } #example_table td { background-color: #e8e8e8; border-top: 1px solid #fff; padding: 9px 12px; } #example_table tr.odd td { cursor:pointer; } #example_table tr:not(.odd) td { background-color: #f4f4ff; } .tableContainer{ width: 90%; } #training-box { background: none no-repeat scroll 0 0 rgba(0, 0, 0, 0); float: left; display: inline-block;} .tableup { margin-top: -30px; margin-left: -20px; } The HTML: &lt;div class="tableContainer "&gt; &lt;table id="example_table"&gt; &lt;tr&gt; &lt;th&gt;&lt;/th&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="fa fa-plus-circle"&gt;&amp;nbsp;&amp;nbsp;Title 1&lt;/td&gt; &lt;td&gt;&lt;/td&gt; &lt;td&gt;&lt;/td&gt; &lt;td&gt;&lt;/td&gt; &lt;td&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td colspan="5"&gt; &lt;!-- additional custom info is here (for Record 1) --&gt; &lt;hr class="micro-hr" /&gt; &lt;span class="fa fa-arrow-circle-o-right"&gt; Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. &lt;/span&gt; &lt;hr class="micro-hr" /&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="fa fa-plus-circle"&gt;&amp;nbsp;&amp;nbsp;Title 2&lt;/td&gt; &lt;td&gt;&lt;/td&gt; &lt;td&gt;&lt;/td&gt; &lt;td&gt;&lt;/td&gt; &lt;td&gt;&l…
tagged with: expandable-table
type: Question
score: 0
answer count: 1
tagged with: javascript
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/48208871
type: Comment
has text: Okay, I will edit my answer. Thank you. Although, on Codepen, I had tried the code I answered with, it worked fine.
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/29945682

http://stackoverflow.com/a/29899689
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/29899582
upvote count: 3
has body: To accomplish this, I recommend defining your functions with names, and then creating a service object with properties that refer to them, as I did below: .factory("AppStart", function($cordovaSQLite) { function init() { var res = "hello"; console.log("in load start up page"); } function create_table() { init(); } return { init: init, create_table: create_table }; });
answers question: http://stackoverflow.com/q/29899582
downvote count: 0
score: 3

http://stackoverflow.com/q/29924489
score: 0
answer count: 2
downvote count: 4
has comment: http://stackoverflow.com/comment/47970761
tagged with: bootstrap-tabs
possible better answer: http://stackoverflow.com/a/29941012
has comment: http://stackoverflow.com/comment/47970662
has answer: http://stackoverflow.com/a/29941012
favorite count: 0
accepted answer: http://stackoverflow.com/a/29925223
tagged with: twitter-bootstrap
has comment: http://stackoverflow.com/comment/47971012
has comment: http://stackoverflow.com/comment/47971386
type: AnsweredQuestion
has body: I would like to be able to use bootstrap tabs but without using a unique selector. I cannot guarantee that the selector is the only one in the dom. I have many sub templates which are either included in the page as it is rendered or can be loaded inside a modal via ajax. I do use id's but never in the templates i might use within a modal, some modals are preloaded after the page load event. pane 1 pane 2 pane 1 pane 2 I have tried an onclick event on the anchor tag with just jquery which is less than ideal, but cannot get it to work with the .tab('show') onclick="$(this).closest('.panel') .find('.tab-pane').hide();$(this).closest('.panel').find('.pane1').show();"
has comment: http://stackoverflow.com/comment/47970840
has title: Is there a way to use bootstrap tabs without using a unique identifier
type: Question
has answer: http://stackoverflow.com/a/29925223
tagged with: javascript
tagged with: jquery
upvote count: 4

http://stackoverflow.com/comment/47901469
type: Comment
type: QuestionComment
has text: also, this kind of problem can be easily solved by doing some research. remember: Google is your friend
comment on: http://stackoverflow.com/q/29888900
score: 0

http://stackoverflow.com/comment/48097886
score: 0
has text: @KevinRovers If you mark the answer as the accepted answer, green tick on the left, then it will help other users in future, you also get a small bit of rep +2 for accepting answers :)
type: Comment
comment on: http://stackoverflow.com/a/29987073
type: AnswerComment

google-maps
tags question: http://stackoverflow.com/q/29978100
tags question: http://stackoverflow.com/q/29886129
tag name: google-maps
tags question: http://stackoverflow.com/q/29847214
tags question: http://stackoverflow.com/q/29980862
tags question: http://stackoverflow.com/q/29927587
tags question: http://stackoverflow.com/q/29919833
tags question: http://stackoverflow.com/q/29957531
tags question: http://stackoverflow.com/q/29982289
tags question: http://stackoverflow.com/q/29959953
tags question: http://stackoverflow.com/q/29922908
tags question: http://stackoverflow.com/q/29908763
tags question: http://stackoverflow.com/q/29869261
tags question: http://stackoverflow.com/q/29993228
tags question: http://stackoverflow.com/q/29983178
tags question: http://stackoverflow.com/q/29939855
tags question: http://stackoverflow.com/q/29846040
tags question: http://stackoverflow.com/q/29893569
tags question: http://stackoverflow.com/q/29977097
tags question: http://stackoverflow.com/q/29848267
tags question: http://stackoverflow.com/q/29948146
tags question: http://stackoverflow.com/q/29939453
tags question: http://stackoverflow.com/q/29960206
tags question: http://stackoverflow.com/q/29855087
tags question: http://stackoverflow.com/q/29877874
tags question: http://stackoverflow.com/q/29903047
tags question: http://stackoverflow.com/q/29962091
tags question: http://stackoverflow.com/q/29866994
tags question: http://stackoverflow.com/q/29903654
tags question: http://stackoverflow.com/q/29896096
tags question: http://stackoverflow.com/q/29962534
tags question: http://stackoverflow.com/q/29875680
tags question: http://stackoverflow.com/q/29893176
tags question: http://stackoverflow.com/q/29907130
tags question: http://stackoverflow.com/q/29952432
tags question: http://stackoverflow.com/q/29980598
tags question: http://stackoverflow.com/q/29849691
tags question: http://stackoverflow.com/q/29870563
tags question: http://stackoverflow.com/q/29887950
tags question: http://stackoverflow.com/q/29963630
tags question: http://stackoverflow.com/q/29907046
tags question: http://stackoverflow.com/q/29855261
tags question: http://stackoverflow.com/q/29973477
tags question: http://stackoverflow.com/q/29898103
tags question: http://stackoverflow.com/q/29988940
tags question: http://stackoverflow.com/q/29899667
tags question: http://stackoverflow.com/q/29992503
tags question: http://stackoverflow.com/q/29938041
tags question: http://stackoverflow.com/q/29972921
tags question: http://stackoverflow.com/q/29923110
tags question: http://stackoverflow.com/q/29970234
tags question: http://stackoverflow.com/q/29892438
tags question: http://stackoverflow.com/q/29969829
tags question: http://stackoverflow.com/q/29975448
tags question: http://stackoverflow.com/q/29874165
tags question: http://stackoverflow.com/q/30002497
type: Tag
tags question: http://stackoverflow.com/q/29854755
tags question: http://stackoverflow.com/q/29862125
tags question: http://stackoverflow.com/q/29857972
tags question: http://stackoverflow.com/q/29849843
tags question: http://stackoverflow.com/q/29900073
tags question: http://stackoverflow.com/q/29941255
tags question: http://stackoverflow.com/q/29928942
tags question: http://stackoverflow.com/q/29905763
tags question: http://stackoverflow.com/q/29973426
tags question: http://stackoverflow.com/q/29938668
tags question: http://stackoverflow.com/q/29875865
tags question: http://stackoverflow.com/q/29859054
tags question: http://stackoverflow.com/q/29937624
tags question: http://stackoverflow.com/q/29974566
tags question: http://stackoverflow.com/q/29846241
tags question: http://stackoverflow.com/q/29916293
tags question: http://stackoverflow.com/q/29860150
tags question: http://stackoverflow.com/q/29948953

http://stackoverflow.com/q/30000950
has comment: http://stackoverflow.com/comment/56802109
downvote count: 0
has comment: http://stackoverflow.com/comment/56815732
tagged with: javascript
favorite count: 0
tagged with: angularjs
tagged with: javascript-intellisense
has body: I'm trying to get proper Intellisense suggestions for my javascript code in Visual Studio Code. In particular, I have the following AngluarJS service: /// <reference path="definitelytyped/angularjs/angular.d.ts" /> var module = angular.module( 'testApp', [] ); module.factory( 'backend', function ( $http ) { return { "getComments": function HoverHereToSeeType( post ) { /// Retrieves comments from the backend /// Post to retrieve comments for return $http.get( "/rest/" + post ); } }; } ) I thought I should be using XML Documentation Comments, but they don't seem to work - when I hover over HoverHereToSeeType the parameter is shown as "any" (while the return value is properly inferred using angular.d.ts). So the first part of the question is: How do I annotate types in my functions? The second part of the question comes up when actually trying to use the service: module.controller( 'MyCtrl', function( backend ) { backend.getComments( "test" ); } ); I get that IntelliSense doesn't understand Angular's dependency injection, so I'll need to annotate backend's type. But how do I reference that type? In short: How do I get proper Intellisense for the backend.getComments() call in the second snippet, i.e. the information that the parameter has to be a string and the returned value will be an ng.IHttpPromise?
has comment: http://stackoverflow.com/comment/69460768
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/30018407
score: 10
has answer: http://stackoverflow.com/a/30008629
upvote count: 10
has comment: http://stackoverflow.com/comment/69450287
type: Question
has comment: http://stackoverflow.com/comment/48147973
has comment: http://stackoverflow.com/comment/48153791
has title: Documenting Javascript code in VSCode for Intellisense
answer count: 2
tagged with: visual-studio-code

http://stackoverflow.com/comment/47981054
has text: How is your data changing? jquery/ajax?
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29928522

http://stackoverflow.com/q/29964962
accepted answer: http://stackoverflow.com/a/29969385
has comment: http://stackoverflow.com/comment/48049899
favorite count: 0
has comment: http://stackoverflow.com/comment/48051706
has answer: http://stackoverflow.com/a/29966218
has comment: http://stackoverflow.com/comment/48052005
has comment: http://stackoverflow.com/comment/48059211
has comment: http://stackoverflow.com/comment/48050083
possible better answer: http://stackoverflow.com/a/29966218
has comment: http://stackoverflow.com/comment/48051648
tagged with: quicksort
score: 0
upvote count: 1
downvote count: 1
linked to: http://stackoverflow.com/q/29967481
has answer: http://stackoverflow.com/a/29969385
type: AnsweredQuestion
has body: To clarify a bit on the question, I have an array and within the array are a bunch of objects. Can I rearrange the objects in the array based on the key values of each object? When I'm attempting to do so, it keeps telling me that the variable (in this case, students) is undefined. When I use the built-in sort function, it works perfectly. However, this is a school assignment and I HAVE to show the breakdown of the quicksort function. Here is the code I am using: function swap(student, firstIndex, secondIndex){ var temp = student[firstIndex]; student[firstIndex] = student[secondIndex]; student[secondIndex] = temp; } function partition(student, left, right) { var pivot = student[Math.floor((right + left) / 2)], i = left, j = right; while (i &lt;= j) { while (student[i] &lt; pivot) { i++; } while (student[j] &gt; pivot) { j--; } if (i &lt;= j) { swap(student, i, j); i++; j--; } } return i; } function quickSort(student, left, right) { var index; if (student.length &gt; 1) { left = typeof left != "number" ? 0 : left; right = typeof right != "number" ? student.length - 1 : right; index = partition(student, left, right); if (left &lt; index - 1) { quickSort(student, left, index - 1); } if (index &lt; right) { quickSort(student, index, right); } } return student; } var studentNumbersArray = [] var randomArray = []; for (i = 0; i &lt; studentsArray.length; i++) { studentNumbersArray.push(studentsArray[i].studentNumber); } function sortStudentNumbers() { var student = studentNumbersArray.name; // &lt;-- THIS IS WHERE I AM GETTING ERROR quickSort(student); var updatedStudentArray = JSON.stringify(studentsArray); localStorage.setItem("students", updatedStudentArray); location.reload(); }
tagged with: javascript
has comment: http://stackoverflow.com/comment/48051776
type: Question
has title: Is it possible to quicksort objects based on their keys in an array, using JavaScript?
answer count: 2
tagged with: arrays

http://stackoverflow.com/q/29921218
has comment: http://stackoverflow.com/comment/47964930
favorite count: 0
linked to: http://stackoverflow.com/q/19317115
tagged with: hierarchical-data
accepted answer: http://stackoverflow.com/a/35490846
has body: I want to build a hierarchical data structure from my sql query. After following this post for build hierarchical JSON object from flat objects, I try to create 4 level hierarchy with more attributes in object levels, but don't need children property. How can i do this? Here is my JavaScript (NodeJS) code: var levels = ["counties_id","district_id", "municipalities_id", "institutes_id"]; data.forEach(function(d){ var depthCursor = newData.counties; levels.forEach(function( property, depth ){ var index; depthCursor.forEach(function(child,i){ if ( d[property] == child.counties_id ) index = i; }); if ( isNaN(index) ) { var propname = levels[depth]; var obj = {}; obj[propname] = d[property]; obj["children"] = []; depthCursor.push(obj); index = depthCursor.length - 1; } depthCursor = depthCursor[index].children; if ( depth === levels.length - 1 ) { depthCursor.push({ id : d.id, name : d.name, name_H : d.name_h }); } }); }); First level is ok because this equalation check the same first level attributes: if ( d[property] == child.counties_id ) index = i; How can i chect 2th, 3th and 4th level same case? This is the flat object which keep trying: [ { "counties_h":"Megye 1", "counties_en":"Coun 1", "counties_id":"1", "district_h":"Korz 1", "district_en":"Dist 1", "district_id":"101", "municipalities_h":"Onk 1", "municipalities_en":"Mun 1", "municipalities_id":"asdf", "institutes_h":"Int 1", "institites_en":"Inst 1", "institutes_id":"1" }, { "counties_h":"Megye 1", "counties_en":"Coun 1", "counties_id":"1", "district_h":"Korz 1", "district_en":"Dist 1", "district_id":"101", "municipalities_h":"Onk 1", "municipalities_en":"Mun 1", "municipalities_id":"asdf", "institutes_h":"Int 2", "institites_en":"Inst 2", "institutes_id":"2" }, { "counties_h":"Megye 1", "counties_en":"Coun 1", "counties_id":"1", "district_h":"Korz 1", "district_en":"Dist 1", "district_id":"101", "municipalities_h":"Onk 2", "municipalities_en":"Mun 2", "municipalities_id":"sdfg", "institutes_h":"Int 1", "inst…
tagged with: templates
tagged with: node.js
has title: Node.js - Convert flat json to hierarchical json without 'parent','child' attributes
score: 2
has comment: http://stackoverflow.com/comment/47969826
upvote count: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/35490846
tagged with: http://stackoverflow.com/tag/json
tagged with: javascript
type: Question
answer count: 1
downvote count: 0

http://stackoverflow.com/comment/47824680
type: QuestionComment
has text: `getElementsByClassName` returns a NodeList, not a reference to a single element – so you have to access the element by index first, before you can access its value.
comment on: http://stackoverflow.com/q/29849331
score: 4
type: Comment

http://stackoverflow.com/comment/47884773
type: AnswerComment
comment on: http://stackoverflow.com/a/29877134
score: 0
type: Comment
has text: Seems like I can't make it work or either the code is put in wrong. here is what I did with your code you posted @FrankProvost ` My Work 0 `

http://stackoverflow.com/q/29942603
has answer: http://stackoverflow.com/a/29943174
tagged with: php
answer count: 4
has comment: http://stackoverflow.com/comment/48006474
type: UnansweredQuestion
tagged with: mysql
type: Question
has comment: http://stackoverflow.com/comment/48006167
tagged with: zend-framework
tagged with: javascript
has answer: http://stackoverflow.com/a/29943735
score: 0
has answer: http://stackoverflow.com/a/29943262
has comment: http://stackoverflow.com/comment/48006033
has title: How can I get the param passed in an URL in JavaScript
has body: I have some datatables and I want to get the param id 194 out of the URL admin/customer-management/updater/id/194 My source AJAX: "sAjaxSource": "/&lt;?= Zend_Registry::get('Zend_Locale')-&gt;getLanguage(); ?&gt;/admin/CustomerManagement/getlistcontactsajax/idCustomer/" + $(this).attr('value'); I do this + $(this).attr('value'); but it does not work.
has comment: http://stackoverflow.com/comment/48006227
has answer: http://stackoverflow.com/a/29942827
tagged with: jquery
has comment: http://stackoverflow.com/comment/48006401

http://stackoverflow.com/comment/47943141
type: QuestionComment
has text: How would that happen ? I'm still new here. Sorry. | JQuery2.js is also a library.
comment on: http://stackoverflow.com/q/29910493
score: 0
type: Comment

http://stackoverflow.com/comment/47879370
type: AnswerComment
comment on: http://stackoverflow.com/a/29877279
has text: All the callbacks I use for the routes are in different modules - login related, item related etc. As for the second suggestion when you call it like that in different modules, won't it create a new instance for each module it was called from?(and if so, will it not create new connections)
type: Comment
score: 0

http://stackoverflow.com/a/44337628
answers question: http://stackoverflow.com/q/29971898
downvote count: 0
score: 40
has body: I'ma just build on Bergi's answer (specifically the second part) a little bit because I really liked the way it was done, but I want the option to stop the timer once it starts (like clearInterval() almost). Sooo... I've wrapped it up into a constructor function so we can do 'objecty' things with it. 1. Constructor Alright, so you copy/paste that... /** * Self-adjusting interval to account for drifting * * @param {function} workFunc Callback containing the work to be done * for each interval * @param {int} interval Interval speed (in milliseconds) * @param {function} errorFunc (Optional) Callback to run if the drift * exceeds interval */ function AdjustingInterval(workFunc, interval, errorFunc) { var that = this; var expected, timeout; this.interval = interval; this.start = function() { expected = Date.now() + this.interval; timeout = setTimeout(step, this.interval); } this.stop = function() { clearTimeout(timeout); } function step() { var drift = Date.now() - expected; if (drift &gt; that.interval) { // You could have some default stuff here too... if (errorFunc) errorFunc(); } workFunc(); expected += that.interval; timeout = setTimeout(step, Math.max(0, that.interval-drift)); } } 2. Instantiate Tell it what to do and all that... // For testing purposes, we'll just increment // this and send it out to the console. var justSomeNumber = 0; // Define the work to be done var doWork = function() { console.log(++justSomeNumber); }; // Define what to do if something goes wrong var doError = function() { console.warn('The drift exceeded the interval.'); }; // (The third argument is optional) var ticker = new AdjustingInterval(doWork, 1000, doError); 3. Then do... stuff // You can start or stop your timer at will ticker.start(); ticker.stop(); // You can also change the interval while it's in progress ticker.interval = 99; I mean, it works for me anyway. If there's a better way, lemme know.
type: Answer
upvote count: 40
has comment: http://stackoverflow.com/comment/124039774
has comment: http://stackoverflow.com/comment/97411628
has comment: http://stackoverflow.com/comment/124026599
has comment: http://stackoverflow.com/comment/123775045

http://stackoverflow.com/comment/47997250
has text: @RGraham. If you check the output using `typeof` then without `JSON.parse` it will return `string` (so a `for` loop will just access each character) but with `JSON.parse` it will return object which is an array (in OP' case, containing 3 objects)
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29937639

http://stackoverflow.com/a/29955027
answers question: http://stackoverflow.com/q/29952781
accepted answer of: http://stackoverflow.com/q/29952781
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/48031090
has body: Here is a pretty basic example of a three slide carousel, add more slides as required, it goes roundy-round thanks to insertBefore and insertAfter. if you want some animation try hiding it before you move it then show it once its been moved. (Demo) HTML 1 2 3 4 < > CSS .wrap { position: relative; } .carousel { font-size: 0; overflow: hidden; white-space: nowrap; } .item { font-size: initial; width: 33.3333%; display: inline-block; } .item: #previous { position: absolute; top: 50%; left: 0; transform: translateY(-50%); } #next { position: absolute; top: 50%; right: 0; transform: translateY(-50%); } JAVASCRIPT $("#next").on("click",function(){ parent = $(this).parent(); parent.find(".item:first").insertAfter(parent.find(".item:last")); }); $("#previous").on("click",function(){ parent = $(this).parent(); parent.find(".item:last").insertBefore(parent.find(".item:first")); });
type: AcceptedAnswer
downvote count: 0
type: Answer

http://stackoverflow.com/comment/48487314
comment on: http://stackoverflow.com/q/29989223
type: Comment
type: QuestionComment
has text: Try dividing the timestamp by 1000 on the chart.x() function.
score: 0

http://stackoverflow.com/a/29909302
score: 0
type: Answer
answers question: http://stackoverflow.com/q/29909004
has body: I haven't found the answer to this question, but I have found a solution that fixes the problem. What I have done is added a conditional that only allows the click event to occur once-per-click: var i = 0; $(document).on('click', '#prev', function(event) { if (page != 1 &amp;&amp; i === 0) { page--; var state = { "thisIsOnPopState": true }; history.replaceState(state, "a", "?page=" + page + ""); i = 1; refresh(); } }); // Resets 'i' for the next click $(document).on('mouseup', function() { i = 0; });
has comment: http://stackoverflow.com/comment/47946406

http://stackoverflow.com/comment/48055771
type: AnswerComment
has text: @marirena: Just as I said. It might have its origin at the page load instead of 1/1/1970, but it's a millisecond timestamp nonetheless. And since we only care for deltas, the origin doesn't matter.
type: Comment
comment on: http://stackoverflow.com/a/29957993
score: 0

http://stackoverflow.com/q/29967715
tagged with: jscrollpane
downvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29974862
favorite count: 0
upvote count: 2
has title: Use jScrollPane JQuery plugin with RequireJS
accepted answer: http://stackoverflow.com/a/29974862
tagged with: requirejs
score: 2
type: AnsweredQuestion
tagged with: jquery-jscrollpane
has body: Currently JQuery is working fine with RequireJS. I now tried to use the jScrollPane plugin for JQuery. This plugin depends on the mousewheel plugin, so both have to be loaded. Since both plugins support AMD this shouldn't be a big problem. I tried multiple solutions including require(['jquery.jscrollpane','jquery.mousewheel'], function(JScrollPane) { $(function() { $('.scroll-pane').jScrollPane(); }); }); and // At the beginning of main.js requirejs.config({ "shim": { "jquery.jscrollpane": ["jquery"], "jquery.mousewheel": ["jquery"] } }); // Later in another script define(["jquery", "jquery.mousewheel", "jquery.jscrollpane"], function($) { $(function() { $('.scroll-pane').jScrollPane(); }); }); but nothing is working. Using the JavaScript debugger in Chrome the callback function is never called and no error is thrown. The files are called jquery.jscrollpane.js and jquery.mousewheel.js and are placed in the same folder as RequireJS and JQuery. Also it should be possible to load the plugins only once since they just extend JQuery, but I haven't found an example for that. What am I doing wrong?
type: Question

http://stackoverflow.com/comment/47928201
score: 0
type: AnswerComment
type: Comment
has text: Duhhhh. The javascript is running on the browser's machine. I had to add another listener to the load balancer, but your answer fixed the problem. Thanks much!
comment on: http://stackoverflow.com/a/29885616

http://stackoverflow.com/a/29898279
score: 1
answers question: http://stackoverflow.com/q/29897733
upvote count: 1
downvote count: 0
type: Answer
has body: Here's a jQuery solution: (JSFiddle for if the code snippet doesn't work) function BarMove(el) { var bar = $('#bar'); var width = el.outerWidth(); var left = el.offset().left; bar.animate({ width: width, left: left }); } var Current = $('#nav_ul li a.current'); // Set the current page BarMove(Current); $('#nav_ul li a').hover(function () { BarMove($(this)); }, function () { BarMove(Current); }); #nav_ul a { color: #685e6d; text-decoration: none; display: inline-block; -webkit-transition: color 0.4s ease-in-out; -moz-transition: color 0.4s ease-in-out; -ms-transition: color 0.4s ease-in-out; -o-transition: color 0.4s ease-in-out; transition: color 0.4s ease-in-out; } #nav_ul { display: inline-block; list-style-type: none; } #nav_ul li { display: inline-block; position: relative; left: 90px; bottom: 30px; font-size: 19px; margin-left: 40px; font-weight: 100; font-size: 16px; } #nav_ul a:hover { color: #4ad1fd; } #container { position: relative; left: 0; height: auto; width: 530px; top: 5px; } #bar { position: absolute; left: 0; bottom: 0; height: 7px; width: 107px; background-color: #ffcc00; border-radius: 3px; } apples bananas tomatos onions It's not exact, so you'll need to tweak the numbers but functionality is what you're after as far as I'm aware.

http://stackoverflow.com/comment/48060244
comment on: http://stackoverflow.com/a/29970083
score: 0
type: AnswerComment
has text: `new Date($(this).data("hideafter"))` doesn't work. `"20150430 091400"` is not a valid date format.
type: Comment

http://stackoverflow.com/comment/47866140
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29870615
has text: hey, yea it seems ok, buuut... if Im using jQuery, your example wont work, because what if jQuery ITSELF doesnt get loaded? :)

http://stackoverflow.com/comment/48002478
type: AnswerComment
has text: _Technically_ this can be optimized away, but in practice it'd be a hard optimization (detect function equality in chain, and create a CompositePromise that does something like TCO with recursion, detect no further handlers are added to each interim promise and decompose the chain, lots of caveats) but instead libraries expose methods like `.each` :)
type: Comment
comment on: http://stackoverflow.com/a/29931657
score: 0

http://stackoverflow.com/comment/47853785
type: AnswerComment
has text: Honestly I didn't understand your question well and I just made a wild guess. `unresolved` doesn't seem the right thing for your problem. Unresolved is only to indicate Polymer has finished initializing all components. There is no universal way to know when all is done. What you can do is to create a loading indicator component which listens for events. When you start a long running operation you fire an event to indicate to the loading indicator to show itself, when your ajax call finished you fire another event to indicate the loading indicator should remove itself.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29862039

http://stackoverflow.com/comment/48054683
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/29967257
has text: Well, something like [this fiddle](http://jsfiddle.net/q1c0yvp7/), I suppose.

http://stackoverflow.com/comment/47859359
has text: Agree with @BenjaminGruenbaum
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29865973
score: 0

http://stackoverflow.com/q/29897405
score: -1
has body: I want the value which I am passing in QueryString in HTML page. I wrote function for it, But it gives me below error: TypeError: str.substring is not a function Below is my function: function getQueryStringArray() { var str = window.location.search.substring(1).split('?'); var res = str.substring(6,14); alert(str); alert(res); } my URL is like: http://localhost:50629/youtube/test.html?type=Mensworld
has comment: http://stackoverflow.com/comment/47917528
type: Question
has title: I am getting error when trying to get substring in javascript
upvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/29897458
tagged with: http://stackoverflow.com/tag/html
type: UnansweredQuestion
downvote count: 1

http://stackoverflow.com/a/29847412
upvote count: 1
accepted answer of: http://stackoverflow.com/q/29847100
has comment: http://stackoverflow.com/comment/47821418
has comment: http://stackoverflow.com/comment/47823473
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/47823825
answers question: http://stackoverflow.com/q/29847100
type: Answer
score: 1
has comment: http://stackoverflow.com/comment/47822977
has body: Don't use eval. Can't you simply do this instead? First create the result object var widgetOptions = { filter_formatter: {}; }; Now just append to it $(".tablesorter th").each(function(i) { if($(this).attr('class') == "notFiler") { widgetOptions.filter_formatter[i] = function($cell, indx){return null;}; } }); Then, initialize the tablesorter var tablesorter = $('.tablesorter').tablesorter({ widgetOptions: widgetOptions });

http://stackoverflow.com/comment/48017269
comment on: http://stackoverflow.com/q/29946624
has text: @Trim, I have updated it with the error function aswell.
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/q/29988114
upvote count: 1
score: 1
has answer: http://stackoverflow.com/a/29988169
has title: What is the best way to get the boolean value of an expression?
type: Question
has comment: http://stackoverflow.com/comment/48095589
answer count: 2
has body: What is the best way to get the boolean value of an expression? I usually use !!, wonder if there is any reason to use it over Boolean or if it's ok to use either of those. someFunction: function(param){ var myBoolean = !!param; } But I can also do: someFunction: function(param){ var myBoolean = Boolean(expression); } https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean
has answer: http://stackoverflow.com/a/29988296
downvote count: 0
tagged with: javascript
favorite count: 0
linked to: http://stackoverflow.com/q/784929
linked to: http://stackoverflow.com/q/15335452
type: UnansweredQuestion

http://stackoverflow.com/a/29975149
has body: The main problem here is in your CSS: #html.js #slideshow .slides img{ position: absolute; margin-left: auto; margin-right: auto; } Margin: auto; will only work on objects that have a defined width. Since an image is a replaced inline-block, no real width exists. This is made worse by the fact that you've positioned it absolutely, which changes the way margins will work - the item will always pick up its position relative to the determined parent, and apply margins after that outside of the flow, so auto will not be relevant. first step is to remove the absolute positioning on the image, it's not useful here. By default, images are a type of inline-block, so simply adding "text-align:center;" to the "#slideshow .slides" selector will center the images. Alternately, if we just want to edit the images and force them to center themselves, change the above block to: #html.js #slideshow .slides img{ display:block; margin-left: auto; margin-right: auto; } and everything should line up like you wanted.
type: AcceptedAnswer
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/29974701
type: Answer
has comment: http://stackoverflow.com/comment/48151482
answers question: http://stackoverflow.com/q/29974701
upvote count: 1

e10s
tag name: e10s
type: Tag
tags question: http://stackoverflow.com/q/29863810

http://stackoverflow.com/comment/47990542
type: Comment
comment on: http://stackoverflow.com/q/29934242
type: QuestionComment
has text: maybe you want `type="password"` on the password field?
score: 0

http://stackoverflow.com/comment/47854658
score: 1
comment on: http://stackoverflow.com/q/29864734
type: Comment
type: QuestionComment
has text: It does not refer to either one... it refers to the object instance of `LateBloomer`

http://stackoverflow.com/a/29944785
has comment: http://stackoverflow.com/comment/48010376
has comment: http://stackoverflow.com/comment/48010878
type: Answer
has comment: http://stackoverflow.com/comment/48010604
has comment: http://stackoverflow.com/comment/48013719
downvote count: 0
has comment: http://stackoverflow.com/comment/48011028
answers question: http://stackoverflow.com/q/29944650
score: 3
has comment: http://stackoverflow.com/comment/48011017
has body: jQuery requires the same exact name of the css property. Try with this: var css = { 'animation-iteration-count': 1 } $notify.css(css) Your best bet is to use a separate CSS file to override the Glyphicons Pro rules, instead of using javascript. .glyphicons.animate { -webkit-animation-iteration-count: 1 !important; animation-iteration-count: 1 !important; }
has comment: http://stackoverflow.com/comment/48010472
upvote count: 3
has comment: http://stackoverflow.com/comment/48016690
has comment: http://stackoverflow.com/comment/48011288
has comment: http://stackoverflow.com/comment/48010951

http://stackoverflow.com/comment/48084674
type: QuestionComment
has text: In other places, I am getting Id from AJAX response.
score: 0
comment on: http://stackoverflow.com/q/29982542
type: Comment

http://stackoverflow.com/comment/47980086
score: 0
type: Comment
comment on: http://stackoverflow.com/q/29928897
type: QuestionComment
has text: @tymeJV thanks for suggestion. can you provide some simple example? not sure how to do that.

http://stackoverflow.com/comment/47935191
type: QuestionComment
has text: @BrianWhite - Not to sound ignorant, but how do I pull a server log?
comment on: http://stackoverflow.com/q/29906167
score: 0
type: Comment

http://stackoverflow.com/q/29917691
answer count: 1
has body: i currently try to rederict my language specific virtual url's to the index.html. sadly it won't work so i aks you here. on my index.html page i set virtual urls with the history api such like this: history.pushState(null, null, 'de'); so that works perfectly fine, but when i enter the url manually, the server tries to open the index.php/de, which dosent exists. my idea was to redirect all virtual urls for let's say "/de/" and "/en/" to the index.html file and keep the initial url. i will then do the navigation and content loading stuff in the index.html with js. domain.com/de -> opens the index.html and keeps the original url domain.com/en -> opens the index.html and keeps the original url my mod_rewrite code: RewriteEngine on RewriteRule "^/de?$" "/index.html" unfortunately this code redirect nothing. my server log say that the domain.com/de can not be found. any ideas to fix this? cheers Marco
downvote count: 0
tagged with: javascript
score: 1
tagged with: .htaccess
has answer: http://stackoverflow.com/a/29917974
favorite count: 0
tagged with: mod-rewrite
upvote count: 1
type: AnsweredQuestion
has title: Redirect specific virtual urls to index.html
accepted answer: http://stackoverflow.com/a/29917974
type: Question
tagged with: apache

http://stackoverflow.com/comment/47941497
type: Comment
comment on: http://stackoverflow.com/a/29908651
type: AnswerComment
has text: @djfkdjfkd39939 Yes. You were manipulating the array when iterating through it. Its length and members are changing every time `splice` was called. Read the first example in my answer.
score: 0

http://stackoverflow.com/comment/47982420
has text: which OS are you running? in linux and osx you will see any `console.log` output on the server side in the terminal where you started meteor.
score: 0
comment on: http://stackoverflow.com/q/29922708
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47841500
comment on: http://stackoverflow.com/a/29853527
type: AnswerComment
score: 0
type: Comment
has text: Also, by including `angular-mocks.js` you're including mocked versions of more than just the `$httpBackend` service. You can read more about what else is mocked [here](https://docs.angularjs.org/api/ngMock).

http://stackoverflow.com/a/29896683
type: Answer
downvote count: 0
score: 1
has body: Here is one possible solution with .reduce() method: var data = [ { name: "Nom", type: "string"}, { name: "Prénom", type: "string"} ]; var concatenated = data.reduce(function(result, obj) { result.push(obj.name); return result; }, []).join(", "); console.log(concatenated); This will give result like this: Nom, Prénom
upvote count: 1
answers question: http://stackoverflow.com/q/29896562

http://stackoverflow.com/q/29943546
answer count: 3
has title: angularjs directive to allow tab character
has body: I am trying to create an angularjs directive that will allow input of tab character on a text field. Its working partially but error is not showing correctly. I want this field to be required too. Here is my code .directive('allowTab', function () { return { require: 'ngModel', link: function(scope, ele, attrs, c) { ele.bind('keydown keyup', function(e) { var val = this.value; if (e.keyCode === 9 &amp;&amp; e.type === 'keydown') { // tab was pressed // get caret position/selection var start = this.selectionStart, end = this.selectionEnd; // set textarea value to: text before caret + tab + text after caret this.value = val.substring(0, start) + '\t' + val.substring(end); // put caret at right position again this.selectionStart = this.selectionEnd = start + 1; c.$setValidity('allowTab', true); // prevent the focus lose return false; } else if(e.keyCode !== 9 &amp;&amp; e.type === 'keyup') { if(val === '') { c.$setValidity('allowTab', false); } else { c.$setValidity('allowTab', true); } } }); } } }); here is the jsfiddle: http://jsfiddle.net/36qp9ekL/184/
tagged with: javascript
type: UnansweredQuestion
score: 3
downvote count: 0
has answer: http://stackoverflow.com/a/29959988
favorite count: 0
tagged with: angularjs
type: Question
has answer: http://stackoverflow.com/a/29944758
has answer: http://stackoverflow.com/a/29944602
upvote count: 3

http://stackoverflow.com/comment/48098336
comment on: http://stackoverflow.com/a/29986610
score: 0
type: Comment
type: AnswerComment
has text: Thanks for all of this!

http://stackoverflow.com/a/29938600
has body: What your doing seems reasonable to me, unless your willing to use one of the many input mask libraries available out there. One caveat to consider though, that your code doesn't yet account for, is users pasting in or dragging and dropping in invalid characters. Also, don't forget to consider multiple decimal points, or locales that use the comma as the decimal place indicator. You might also consider scientific exponential notation, thousands separators, leading plus signs, negativity indicated with parentheses instead of the hyphen, other number systems such as hexadecimal, etc... as you feel appropriate.
answers question: http://stackoverflow.com/q/29938302
score: 0
type: Answer

http://stackoverflow.com/q/29972009
has answer: http://stackoverflow.com/a/29976172
has comment: http://stackoverflow.com/comment/48063726
has answer: http://stackoverflow.com/a/29972058
answer count: 3
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
type: UnansweredQuestion
tagged with: css
has body: I'm trying to create my own, modal, dialog using divs: html: Some text css: #overlay{ width: 100%; height: 100%; position: fixed; left: 0px; top: 0px; background-color:#000; opacity: .75; z-index: -1; } #popup { position: absolute; text-align:center; z-index: 1000; } http://jsfiddle.net/wfsaxton/fq7mhefa/ I'm not sure why, but my overlay is not only covering up the page, but also covering up portions of the pop-up (the background and text). I only want it to cover up the page in the background...the pop-up should be fully above the overlay. Any ideas what might be going on?
has answer: http://stackoverflow.com/a/29972076
score: 3
upvote count: 3
has title: Why is my overlay covering some elements but not all?
has comment: http://stackoverflow.com/comment/48068203
has comment: http://stackoverflow.com/comment/48063670
type: Question
downvote count: 0
tagged with: javascript

http://stackoverflow.com/q/29993430
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/48106422
has answer: http://stackoverflow.com/a/29993809
has comment: http://stackoverflow.com/comment/48106550
type: Question
has body: I'm trying to simply move some values into textboxes when a listbox has selected the text. Then, I'm trying to build all the text into one link. However, when debugging using Chrome or Firefox, my jquery events when the listboxes are being selected are not even being hit. Can someone please inform me what I'm doing wrong? I don't think I've had this issue before.... Here is my html: Note that the _guid variable is in a value called "PartnerGuid" above the written html.... Note that the listbox values are populated correctly. Link Builder @Html.DropDownListFor(model => model.url, Model.urlOptions, "Select a url...", new { style = "width:180px;" }) @Html.DropDownListFor(model => model.pbid, Model.pbidOptions, "Select a pbid...", new { style = "width:180px;" }) @Html.DropDownListFor(model => model.ldid, Model.ldidOptions, "Select a ldid...", new { style = "width:180px;" }) Build Link Here is my JS var txturl = $('#url').val($("#url option:selected").text()); var txtpbid = $("#txtpbid").val($("#pbid option:selected").text()); var txtldid = $("#txtldid").val($("#ldid option:selected").text()); var _guid = $("#PartnerGuid").val(); $('#build').click(function (e) { $("#txtlink").val(""); $("#txtlink").val(txturl + "Routes/?ptid=" + _guid + "&pbid=" + txtpbid + "&ldid=" + txtldid); return false; }); JS CHANGE: I changed my JS to the following, but still doesn't work. The reason it still doesn't work is because there are no variables on the page (if you check my DropDownListFor model names (url, pbid, ldid) do not appear in the page. I don't know why. I'm using MVC with a parent page. The html & js are in the Partial (child) page. However, I know that when during debugging, you have to look at the parent page as none of it (html or JS) will be in the child page. What can I do next???? Here is the pertinent updated JS: @Html.DropDownListFor(model => model.url, Model.urlOptions, "Select a url...", new { style = "width:180px;" }) @Html.DropDownListFor(model => model.pbid, Model.…
score: 0
has comment: http://stackoverflow.com/comment/48106384
has title: Cannot intercept values from jquery
has comment: http://stackoverflow.com/comment/48106343
tagged with: listbox
answer count: 1

http://stackoverflow.com/q/29905247
has comment: http://stackoverflow.com/comment/47959515
tagged with: plugins
has comment: http://stackoverflow.com/comment/47935296
tagged with: node.js
has comment: http://stackoverflow.com/comment/47962990
has comment: http://stackoverflow.com/comment/47935314
answer count: 0
has comment: http://stackoverflow.com/comment/47961079
type: Question
has title: nodeJS prevent access to code for variable passed into a function
has comment: http://stackoverflow.com/comment/47942236
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/47949385
has body: I'm creating a plugin system using the following: function Plugin(thingy, code) { var GLOBAL = null; var arguments = null; var process = null; var require = null; eval(code); }; plugins.push(new Plugin(thingy, code)); Please don't get too excited about the eval(), using ('vm') or a sandbox is not an option as this will be a long running object until the user unloads it. It will also be running in it's own nodeJS instance so they can't affect other users. I'd still have the same problem passing in this object reference to a sandbox system anyway. What I am concerned about is someone seeing the code of the thingy object that has functions they need to use e.g shoot() console.log(thingy.shoot.toString()); A way around this was the following: function thingy() { // They can't see this var _shoot = function(someone) { // Load weapon // Aim // Fire }; // They can see this this.shoot = function(someone) { _shoot(someone); }; }; This way if they console.log(thingy.shoot.toString()) they'll only see _shoot(someone); and not the actual code that handles the shooting process. Please could someone help me with the following: Is there an easier way to limit access to a passed in variables code? I'm setting GLOBAL, arguments, process and require to null; are there others I need to worry about?
has comment: http://stackoverflow.com/comment/47963920
type: UnansweredQuestion

http://stackoverflow.com/q/29978359
has body: $.ajax({ type: 'GET', url: 'myUrl/etc' dataType: 'jsonp', jsonp: 'callback', jsonpCallback: 'callback', error: function(error) { alert('Error'); console.log(JSON.stringify(error)); }, timeout: 45000 }); function callback(result) { // Do what i want } People. I am getting an error only in IE8 on a ajax callback , I have no idea what might be or why it is happening. When i try to run the ajax in all browsers the callback will be called, but in IE the alert error will pop up and the console.log will show: LOG: { "readyState": "ok", "status": 200, "statusText": "success" } Any idea why is giving this "error" only in IE8???
has comment: http://stackoverflow.com/comment/48076724
tagged with: jquery
tagged with: ajax
has comment: http://stackoverflow.com/comment/48076421
has comment: http://stackoverflow.com/comment/48076906
has comment: http://stackoverflow.com/comment/48076694
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/48076664
has comment: http://stackoverflow.com/comment/48076419
has comment: http://stackoverflow.com/comment/48076927
has answer: http://stackoverflow.com/a/29978454
has comment: http://stackoverflow.com/comment/48076766
type: Question
has title: Error in Ajax callback only in IE8?
tagged with: internet-explorer-8
has comment: http://stackoverflow.com/comment/48076392
has comment: http://stackoverflow.com/comment/48076819
tagged with: javascript
linked to: http://stackoverflow.com/q/4557532
score: 0
answer count: 1

http://stackoverflow.com/a/29862397
score: 1
has comment: http://stackoverflow.com/comment/47850266
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/47850330
has body: Your Business Name angular.module('BusinessinfoModule', []) .controller('BusinessinfoController', function($scope) { $scope.business = 'aaa'; }); https://jsfiddle.net/ncoxq6zf/
type: Answer
accepted answer of: http://stackoverflow.com/q/29862318
answers question: http://stackoverflow.com/q/29862318
upvote count: 1

http://stackoverflow.com/comment/47920772
score: 1
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29899011
has text: You only need one `appendChild`, something like `document.getElementById('childs').appendChild(document.querySelector('.checkbox'))`

http://stackoverflow.com/q/29927500
tagged with: arguments
has comment: http://stackoverflow.com/comment/47976895
has comment: http://stackoverflow.com/comment/47977074
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47976911
has comment: http://stackoverflow.com/comment/47977034
upvote count: 2
has comment: http://stackoverflow.com/comment/47977097
score: 1
tagged with: subset
has comment: http://stackoverflow.com/comment/47977002
accepted answer: http://stackoverflow.com/a/29927606
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/47976958
has title: does size of argument in a javascript function affects its performance?
has body: I have a key value pair containing five keys with values as huge array of thousand objects each . I can either subset it while passing it into a function or i can pass whole array in the function. For e.g: keyVal ={"first_array": Object[1000], "second_array": Object[1000], "third_array": Object[1000], "fourth_array": Object[1000] } var first_arr = keyVal.first_array Two possibilities: function notSubsettedArgs(keyVal){ $.each(keyVal.first_array,function(i,item){ //some processing}); } function subsettedArgs(first_array){ $.each(first_array,function(i,item){ //do some processing}); } Does it make difference in javascript ? Does function takes the load of size of arguments ? Thanks
tagged with: function
tagged with: javascript
has comment: http://stackoverflow.com/comment/47977022
has comment: http://stackoverflow.com/comment/47977021
answer count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/29927606
has comment: http://stackoverflow.com/comment/47976878
has comment: http://stackoverflow.com/comment/47976859

http://stackoverflow.com/q/29892101
type: UnansweredQuestion
has body: Im trying to make posts with youtube video. Every post has a link on youtube video, just like that: { title: "Some video", link: "http://www.youtube.com/watch?v=XfWnITmT1Ws" } and template post is {{title}} But it doesn't work. The error is Refused to display 'http://www.youtube.com/watch?v=gpEgXOgRQ8w' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'. Somebody met it? What should i do?
tagged with: iframe
has answer: http://stackoverflow.com/a/29892220
tagged with: youtube-api
type: Question
tagged with: javascript
has title: How to make posts with youtube on meteorjs?
score: 0
answer count: 1
tagged with: meteor

http://stackoverflow.com/a/29999602
has comment: http://stackoverflow.com/comment/48119918
has body: Using the JSFiddle Here, I found that changing the height or width of the container forces the image to be scaled to the largest height or width. Meaning that the measurement of one edge of the background will be equal to one of the dimension of the container. Using this and some proportions we can calculate the dimensions of the image. // let .container represent element containing the image var image; // the image object to the background image var dim_h, dim_w; // the height and width of the actual image height = $(".container").height(); width = $(".container").width(); if (height &gt;= width) { dim_h = height; dim_w = (height / image.height) * image.width; } else { dim_w = width; dim_h = (width / image.width) * image.height; } // dim_w and dim_h contain the width and height of the actual // background image after scaling The above code uses the proportion below to calculate it. (element_height / image_height) == (element_width / image_width) I think it should give you the answer you want.
has comment: http://stackoverflow.com/comment/48118334
upvote count: 1
has comment: http://stackoverflow.com/comment/48118264
type: Answer
has comment: http://stackoverflow.com/comment/48118338
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/48118391
answers question: http://stackoverflow.com/q/29999515
has comment: http://stackoverflow.com/comment/48118368

http://stackoverflow.com/a/29980594
upvote count: 2
type: Answer
score: 2
answers question: http://stackoverflow.com/q/29980563
has body: Because in your first function, the statement a = initializes a new variable in local scope (it essentially translates to var a =) completely unrelated to the global a variable, whereas in the second function, you're calling upon and mutating the original array passed into it.
downvote count: 0

http://stackoverflow.com/a/29860564
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47846952
score: 0
has comment: http://stackoverflow.com/comment/47847026
type: Answer
has body: Reading through the documentation for the validate method of that plugin, I found out that you should be using the submitHandler callback when you actually want to submit a valid form. submitHandler (default: native form submit): Callback for handling the actual submit when the form is valid. Gets the form as the only argument. Replaces the default submit. The right place to submit a form via Ajax after it is validated. And as @Sparky mentioned: You typically would not need the success option unless you want to utilize the error label on a valid element like for a green checkmark or something. success Type: String or Function() If specified, the error label is displayed to show a valid element. If a String is given, it is added as a class to the label. If a Function is given, it is called with the label (as a jQuery object) and the validated input (as a DOM element). The label can be used to add a text like "ok!". So, instead of placing the form.submit(); bit inside of the success callback, you should place it inside of submitHandler. So your code should look something like this: // Optional, read what this does success: 'valid', // This does the actual form submitting submitHandler: function (form) { form.submit(); }, By the way, form.submit() is not AJAX, from what I understand, it just submits the form in the traditional way.
accepted answer of: http://stackoverflow.com/q/29860410
answers question: http://stackoverflow.com/q/29860410

http://stackoverflow.com/comment/47969382
comment on: http://stackoverflow.com/a/29923852
score: 0
type: Comment
has text: If you hold down return for too long, you get repeated keypresses, so the keydown fires on the input, changing it back to the link.
type: AnswerComment

http://stackoverflow.com/comment/48112603
has text: Ah alright, so the player presses the shoot button and randomly it'll be a hit or miss which will then show in the center, is that right?
score: 1
comment on: http://stackoverflow.com/q/29996236
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/48037043
has text: @code4jhon—if it didn't, the OP would get an error, which apparently doesn't occur.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29957804

http://stackoverflow.com/a/30247758
has comment: http://stackoverflow.com/comment/61032771
score: 21
has body: Authenticate returns a Promise in the later versions of sequelize: https://github.com/sequelize/sequelize/blob/2.0/lib/sequelize.js#L939 Read the bluebird documentation here as it is quite useful: https://github.com/petkaantonov/bluebird/blob/master/API.md Something like this should work (make sure you check for connection errors...this is just a simple example): var Sequelize = require('sequelize'); var sql = new Sequelize('DB', 'UNAME', 'PASS', { host: 'localhost', port: 3306, dialect: 'mysql' }); var test = sql.authenticate() .then(function () { console.log("CONNECTED! "); }) .catch(function (err) { console.log("SOMETHING DONE GOOFED"); }) .done();
upvote count: 21
type: Answer
downvote count: 0
answers question: http://stackoverflow.com/q/29977855

http://stackoverflow.com/q/29881505
score: 2
type: AnsweredQuestion
downvote count: 1
has answer: http://stackoverflow.com/a/29881560
accepted answer: http://stackoverflow.com/a/29881560
type: Question
answer count: 2
tagged with: null
has title: Can I assign values to null-initialized properties in JavaScript?
tagged with: javascript
possible better answer: http://stackoverflow.com/a/29881551
upvote count: 3
has body: I am creating a JavaScript object and I'd like to be able to distinguish between unset and empty properties. Therefore I initialize it's properties to null at creation. Then I can fill the properties with specific values. Sometimes these values are empty (such as '' for string properties and 0 for numbers). I have something like this: var myObject = { aString: null, setEmpty() { this.aString = ''; } } I am programming with PhpStorm, and it complains: "Assigned expression type string is not assignable to type null". AFAIK, null is a special object type in JavaScript, so I am facing a type mismatch problem. But how can I otherwise tell an empty value from an uninitialized one?
tagged with: phpstorm
tagged with: type-mismatch
tagged with: initialization
favorite count: 0
has answer: http://stackoverflow.com/a/29881551

http://stackoverflow.com/q/29934701
score: 2
has answer: http://stackoverflow.com/a/29934833
tagged with: chart.js
tagged with: codeigniter
has body: I use php codeigniter and I create pie chart using javascript. and database data pass using json encode. My problem is how I use legend. for pie chart and title. javascript var pieData = [ { value: sales_data[i].ans, color:"#FF0000" }, { value : sales_data[i].noans, color : "#006400" }, { value : sales_data[i].reans, color : "#191970" } , { value : sales_data[i].noreans, color : "#FFEA88" } ]; // get pie chart canvas var countries=document.getElementById("countries").getContext("2d"); // draw pie chart new Chart(countries).Pie(pieData, pieOptions); } } });
type: Question
answer count: 2
tagged with: javascript
downvote count: 0
has title: how to add legend in pie chart
favorite count: 0
upvote count: 2
has answer: http://stackoverflow.com/a/29934787
type: UnansweredQuestion
tagged with: php

http://stackoverflow.com/q/29880274
has comment: http://stackoverflow.com/comment/47884723
has title: Cannot get service to work in angular.js
tagged with: angularjs
type: UnansweredQuestion
answer count: 0
has comment: http://stackoverflow.com/comment/47884761
has body: I cannot get the "posts" service to work in the "angular services" section of this tutorial from thinkster.io: https://thinkster.io/mean-stack-tutorial/ Why won't the new posts show up when created? I used Yeoman to set up the app. Here is my code: app.js use strict'; /** * @ngdoc overview * @name meanStackTutorialApp * @description * # meanStackTutorialApp * * Main module of the application. */ angular.module('meanStackTutorialApp', [ 'ngAnimate', 'ngCookies', 'ngResource', 'ngRoute', 'ngSanitize', 'ngTouch' ]) .config(function ($routeProvider) { $routeProvider .when('/', { templateUrl: 'views/main.html', controller: 'MainCtrl' }) .when('/about', { templateUrl: 'views/about.html', controller: 'AboutCtrl' }) .otherwise({ redirectTo: '/' }); }); main.js angular.module('mainMod').factory('posts', [function(){ var o = { posts : [] }; return o; }]); var MainMod = angular.module('mainMod') .controller('MainCtrl', ['$scope', 'posts', function ($scope, posts) { $scope.posts = posts.posts; $scope.incrementUpvotes = function(post) { post.upvotes += 1; }; $scope.addPost = function(){ if(!$scope.title || $scope.title === '') { return; } $scope.posts.push({title: $scope.title, link: $scope.link, upvotes: 0}); $scope.title = ''; $scope.link = ''; }; }]); main.html: Post ^ {{post.title}} - {{post.title}} {{post.title}} upvotes: {{post.upvotes}} h index.html <!--[if lt IE 7]> You are using an outdated browser. Please upgrade your browser to improve your experience. <![endif]--> Toggle navigation meanStackTutorial Home About Contact from the Yeoman team
type: Question
tagged with: angularjs-service
tagged with: javascript
has comment: http://stackoverflow.com/comment/47884806
score: 0
has comment: http://stackoverflow.com/comment/47935466

http://stackoverflow.com/q/29893098
type: Question
has comment: http://stackoverflow.com/comment/47911975
score: -2
has body: I am trying to create a C3 bar chat. Need to pass the JSON dynamically. JSON: JSONdata { "applicationName": "app1", "frequency": 1 }, { "applicationName": "app2", "frequency": 54 }, { "applicationName": "app3", "frequency": 3 } I have the below code and it does not work. Tried using JSONdata.stringify() too. var chart = c3.generate({ data: { type: 'bar', json: [ JSONdata ], keys: { x: 'applicationName', value: ['frequency'] } }, axis: { x: { type: 'category' } }, bar: { width: { ratio: 0.5 } } });
has comment: http://stackoverflow.com/comment/47911936
tagged with: javascript
tagged with: c3
downvote count: 2
has comment: http://stackoverflow.com/comment/47909380
answer count: 1
has answer: http://stackoverflow.com/a/29919517
favorite count: 0
has comment: http://stackoverflow.com/comment/47912974
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47909233
has comment: http://stackoverflow.com/comment/47909293
has title: load JSON Object Dynamically for C3 bar chart
upvote count: 0
tagged with: http://stackoverflow.com/tag/json

http://stackoverflow.com/comment/48121539
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29997044
type: Comment
has text: Also I need to do this four or five times from other pages so I know my skills arent evolved enough to find a simpler way to do this.

http://stackoverflow.com/q/29998462
has comment: http://stackoverflow.com/comment/48116544
has answer: http://stackoverflow.com/a/39776430
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/29998797
has comment: http://stackoverflow.com/comment/48116335
type: AnsweredQuestion
has title: routeProvider is unknown?
has answer: http://stackoverflow.com/a/29998797
has comment: http://stackoverflow.com/comment/48116671
has body: I've found similar post but it seems like its a different case, I think for mine, angular module is not binding to html somehow. Here are my code and error from console. Please note that I am using gulp to combine all the ng .js file into /app.js and the order of combining is [module.js , other*.js] so angular.module('app', ['ngRoute']) is always first to be defined. Error: Uncaught Error: [$injector:modulerr] Failed to instantiate module app due to: Error: [$injector:unpr] Unknown provider: $routeProvider http://errors.angularjs.org/1.2.18/$injector/unpr?p0=%24routeProvider at http://ajax.googleapis.com/ajax/libs/angularjs/1.2.18/angular.js:78:12 at http://ajax.googleapis.com/ajax/libs/angularjs/1.2.18/angular.js:3741:19 at getService (http://ajax.googleapis.com/ajax/libs/angularjs/1.2.18/angular.js:3869:39) at Object.invoke (http://ajax.googleapis.com/ajax/libs/angularjs/1.2.18/angular.js:3896:13) at http://ajax.googleapis.com/ajax/libs/angularjs/1.2.18/angular.js:3824:37 at Array.forEach (native) at forEach (http://ajax.googleapis.com/ajax/libs/angularjs/1.2.18/angular.js:320:11) at loadModules (http://ajax.googleapis.com/ajax/libs/angularjs/1.2.18/angular.js:3811:5) at createInjector (http://ajax.googleapis.com/ajax/libs/angularjs/1.2.18/angular.js:3751:11) at doBootstrap (http://ajax.googleapis.com/ajax/libs/angularjs/1.2.18/angular.js:1410:20) routes.js app.config(function($routeProvider){ $routeProvider .when('/', { controller : 'PostsCtrl', templateUrl : 'posts.html' }) .when('/register', { controller : 'RegisterCtrl', templateUrl : 'register.html' }) .when('/login', { controller: 'LoginCtrl', templateUrl : 'login.hrml' }) }) app.html module.js angular.module('app', ['ngRoute'])
has comment: http://stackoverflow.com/comment/48116682
type: Question
possible better answer: http://stackoverflow.com/a/29998716
has answer: http://stackoverflow.com/a/29998716
tagged with: javascript
score: 0
answer count: 3
linked to: http://stackoverflow.com/q/22891058

http://stackoverflow.com/a/29918565
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/29918400
downvote count: 0
has body: Your data is stored in callback function &lt;script&gt; $.ajax({ url : 'action/ajax.php', type : 'POST', success : function (result) { //this is where you need to call your data which is result and not success console.log (result); }, error : function () { console.log ('error'); } }); &lt;/script&gt;
type: Answer

http://stackoverflow.com/comment/47923645
has text: @David yes, pls let me know how to do it?
type: QuestionComment
comment on: http://stackoverflow.com/q/29900404
score: 0
type: Comment

http://stackoverflow.com/q/29930010
has title: Sorting Array of Arrays with Strings in it
has body: I am trying to sort an array with an array of strings in it. It is similar to this problem (Sort an array with arrays in it by string) but I wasn't sure how to implement that. My array is as follows var myArray = [ ['blala', 'alfred', '...'], ['jfkdj', 'berta', '...'], ['vkvkv', 'zimmermann', '...'], ['cdefe', 'albert', '...'], ]; I am trying to sort it alphabetically (not case sensitive) by the name or the second argument for the inner arrays. After that I want to sort by the first argument if there are two elements with the same second argument. I tried using the following but was unsuccessful and didn't really get why. Can anyone advise: function Comparator(a,b){ if (a[1] &lt; b[1]) return -1; if (a[1] &gt; b[1]) return 1; return 0; } var myArray = [ ['blala', 'alfred', '...'], ['jfkdj', 'berta', '...'], ['vkvkv', 'zimmermann', '...'], ['cdefe', 'albert', '...'], ]; myArray = myArray.sort(Comparator); To sort on the first argument after the second argument would I do this? function Comparator(a,b){ if (a[1] &lt; b[1]){ if (a[2] &lt; b[2]) return -1 if (a[2] &gt; b[2]) return 1; } return -1; } if (a[1] &gt; b[1]) return 1;{ if (a[2] &lt; b[2]) return -1 if (a[2] &gt; b[2]) return 1; } return 1; } return 0; } var myArray = [ ['blala', 'alfred', '...'], ['jfkdj', 'berta', '...'], ['vkvkv', 'zimmermann', '...'], ['cdefe', 'albert', '...'], ]; myArray = myArray.sort(Comparator);
type: Question
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/5435228
has comment: http://stackoverflow.com/comment/47982188
tagged with: javascript
tagged with: sorting
score: 4
upvote count: 4
accepted answer: http://stackoverflow.com/a/29930226
answer count: 1
tagged with: arrays
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/47982330
tagged with: node.js
has comment: http://stackoverflow.com/comment/47982670
has comment: http://stackoverflow.com/comment/47983257
has comment: http://stackoverflow.com/comment/47982353
has answer: http://stackoverflow.com/a/29930226

http://stackoverflow.com/a/29847965
downvote count: 0
answers question: http://stackoverflow.com/q/29847133
type: AcceptedAnswer
upvote count: 2
type: Answer
score: 2
has body: dojo.hitch(this, function () { this.two(); })) can definitely be simplified in a couple of ways. The most literal simplification would be dojo.hitch(this, this.two). This has the same effect as above, with one less function definition involved, instead passing the two function directly to hitch. (this.two only references the function, it doesn't execute it, since there are no parentheses after the reference.) An even more concise simplification would be dojo.hitch(this, 'two'). This is technically slightly different than the previous two, in that it achieves late binding, because two will be looked up at the time the generated function is called, whereas in the first two examples, it will be looked up as soon as hitch is called to generate the function. The hitch and partial tutorial might also be helpful.
accepted answer of: http://stackoverflow.com/q/29847133

http://stackoverflow.com/q/29887817
has comment: http://stackoverflow.com/comment/47901216
type: Question
tagged with: c#
has comment: http://stackoverflow.com/comment/47899544
has comment: http://stackoverflow.com/comment/47901474
has comment: http://stackoverflow.com/comment/47899638
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/29896640
answer count: 2
tagged with: jquery
linked to: http://stackoverflow.com/q/2780566
tagged with: asp.net
has answer: http://stackoverflow.com/a/29889016
has comment: http://stackoverflow.com/comment/47900320
has comment: http://stackoverflow.com/comment/47900138
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47899834
has comment: http://stackoverflow.com/comment/47902974
has title: jquery dropdownlist give wrong result
has body: I am using following script but the problem is script is not working properly.Some time work and some time show wrong text.Instead of selected text.it Show me full text like this. SELECT MINOR علوم الحاسب الآلي هندسة الطيران والفضاء والتكنولوجيا Select Minor علوم الحاسب الآلي نظم المعلومات تكنولوجيا المعلومات الأخرى $('#slMinor_Title').on('change', function () { alert($('.cslMinor_Title').find('option:selected').text()); }); This is happen when i submit FORM through update panel and i am using this option in dialog box. I want selected text not like below SELECT MINOR علوم الحاسب الآلي هندسة الطيران والفضاء والتكنولوجيا and also i tried many options like below jQuery("#slMinor_Title option:selected").text() But all are giving same result.Guide me what is the problem with code.

http://stackoverflow.com/comment/47950041
score: 0
comment on: http://stackoverflow.com/q/29914143
type: Comment
type: QuestionComment
has text: Why dont use Greasemonkey?

http://stackoverflow.com/comment/48323537
comment on: http://stackoverflow.com/q/29993531
score: 0
type: Comment
type: QuestionComment
has text: better to post an answer with an explanation on how you solved your problem.

http://stackoverflow.com/comment/71410667
type: Comment
has text: I don't see way to specify different responses based on the arguments passed. Is this possible?
type: AnswerComment
comment on: http://stackoverflow.com/a/37345527
score: 0

http://stackoverflow.com/comment/48080412
score: 0
comment on: http://stackoverflow.com/a/29912287
type: Comment
has text: @KenFyrstenberg I've copied and started studying the code and ill keep looking at the demo thanks.
type: AnswerComment

http://stackoverflow.com/q/29918449
score: 0
has comment: http://stackoverflow.com/comment/47958134
has comment: http://stackoverflow.com/comment/47958132
tagged with: this
linked to: http://stackoverflow.com/q/203198
type: UnansweredQuestion
has body: When you click on the + button you get a new option. When you click on the new + button created it doesn't work, why? http://jsfiddle.net/artworkjpm/6rmwzop1/ Ask your question here: Save Amend question Option 1 Decide You should: $(document).ready(function() { //Write question //Save question, replace over input $("#save").on("click", function() { //get value of question var question = $("#questionInput").val(); //replace over label $("#replace").text(question); //hide input $("#questionInput").hide(); //hide save button $("#save").hide(); //show refresh button $("#refresh").show(); //on click of refresh re-enable input field and save button }); //Onclick of refresh button enable amend question $("#refresh").on("click", function() { $("#replace").text("Ask your question here:"); $("#questionInput").show(); $("#save").show(); $("#refresh").hide(); }); //Decide on number of answers $(function() { var counter = 1; $('.plus').on("click", function(event) { event.preventDefault(); counter++; var firstRow = $(' Option' +' '+counter+' ' + ' ' + ' '+ ' '+ ' '); $('table.options').append(firstRow); }); }); //delete an answer option $('.minus').click(function(event) { event.preventDefault(); $(this).destroy(firstRow); }); //On click, get values of answers & choose random answer $("#doThis").bind("click", function() { var optionone = $("#option1").val(); var optiontwo = $("#option2").val(); var optionthree = $("#option3").val(); var optionfour = $("#option4").val(); var optionfive = $("#option5").val(); var arrayList = [optionone, optiontwo, optionthree, optionfour, optionfive ]; var decide = arrayList[Math.floor(Math.random() * arrayList.length)]; $("#verdict").text(decide); }); // end of dothis click event }); // end of ready It will be easier to view this on the js fiddle http://jsfiddle.net/artworkjpm/6rmwzop1/
duplicate of: http://stackoverflow.com/q/203198
tagged with: append
answer count: 0
has title: On this click doesn't work for the + button
type: Question
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/29925282
tagged with: jquery
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
answer count: 0
has title: Fixed Element on scroll issue
type: Question
has body: So, I'm trying to reproduce the main scrolling effect on this beautiful portfolio: http://melaniedaveid.com/ I've followed this tutorial on Codyhouse: http://codyhouse.co/gem/fixed-background-effect/ And came up with the following Javascript function. $(window).scroll(function(){ var scrollTop = $(window).scrollTop(), windowHeight = $(window).height(), contentright1 = document.getElementById('contentright1'); function checkScroll(id) { var offset = scrollTop - $(id).offset().top; if (offset &gt;= 0 &amp;&amp; offset &lt; windowHeight) { $(id).addClass('fixed_content'); if ((scrollTop/2) &lt;= windowHeight) { $(id).removeClass('fixed_content'); } } else { $(id).removeClass('fixed_content'); } }; checkScroll(contentright1); The fidex_content class apply the following CSS: .fixed_content { position: fixed; top:0; } As you can see, my main problem is that I can't manage to remove this class when I go back to the position of the element in the first place.
score: 0
has comment: http://stackoverflow.com/comment/47996634
has comment: http://stackoverflow.com/comment/47972857
tagged with: javascript

event-handling
tag name: event-handling
tags question: http://stackoverflow.com/q/29866502
type: Tag
tags question: http://stackoverflow.com/q/29877438
tags question: http://stackoverflow.com/q/29874165

http://stackoverflow.com/a/29847666
has comment: http://stackoverflow.com/comment/47905562
has comment: http://stackoverflow.com/comment/47931703
answers question: http://stackoverflow.com/q/29847218
downvote count: 0
upvote count: 2
has body: Here's a quick tutorial to get the GPS position: HTML5 Geolocation You basically make a call like this: &lt;script&gt; var x = document.getElementById("demo"); function getLocation() { if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(showPosition); } else { x.innerHTML = "Geolocation is not supported by this browser."; } } function showPosition(position) { x.innerHTML = "Latitude: " + position.coords.latitude + "&lt;br&gt;Longitude: " + position.coords.longitude; } &lt;/script&gt; To put the lat/lon point on top of an image, you'll have to know the lat/lon of each corner of the image and then do some math. Unless you're using some geospatial framework such as Google Maps API or OpenLayers, in which case the math can be done for you.
type: Answer
score: 2

http://stackoverflow.com/a/29871025
score: 0
type: Answer
answers question: http://stackoverflow.com/q/29870586
has body: Ah - the reason is initially a string. I converted it to an Integer using parseInt and it worked!

http://stackoverflow.com/comment/47858093
score: 0
has text: if you receive a string, and `json_decode()` does not work, then your string is invalid json syntax/format.
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29866009

http://stackoverflow.com/comment/75361569
type: Comment
comment on: http://stackoverflow.com/a/32671263
score: 0
type: AnswerComment
has text: @DanielHerr hmm... if `for in` also eagerly grabs the keys then there's no difference. it's a small thing though, the performance difference is probably negligible.

http://stackoverflow.com/q/29889311
downvote count: 1
tagged with: javascript
favorite count: 0
score: 0
has comment: http://stackoverflow.com/comment/47902251
has comment: http://stackoverflow.com/comment/47902458
has answer: http://stackoverflow.com/a/29889757
has comment: http://stackoverflow.com/comment/47902242
possible better answer: http://stackoverflow.com/a/29889757
has title: When creating a Javascript function, should I check if parameter was undefined?
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47902318
type: Question
has body: When creating a function like this: function (var1) { if (!var1) var1 = 'Hello' return var1 + ' World' } Is it acceptable for me to check if var1 is unset by simply doing if (!var1)? Or should I always do an undefined check like if (var1 === undefined) ? I know both will work. I just want to know what the true "professional" way of doing this is.
answer count: 2
upvote count: 1
has answer: http://stackoverflow.com/a/29889394
accepted answer: http://stackoverflow.com/a/29889394

http://stackoverflow.com/comment/56747396
type: AnswerComment
score: 0
type: Comment
has text: Nice! Sorry for late :)
comment on: http://stackoverflow.com/a/29873237

http://stackoverflow.com/comment/48112693
has text: That is correct. I do apologize if I wasn't very descriptive when I initially talked about my issue.
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29996236

http://stackoverflow.com/comment/48118529
score: 1
comment on: http://stackoverflow.com/q/29999657
type: QuestionComment
type: Comment
has text: This isn't an answer to your question, but your first method doesn't behave how you assume it does. What you're doing is adding a new array at each 5th index, so `a[0]` will return an array of five 2s, while `a[1]` up to `a[4]` will return nothing.

http://stackoverflow.com/q/29986079
tagged with: select
type: Question
has answer: http://stackoverflow.com/a/29986544
has body: How do I filter a table content based on option selected ? I would need to refresh the table below - each time the option on the select changes. HTML ID Description {{attr.id}} {{attr.name}} Module angular.module('Employee',[]) .controller('EmployeeCtl',function($scope){ $scope.grades=[ {"id":1,"Title":"MTS"}, {"id":2,"Title":"SMTS"}, {"id":3,"Title":"PMTS"}, {"id":4,"Title":"CMTS"} ]; $scope.attributes=[ {"id":1,"name":"Greg","grade":"MTS"}, {"id":2,"name":"Marlon","grade":"SMTS"}, ......... ]; });
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29986544
has comment: http://stackoverflow.com/comment/48092122
answer count: 1
has comment: http://stackoverflow.com/comment/48091893
tagged with: angularjs
has comment: http://stackoverflow.com/comment/48092099
type: AnsweredQuestion
has title: Filtering of selected option
score: 0

http://stackoverflow.com/comment/48037722
score: 0
has text: Thank you very much! It's works now! I was installing framework - express. "json" was by default in this line "app.use(bodyParser.json());"
type: Comment
comment on: http://stackoverflow.com/q/29954094
type: QuestionComment

http://stackoverflow.com/comment/47836237
has text: I can't see how these two are the exact same question. I'm not even using jQuery (something that the answers on that page seem to heavily rely on). How--then--do I make this question unique?
score: 0
comment on: http://stackoverflow.com/q/29852361
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47994115
type: AnswerComment
has text: Thank you, a down upgraded will fix it then.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29932722

http://stackoverflow.com/comment/48048128
has text: In that case, check the JavaScript console of your browser. It should display the data which the server returns. You can also add an error handler to the code to see failures.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29913223
type: AnswerComment

http://stackoverflow.com/comment/90716355
score: 0
type: AnswerComment
type: Comment
has text: @nguyen-tran I've updated the link to the bug report.
comment on: http://stackoverflow.com/a/30243695

http://stackoverflow.com/q/29908282
accepted answer: http://stackoverflow.com/a/29909466
has comment: http://stackoverflow.com/comment/47938970
has title: Javascript Es6 default export
type: AnsweredQuestion
score: 2
upvote count: 2
has comment: http://stackoverflow.com/comment/47972678
has comment: http://stackoverflow.com/comment/47938991
type: Question
has comment: http://stackoverflow.com/comment/47938994
tagged with: ecmascript-6
has comment: http://stackoverflow.com/comment/47941272
has comment: http://stackoverflow.com/comment/47972686
has answer: http://stackoverflow.com/a/29909466
tagged with: javascript
has comment: http://stackoverflow.com/comment/47939323
tagged with: export
has body: I just want to double check since I am trying to do this ES6 export default: var Member = function(){} export { Member as default }; JShint is error-ing out with this syntax (es6 enabled) but I thought it was valid. Is this really invalid or what is a valid way for writing a default export with the export syntax as export { Member }; I was using this as reference: http://www.2ality.com/2014/09/es6-modules-final.html The example they gave was: //------ module1.js ------ export default 123; //------ module2.js ------ const D = 123; export { D as default }; Why is this module2's 2nd line valid? (or is it?)
answer count: 1
downvote count: 0
favorite count: 0

http://stackoverflow.com/comment/48015211
comment on: http://stackoverflow.com/a/29946884
has text: Why was this down voted? This seems correct to me. Since in his ajax he specified the type JSON then if the parse fails, according to the jquery documentation, success() will not be called.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/29933589
type: AnsweredQuestion
downvote count: 0
score: 1
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/29933736
accepted answer: http://stackoverflow.com/a/29933736
answer count: 2
upvote count: 1
possible better answer: http://stackoverflow.com/a/63515164
has answer: http://stackoverflow.com/a/63515164
tagged with: jquery
favorite count: 0
has title: Remove img-element from Angular page
tagged with: angularjs
tagged with: element
has body: I'm creating an angular web app in which I want to show an image at first, but when you click on a button, I want to remove this default image and replace it with a videostream of the webcam. But so far, removing the image - element remains hard... angular.module('qrWebapp').directive('qrScanner', ['$timeout', 'openScannerService', function($timeout, openScannerService) { return { restrict: 'E', scope: { ngSuccess: '&amp;ngSuccess', ngError: '&amp;ngError', ngVideoError: '&amp;ngVideoError' }, link: function(scope, element, attrs) { var isOpen; var onlyOpenOnce = 0; var image = document.createElement('img'); image.setAttribute('id', 'defaultImage'); image.setAttribute('src', 'assets/images/defaultimage.png'); image.setAttribute('width', '400'); image.setAttribute('height', '300'); image.setAttribute('alt', 'defaultimage'); scope.$on('handlePublish', function() { isOpen = openScannerService.sharedBoolean; if(isOpen){ //some code //finding the image on the angular page var findedElement = angular.element('#defaultImage'); findedElement.remove(); var context; if(onlyOpenOnce &lt; 1){ angular.element(element).append(video); angular.element(element).append(canvas); context = canvas.getContext('2d'); } onlyOpenOnce++; } else { angular.element(element).append(image); } }); } }; }]); Does anyone have any idea what I'm doing wrong?
tagged with: angular-directive

promise
tags question: http://stackoverflow.com/q/29859210
tags question: http://stackoverflow.com/q/29960154
tags question: http://stackoverflow.com/q/29988667
tags question: http://stackoverflow.com/q/29934258
tags question: http://stackoverflow.com/q/29882220
tags question: http://stackoverflow.com/q/29896315
tags question: http://stackoverflow.com/q/29883056
tags question: http://stackoverflow.com/q/29872725
tags question: http://stackoverflow.com/q/29919772
tags question: http://stackoverflow.com/q/29963129
tags question: http://stackoverflow.com/q/29976442
tag name: promise
tags question: http://stackoverflow.com/q/29947580
tags question: http://stackoverflow.com/q/29909902
tags question: http://stackoverflow.com/q/29904445
type: Tag
tags question: http://stackoverflow.com/q/29960223
tags question: http://stackoverflow.com/q/29948139
tags question: http://stackoverflow.com/q/29973738
tags question: http://stackoverflow.com/q/29965704
tags question: http://stackoverflow.com/q/29956374
tags question: http://stackoverflow.com/q/29880715
tags question: http://stackoverflow.com/q/29858388
tags question: http://stackoverflow.com/q/29942602
tags question: http://stackoverflow.com/q/29925948
tags question: http://stackoverflow.com/q/29949684
tags question: http://stackoverflow.com/q/29853578
tags question: http://stackoverflow.com/q/29995696
tags question: http://stackoverflow.com/q/29869700
tags question: http://stackoverflow.com/q/29977262

http://stackoverflow.com/q/29918372
type: UnansweredQuestion
has title: Unable to copy GridView inside a div via Jquery
type: Question
has body: I am trying to copy the div's content to another div on the click of image. The div contains gridview which I want to copy to another div. When I click on the image it populate gridview via objectdatasource. I tried the following code: var innerHtml = $("#innerGrids")[0].innerHTML; $("#" + divname).html(innerHtml); This code copy grid's html inside div but without the data. I think the problem is as soon as I click, it copy the contents but does not wait for data to load in grid. How can I achieve this?
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/47958706
tagged with: jquery
tagged with: asp.net
has comment: http://stackoverflow.com/comment/47957917
has comment: http://stackoverflow.com/comment/47958119
answer count: 0

http://stackoverflow.com/comment/47926091
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29901544
has text: so what wrong with __.groupBy_?
score: 0

http://stackoverflow.com/comment/48120167
score: 0
comment on: http://stackoverflow.com/a/30000286
type: Comment
has text: Now to make the slider responsive.. I guess to make the slider value responsive and actually update the canvas animation, I would somehow need to use js to tell the canvas to re-draw every time the slider value is changed. Any tips for how to have a crack at this?
type: AnswerComment

http://stackoverflow.com/comment/48050714
has text: Have you tried `input:-webkit-autofill { color: pink !important; }` ?
score: 0
comment on: http://stackoverflow.com/a/29965351
type: AnswerComment
type: Comment

http://stackoverflow.com/a/29894243
has comment: http://stackoverflow.com/comment/47913813
has comment: http://stackoverflow.com/comment/47911972
has comment: http://stackoverflow.com/comment/47913376
upvote count: 1
has comment: http://stackoverflow.com/comment/47911341
answers question: http://stackoverflow.com/q/29894158
score: 0
has comment: http://stackoverflow.com/comment/47913656
downvote count: 1
type: Answer
has comment: http://stackoverflow.com/comment/47911462
has comment: http://stackoverflow.com/comment/47914450
has comment: http://stackoverflow.com/comment/47912655
has body: You are setting a number when you should set a dimension. var viewportHeight = $(window).height(); Will return a number let's say it returns 42 But when you set a css property you cannot set just a number, you need to set a dimension like 42px. So just try this way: $('#about').css( "margin-top" , viewportHeight + 'px' ); This is also why you don't get any JS error, the JS is basically correct, the problem is in the CSS property and when a css property is wrong is just ignored by the browser. Vanilla JS I don't usually use jQuery so if this doesn't solve the problem I would recommend to let jQuery be and use plain Javascript (easier and faster). document.getElementById('about').style.marginTop = viewportHeight + 'px';
has comment: http://stackoverflow.com/comment/47913969
has comment: http://stackoverflow.com/comment/47913496

http://stackoverflow.com/q/29886119
tagged with: jquery
favorite count: 0
has title: Making iframe trasparent doesn't work
has comment: http://stackoverflow.com/comment/47896352
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
score: 2
answer count: 0
downvote count: 0
type: Question
has comment: http://stackoverflow.com/comment/47900045
tagged with: javascript
upvote count: 2
tagged with: html5-canvas
has body: I have added an iframe on a client page. test.html page uses a canvas to draw shapes on it, which is acting as an overlay on the client page. once the drawing is done and when the user clicks on "Send" button I need to capture a screen shot. I'm using canvas.toDataURL("image/png"); to get the image it captures the image successfully but the underneeth parent page content is invisible. I tried making the iframe transparent too but couldn't get it to work

http://stackoverflow.com/comment/48028468
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29953846
has text: What do you mean is blank? I see two objects in there.
type: Comment

http://stackoverflow.com/q/29880715
has comment: http://stackoverflow.com/comment/47886984
has answer: http://stackoverflow.com/a/29881059
favorite count: 0
tagged with: promise
score: 64
has answer: http://stackoverflow.com/a/29881036
downvote count: 2
has comment: http://stackoverflow.com/comment/91256702
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/45429048
has answer: http://stackoverflow.com/a/29906506
type: Question
has answer: http://stackoverflow.com/a/79058192
has answer: http://stackoverflow.com/a/53547675
tagged with: javascript
has comment: http://stackoverflow.com/comment/47886791
has body: I have an array of promise objects that must be resolved in the same sequence in which they are listed in the array, i.e. we cannot attempt resolving an element till the previous one has been resolved (as method Promise.all([...]) does). And if one element is rejected, I need the chain to reject at once, without attempting to resolve the following element. How can I implement this, or is there an existing implementation for such sequence pattern? function sequence(arr) { return new Promise(function (resolve, reject) { // try resolving all elements in 'arr', // but strictly one after another; }); } EDIT The initial answers suggest we can only sequence results of such array elements, not their execution, because it is predefined in such example. But then how to generate an array of promises in such a way as to avoid early execution? Here's a modified example: function sequence(nextPromise) { // while nextPromise() creates and returns another promise, // continue resolving it; } I wouldn't want to make it into a separate question, because I believe it is part of the same problem. SOLUTION Some answers below and discussions that followed went a bit astray, but the eventual solution that did exactly what I was looking for was implemented within spex library, as method sequence. The method can iterate through a sequence of dynamic length, and create promises as required by the business logic of your application. Later on I turned it into a shared library for everyone to use.
upvote count: 66
has title: How to synchronize a sequence of promises?
has comment: http://stackoverflow.com/comment/47893861
has answer: http://stackoverflow.com/a/52153179
accepted answer: http://stackoverflow.com/a/29906506
has comment: http://stackoverflow.com/comment/47893767
possible better answer: http://stackoverflow.com/a/29881059
answer count: 7

http://stackoverflow.com/q/29906775
has comment: http://stackoverflow.com/comment/47936707
score: 2
type: AnsweredQuestion
tagged with: database-security
has answer: http://stackoverflow.com/a/29956236
upvote count: 2
has answer: http://stackoverflow.com/a/29906931
has body: Considering issues like CSRF, XSS, SQL Injection... Site: ASP.net, SQL Server 2012 I'm reading a somewhat old page from MS: https://msdn.microsoft.com/en-us/library/ff649310.aspx#paght000004_step4 If I have a parametrized query, and one of my fields is for holding HTML, would a simple replace on certain tags do the trick? For example, a user can type into a WYSIWYG textarea, make certain things bold, or create bullets, etc. I want to be able to display the results from a SELECT query, so even if I HTMLEncoded it, it'll have to be HTMLDecoded. What about a UDF that cycles through a list of scenarios? I'm curious as to the best way to deal with the seemingly sneaky ones mentioned on that page: Quote: An attacker can use HTML attributes such as src, lowsrc, style, and href in conjunction with the preceding tags to inject cross-site scripting. For example, the src attribute of the tag can be a source of injection, as shown in the following examples. &lt;img src="javascript:alert('hello');"&gt; &lt;img src="java&amp;#010;script:alert('hello');"&gt; &lt;img src="java&amp;#X0A;script:alert('hello');"&gt; An attacker can also use the &lt;style&gt; tag to inject a script by changing the MIME type as shown in the following. &lt;style TYPE="text/javascript"&gt; alert('hello'); &lt;/style&gt; So ultimately two questions: Best way to deal with this from within the INSERT statement itself. Best way to deal with this from code-behind.
type: Question
accepted answer: http://stackoverflow.com/a/29906931
possible better answer: http://stackoverflow.com/a/29916534
has answer: http://stackoverflow.com/a/29916534
downvote count: 0
has title: What HTML tags would be considered dangerous if stored in SQL Server?
tagged with: javascript
tagged with: asp.net
favorite count: 0
tagged with: sql-server
tagged with: security
has comment: http://stackoverflow.com/comment/47936527
answer count: 4
has answer: http://stackoverflow.com/a/72202176

java
tags question: http://stackoverflow.com/q/29880224
tags question: http://stackoverflow.com/q/29916053
tags question: http://stackoverflow.com/q/29978082
tags question: http://stackoverflow.com/q/29960988
tags question: http://stackoverflow.com/q/29913521
tags question: http://stackoverflow.com/q/29927385
tags question: http://stackoverflow.com/q/29896633
tags question: http://stackoverflow.com/q/29888884
tags question: http://stackoverflow.com/q/29885532
tags question: http://stackoverflow.com/q/29895541
tags question: http://stackoverflow.com/q/29973786
tags question: http://stackoverflow.com/q/29891370
tags question: http://stackoverflow.com/q/29855130
tags question: http://stackoverflow.com/q/29879562
tags question: http://stackoverflow.com/q/29982185
tags question: http://stackoverflow.com/q/29982130
tags question: http://stackoverflow.com/q/29906057
tags question: http://stackoverflow.com/q/29891360
tags question: http://stackoverflow.com/q/29859880
tags question: http://stackoverflow.com/q/29937744
tags question: http://stackoverflow.com/q/29922908
tags question: http://stackoverflow.com/q/29990528
tags question: http://stackoverflow.com/q/29997227
tags question: http://stackoverflow.com/q/29926774
tags question: http://stackoverflow.com/q/29976359
tags question: http://stackoverflow.com/q/29956526
tags question: http://stackoverflow.com/q/29875532
tags question: http://stackoverflow.com/q/29897554
tags question: http://stackoverflow.com/q/29965085
tags question: http://stackoverflow.com/q/29959708
tags question: http://stackoverflow.com/q/29901405
tag name: java
tags question: http://stackoverflow.com/q/29916224
tags question: http://stackoverflow.com/q/29858927
tags question: http://stackoverflow.com/q/29897444
tags question: http://stackoverflow.com/q/29856986
tags question: http://stackoverflow.com/q/29998272
tags question: http://stackoverflow.com/q/29874970
tags question: http://stackoverflow.com/q/29877299
tags question: http://stackoverflow.com/q/29887626
tags question: http://stackoverflow.com/q/29960172
tags question: http://stackoverflow.com/q/29966347
type: Tag
tags question: http://stackoverflow.com/q/29863644
tags question: http://stackoverflow.com/q/29998346
tags question: http://stackoverflow.com/q/29998231
tags question: http://stackoverflow.com/q/29942165
tags question: http://stackoverflow.com/q/29986245
tags question: http://stackoverflow.com/q/29984277
tags question: http://stackoverflow.com/q/29913454

http://stackoverflow.com/q/29854050
has comment: http://stackoverflow.com/comment/47834315
has answer: http://stackoverflow.com/a/29854116
has title: AJAX call reloads the current page
tagged with: http://stackoverflow.com/tag/html
answer count: 4
type: AnsweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/47834413
type: Question
has comment: http://stackoverflow.com/comment/47834037
has answer: http://stackoverflow.com/a/29854132
has body: I am trying to update a div with information received from a server periodically. The code below will receive the correct information from the server, append it to the divs text, then reload the page/clear out the div. <?php session_start(); ?> Managers DHTs How can I get this to simply append the result of the ajax call to the divs text, instead of clearing it completely?
possible better answer: http://stackoverflow.com/a/29854116
tagged with: javascript
has comment: http://stackoverflow.com/comment/47834527
has answer: http://stackoverflow.com/a/29854098
accepted answer: http://stackoverflow.com/a/29854098
upvote count: 1
downvote count: 0
favorite count: 0
tagged with: ajax
has answer: http://stackoverflow.com/a/29854120

http://stackoverflow.com/a/29845343
answers question: http://stackoverflow.com/q/29845295
downvote count: 0
score: 1
has body: ID is unique identificator. You should have only one unique ID in your HTML. That means, you don't need to put there array identificator. Do it like this: var right = $('#true').attr('checked');
upvote count: 1
type: Answer

kendo-combobox
tag name: kendo-combobox
tags question: http://stackoverflow.com/q/29973184
type: Tag

http://stackoverflow.com/comment/47911581
score: 0
has text: @VigneswaranMarimuthu https://jsfiddle.net/s4fqeshf/1/
type: AnswerComment
comment on: http://stackoverflow.com/a/29893756
type: Comment

http://stackoverflow.com/q/29947534
favorite count: 0
tagged with: backbone.js
has answer: http://stackoverflow.com/a/29947762
has title: Click on "this" in a backbone view
tagged with: events
has body: I am a newbie with backbone and i have a little problem with it events system. I have a view who represents an li element, and i want to do something when i click on it. Here is my code : var IndicatorView = Backbone.View.extend({ tagName: 'li', className: 'indicator', initialize: function(options){ _.extend(this, _.pick(options, "controller")); this.model.on('change', this.render, this); var self=this ; this.$el.on("click", function(){ alert(self.model.get('name')); }) }, render: function(){ this.$el.html(this.model.get('name')); return this; // enable chained calls } }); For the moment, it works, but using jQuery events. How can I do the same thing with backbone events ? Thanks for your answers :)
type: AnsweredQuestion
score: 1
upvote count: 1
type: Question
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29947762
downvote count: 0
answer count: 1
tagged with: jquery

http://stackoverflow.com/q/29984943
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: php
type: Question
has title: How do I run a remote PHP script then follow a link from HTML page
tagged with: javascript
has answer: http://stackoverflow.com/a/29985063
has body: ****THIS IS AN UPDATE!!! ORIGINAL POST IS DOWN BELOW.**** From the answers provided I've now changed the code a little. Now I have this.... And this is my onclick command in my link. click here This code follows the link but it does not run the code. However, if I change the href to href="#" it does run the code, but not follow the link. So the same as before!!! The suggestion given in one of the answers is to have the redirect inside the function. But this is code that is going into other peoples websites. So the onclick to activate the function could be on a form submit button, or a link, or an image or on whatever they want to track and I don't know the URL they are linking to with the click (They might not want to link to a URL at all!) Is there any way I can tweak this code so that it forces the $.get command to run the PHP script before it triggers the link? I thought that this happened automatically using an onclick inside a link. I've also tried $.post in place of $.get but that's not working either. Thanks for your help ****ORIGINAL POST BELOW HERE****** The script I need to run is a PHP script on another server. I do not need any information back from the script at all, I just need it to run when a person clicks on a link, then to follow the link. This code is not for my own site, I am providing it to members, so the page must be basic HTML code, I know I can do this from a PHP page but I need it to work from HTML and Javascript. What I'm doing now... At the moment I'm using innerHTML to change a DIV tag inside a javascript function like this... function runScript() { document.getElementById('thetrigger').innerHTML = " "; } With this DIV tag on the page.... I am using an onclick command to trigger the function like this... click here to order What I've tried... If I run the script without the link the PHP executes fine, so I know the PHP is all OK If I add 'return false' into the link the PHP works as I would expect it to I have tried various combinations …
score: 0
answer count: 2
tagged with: jquery
tagged with: ajax
has answer: http://stackoverflow.com/a/29985143

http://stackoverflow.com/a/29871634
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/29871615
type: Answer
has body: Do it this way: function editChannel(channelId, parentForm) { $("#formId").submit(function(event) { event.preventDefault(); $.ajax({ url: '/Channel/EditChannel/', type: "POST", cache: false, data: { id: channelId, updatedModel: parentForm }, success: function (msg) { alert("Msg: " + msg); if (msg === "ChangeOfSensitiveData") { showAlertOnChangeOfSensitiveData('sensitivDataMsgDiv'); } else { alert("Else"); } }, error: function (msg) { showDialog('errorDiv'); } }); }); }
upvote count: 1
score: 1
accepted answer of: http://stackoverflow.com/q/29871615

http://stackoverflow.com/a/29893684
has comment: http://stackoverflow.com/comment/47929644
has body: &lt;asp:Button ... OnClientClick='AddToCart(\"&lt;%#Eval("ProductID") %&gt;\", \"&lt;%#Eval("ProductName") %&gt;\");return false;'/&gt; You can pass values as parameters to your js function.
downvote count: 0
has comment: http://stackoverflow.com/comment/47943727
upvote count: 2
type: Answer
answers question: http://stackoverflow.com/q/29893242
score: 2

http://stackoverflow.com/q/29865021
has comment: http://stackoverflow.com/comment/47856011
has answer: http://stackoverflow.com/a/29865221
has comment: http://stackoverflow.com/comment/47855175
has comment: http://stackoverflow.com/comment/47855149
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/47855205
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47855197
has comment: http://stackoverflow.com/comment/47855112
tagged with: php
has comment: http://stackoverflow.com/comment/47855630
has comment: http://stackoverflow.com/comment/47855066
tagged with: mysql
has title: Check Username in Registration form
upvote count: 1
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/47855191
has body: In the following code, I want the username to be checked if it's available or not before submiting the form. I used onchange() event with the username field. HTML Code: Reset function check_ava() { var username = document.getElementById('username').value; $.post("check_username.php", { username: username }, function(result){ if (result == 1) { document.getElementById('ava_result').innerHTML = "Username is available"; document.getElementById('submit').disabled = false; } else { document.getElementById('ava_result').innerHTML = "Username is not available"; document.getElementById('submit').disabled = true; } }); } <?php include 'DBConnection.php'; $username = mysql_real_escape_string($_POST['username']); $result = mysql_query('select Name from User where Name = "'. $username .'"'); if (mysql_num_rows($result) > 0) { echo 0; } else { echo 1; } ?> The problem is that it is not working and not checking the username.
tagged with: javascript

http://stackoverflow.com/comment/47864504
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/29855739
type: Comment
has text: If remitter column is removed, the issue does not occur. It looks like jquery ui autocomplete changes row height. How to fix this so that row height is not changed by autocomplete if inline edit starts ?

http://stackoverflow.com/comment/47938515
type: AnswerComment
comment on: http://stackoverflow.com/a/29907876
type: Comment
score: 1
has text: Because I don't have access to your full code base, and I don't know exactly what you are trying to do. You didn't include enough details that I could see for me to write the correct code there. You should change that line to whatever makes sense.

http://stackoverflow.com/comment/48018794
type: Comment
type: QuestionComment
has text: Can you try the code I put in the answer? The ThrowProps plugin requires a license so I can't try for myself.
comment on: http://stackoverflow.com/q/29927709
score: 0

http://stackoverflow.com/comment/48010855
has text: It seems wrong that the intermediate code example calls the constructor with no arguments: `var myTestData = new TestData();` if this passed arguments, wouldn't the Closure compiler keep the constructor?
comment on: http://stackoverflow.com/q/29944248
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29965115
has answer: http://stackoverflow.com/a/29992694
tagged with: push-notification
tagged with: cordova
tagged with: angularjs
linked to: http://stackoverflow.com/q/16689092
accepted answer: http://stackoverflow.com/a/30455153
type: AnsweredQuestion
has title: Cordova PushNotification onNotificationGCM is not called
type: Question
has body: I am doing pushnotification for both Android/IOS. I have used a cordova push-plugin https://github.com/phonegap-build/PushPlugin, it seems to work great. Info : I'm on a AngularJS project. In my NotificationHelper factory i have this init method: helper.init = function() { // Instanciate push plugin notification var pushNotification = window.plugins.pushNotification; var errorHandler = function(error) { logger.debug('errorHandler = ' + error); }; if ($rootScope.isAndroid()) { var senderId = CONFIG.NOTIFICATION_ANDROID_SENDER_ID; pushNotification.register(function(result) { logger.debug('successHandler = ' + result); }, errorHandler, { 'senderID' : senderId, 'ecb' : 'onNotificationGCM' }); } }; I also defined those methods on mains.js : var onNotificationGCM = function(event) { // call back to web service in Angular. var elem = angular.element(document.querySelector('[ng-app]')); var injector = elem.injector(); var service = injector.get('NotificationHelper'); service.onNotificationGCM(event); }; It's a trick to call angularJS factory from main javascript. 'onNotificationGCM' call the 'NotificationHelper.onNotificationGCM' method : helper.onNotificationGCM = function(e) { switch (e.event) { case 'message': // Notification happened while app was in the foreground if (e.foreground) { logger.debug('[notification] [message] Foreground : ' + JSON.stringify(e)); } else { // Notification touched in the notification tray logger.debug('[notification] [message] Background : ' + JSON.stringify(e)); if (e.coldstart) { // App was not running and user clicked on notification } else { // App was running and user clicked on notification } } decriptPayloadNotification(e.payload); break; case 'registered': logger.debug('[notification] [registered] : ' + JSON.stringify(e)); if (e.regid.length &gt; 0) { registerUser(e.regid, 'gcm'); } break; case 'error': logger.debug('[notification] [error] : ' + JSON.stringify(e)); break; default: logger.debug('[notification] [default] : Unknown, an e…
tagged with: javascript
has answer: http://stackoverflow.com/a/30455153
possible better answer: http://stackoverflow.com/a/29992694
score: 0
answer count: 2
tagged with: phonegap-pushplugin

http://stackoverflow.com/a/29980143
upvote count: 1
downvote count: 0
answers question: http://stackoverflow.com/q/29980113
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29980113
has body: Try removing the line: position: ['center'], If you check the docs you would see that you are not using the correct format; position needs to be an object. If you wanted to be centered (which is default), you would use something like: { my: "center", at: "center", of: window } However since that's the default you should be able to just omit it.
type: Answer
score: 1

http://stackoverflow.com/a/60950988
has body: In my case th and td , count is not equal due do colspan, removed colspan and it worked.
answers question: http://stackoverflow.com/q/29893207
type: Answer
downvote count: 0
score: 1
upvote count: 1

http://stackoverflow.com/comment/47975304
has text: What do you expect to get? Why?
comment on: http://stackoverflow.com/q/29926774
type: Comment
type: QuestionComment
score: 2

http://stackoverflow.com/a/29958575
score: 1
upvote count: 1
accepted answer of: http://stackoverflow.com/q/29958154
has body: Its seems you don't want to do google. BTW I faced the same problem you are facing now. I did google for the same and finally i reached on scotch.io and bennadel.com that helps me a lot. Hope these are also helpfull for you. scotch.io Bannadel Thinking in angularjs Learn angularjs free 10 angular js patterns How data binding works in angular js
answers question: http://stackoverflow.com/q/29958154
type: AcceptedAnswer
downvote count: 0
type: Answer

http://stackoverflow.com/comment/48039792
type: AnswerComment
has text: hmm...I had exactly this in my mind, and as per this understanding the output order should have been like: #End 'main.js' #Event file 'open' #Event custom 'tick' ......main.js should have been first line, and custom tick should have been last...correct me if I'm wrong...
type: Comment
score: 0
comment on: http://stackoverflow.com/a/29959403

http://stackoverflow.com/comment/47908558
type: Comment
type: QuestionComment
has text: In your example you should use `scan` instead of diff and maintain the max id that has come through: if results come in order [r3, r1, r2], the wrong thing will go through.
score: 0
comment on: http://stackoverflow.com/q/29850928

http://stackoverflow.com/comment/48094573
has text: api is here: https://github.com/kenwheeler/slick. You need the `beforeChange` event probably combined with the `slickPause` method
score: 1
comment on: http://stackoverflow.com/q/29986838
type: Comment
type: QuestionComment

datagridview
tag name: datagridview
type: Tag
tags question: http://stackoverflow.com/q/29943901

http://stackoverflow.com/a/29904783
upvote count: 1
has body: You can probably answer the performance question yourself with performance testing tools. I prefer event listeners because the code reads more cleanly. Bug-wise, I would categorize the lack of a way for the first method to break out of a callback loop if the service is down as a serious bug. It could cause performance degradation if the service is down, that is something to check with performance testing. I don't know whether there is a convention to re-call the method in the error handler, but it seems like an OK way to handle it as long as you have a loop breakout. If the retry max is reached, you might want to alert the user and prompt them that the service call will be attempted again after some arbitrary period. See the way Gmail handles connection interruptions for an example of this behavior. As for jQuery v. not jQuery, it depends on your use case. In a lightweight web page where you are performing minimal JavaScript coding, you might find jQuery to be overkill in terms of the size of the library. On the other hand, jQuery is popular because it papers over browser incompatibilities, letting you, the coder, focus on application functionality. If you load it from a popular CDN, many users may already have it in cache, so load time would not be a factor. As for what people use, jQuery is popular, but beyond that I don't know whether any statistics exist that break down the relative popularity of either method.
accepted answer of: http://stackoverflow.com/q/29904027
has comment: http://stackoverflow.com/comment/47936159
type: AcceptedAnswer
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/29904027
score: 1
has comment: http://stackoverflow.com/comment/47933287

http://stackoverflow.com/comment/48004321
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/29941743
has text: or just `$this.toggleClass('fa-train fa-car')`
score: 0

http://stackoverflow.com/q/29940816
tagged with: jquery
accepted answer: http://stackoverflow.com/a/29941683
tagged with: ember.js
answer count: 1
favorite count: 0
type: AnsweredQuestion
has title: emberjs menu component bubbling
score: 1
upvote count: 1
has answer: http://stackoverflow.com/a/29941683
has body: I have a menu component, which build a tree menu from an array. To toggle the sub menus I do: didInsertElement:function(){ this.$('li.sub').click(function(e){ $('ul', this).slideToggle(); }); } I works fine as long as I click on 'Settings'. If I try to click one of the sub menus ex. 'Currency' It closes the parent menu item. Here is a jsBin to demonstrate the problem: Click on 'Settings' -> then click one of the opened sub items: http://emberjs.jsbin.com/bexivuhohu/6/edit
type: Question
downvote count: 0
tagged with: javascript

http://stackoverflow.com/comment/47929849
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29903600
score: 0
has text: What is the value of volume?

http://stackoverflow.com/q/29947655
has comment: http://stackoverflow.com/comment/48067315
has comment: http://stackoverflow.com/comment/82816787
has comment: http://stackoverflow.com/comment/48017037
score: 1
has title: Moment-Timezone: Retrieve DST start and end times
has comment: http://stackoverflow.com/comment/48184011
type: Question
tagged with: javascript
tagged with: dst
has body: Does moment-timezone support (or has anyone been able to implement) retrieving the start/end times for Daylight Savings Time for a given zone? I'm not looking to determine if a given date/time in a zone is within DST, but rather the actual transition times for the zone. This doesn't seem to be supported, but thought maybe someone had been able to accomplish this.
upvote count: 1
tagged with: momentjs
favorite count: 0
answer count: 0
has comment: http://stackoverflow.com/comment/48084531
downvote count: 0
type: UnansweredQuestion

http://stackoverflow.com/a/29901789
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/29901544
type: Answer
accepted answer of: http://stackoverflow.com/q/29901544
has body: Assuming you want duplicate entries under each tag when an item has multiple tags _.groupBy will not do what you want as it simply splits a collection up (won't duplicate entries). Instead, you will need to loop over your items manually, then each item's tags and build up your list for you (you could use _.each if you wanted): var items = [ {id: 0, tags: ["a"], name: "foo"}, {id: 1, tags: [], name: "bar"}, {id: 2, tags: ["a"], name: "bazz"}, {id: 3, tags: ["b"], name: "wah"}, {id: 4, tags: ["c"], name: "ikr"}, {id: 5, tags: ["a"], name: "wtf"}, {id: 6, tags: ["a","b"], name: "gtg"}, {id: 7, tags: ["c"], name: "afk"} ]; var groupItems = {}; for (var i = 0, item; item = items[i]; i++) { for (var t = 0, tag; tag = item.tags[t]; t++) { // If we do not have an array for our tag, add one groupItems[tag] = groupItems[tag] || []; // Push out item onto the tag's list in our groupItems groupItems[tag].push(item); } } Which will give you: { "a": [ {"id": 0,"tags": ["a"],"name": "foo"}, {"id": 2,"tags": ["a"],"name": "bazz"}, {"id": 5,"tags": ["a"],"name": "wtf"}, {"id": 6,"tags": ["a","b"],"name": "gtg"} ], "b": [ {"id": 3,"tags": ["b"],"name": "wah"}, {"id": 6,"tags": ["a","b"],"name": "gtg"} ], "c": [ {"id": 4,"tags": ["c"],"name": "ikr"}, {"id": 7,"tags": ["c"],"name": "afk"} ] }
upvote count: 1
score: 1

http://stackoverflow.com/a/29924117
answers question: http://stackoverflow.com/q/29912091
type: Answer
has comment: http://stackoverflow.com/comment/47987344
has comment: http://stackoverflow.com/comment/47988359
has body: From the Firebase documentation on anonymous authentication: Each time you login a user anonymously, a new, unique user ID will be generated, and your Firebase reference will be authenticated using these new credentials. So each of the browsers (in your example) becomes a different user.
score: 6
upvote count: 7
downvote count: 1
has comment: http://stackoverflow.com/comment/47987133
has comment: http://stackoverflow.com/comment/73167767
has comment: http://stackoverflow.com/comment/73167734

http://stackoverflow.com/comment/48085904
type: QuestionComment
score: 0
has text: Could you please provide a code example, how you are going to do?
comment on: http://stackoverflow.com/q/29983321
type: Comment

http://stackoverflow.com/q/29846657
upvote count: 1
has body: I am new to AngularJS. I am getting an error while trying to call PUT restful webservices from AngularJS. This is my factory method. .factory('EmployeeService',function($q,$http){ Approval:function(userId,firstName){ var deferred = $q.defer(); $http({ method: 'PUT', url: '/AngularExample/user', params:{ lastName:userId, firstName:firstName } }). success(function (data) { if (data != null || data != 'undefined') { deferred.resolve( data); } }) .error(function (error) { console.log('error'); }); return deferred.promise; }) EmployeeService is my service name $scope.showAlert = function () { EmployeeService.Approval( $stateParams.userId,$stateParams.firstName).then(function (approval) { $scope.approve= approval; }) This is the error getting while calling PUT REST Api call in Java. Angular JS version using :1.3.15 . Rest api call is not triggering from angular to Rest Back end and not getting any error in back End. Error getting in the angular js : unexpected Request PUT No more request expected at $httpBackend (angular-mocks.js:1180) at m (angular.js:9628) at $get.f (angular.js:9344) at angular.js:13189 at l.$get.l.$eval (angular.js:14401) at l.$get.l.$digest (angular.js:14217) at l.$get.l.$apply (angular.js:14506) at HTMLButtonElement.&lt;anonymous&gt; (ionic-angular.js:9958) at HTMLButtonElement.c (angular.js:3014) at triggerMouseEvent (ionic.js:2804) It works in Postman.
type: Question
has comment: http://stackoverflow.com/comment/47818922
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: rest
tagged with: angularjs
has title: PUT/POST Rest api calls not working while trying from AngularJS in Java
has comment: http://stackoverflow.com/comment/47819236
has comment: http://stackoverflow.com/comment/47819237
has answer: http://stackoverflow.com/a/33751069
has comment: http://stackoverflow.com/comment/47819300
type: UnansweredQuestion
score: 1

http://stackoverflow.com/q/29872848
tagged with: http://stackoverflow.com/tag/html
has title: Dynamic Angular.js menu
tagged with: angularjs
tagged with: css
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29872953
type: Question
has comment: http://stackoverflow.com/comment/47870904
answer count: 1
tagged with: javascript
tagged with: jquery
has body: I am trying to build a dynamic menu using anuglar.js and bootstrap. This menu needs to have a dropdown ability. I've gotten the basic menu down but now I'm trying to add a dropdown link and I can't get the options to generate correctly. I have a variable with the menu items like so: var nav = [ { display: 'Home', link: '#/', drop: false, }, { display: 'Categories', link: '#/', drop: true, sub: [ { display: 'Sub 1', link: '#/' }, { display: 'Sub 2', link: '#/' }, { display: 'Sub 3', link: '#/' } ] } ]; I want a dropdown menu to generate of the sub items when drop is true and just a regular menu item when it is false. This is my HTML so far: {{nav.display}} {{sub.display}} {{nav.display}} Right now everything is generating as a normal link.
accepted answer: http://stackoverflow.com/a/29872953
score: 0

http://stackoverflow.com/q/29930188
has title: How do I retrieve a random object from an array of objects ? Javascript
upvote count: 1
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/47982653
has comment: http://stackoverflow.com/comment/47982716
tagged with: javascript
has body: I have this bit of code that adds an image to the 'imageContainer' $('.imageContainer').prepend('&lt;img id="xboxLogo" src="images/xboxLogo.png"/&gt;') I have this array of objects : var imagesArray = { xboxLogo : { id : 'xboxLogo'; src: "images/xboxLogo.png"; }, playStatLogo : { id : 'playStatLogo'; src: "images/playStatLogo.png"; }, wiiLogo : { id : 'wiiLogo'; src: "images/wiiLogo.png"; } } What I want to do is have a function that I call which adds the image to the 'imageContainer' but I want the image to be randomly picked from the 'imagesArray'. How do i randomly get one of the 3 (xbox,playStation,wii) images and then retrieve their attributes so I can use them to create the images ?
score: 0
answer count: 2
tagged with: jquery
linked to: http://stackoverflow.com/q/6274339
has comment: http://stackoverflow.com/comment/47982648
favorite count: 0
has answer: http://stackoverflow.com/a/29930288
has comment: http://stackoverflow.com/comment/48002343
possible better answer: http://stackoverflow.com/a/29930244
has comment: http://stackoverflow.com/comment/47982675
has answer: http://stackoverflow.com/a/29930244
accepted answer: http://stackoverflow.com/a/29930288
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47982659

http://stackoverflow.com/q/29852998
tagged with: client-side
has answer: http://stackoverflow.com/a/43630848
favorite count: 0
has answer: http://stackoverflow.com/a/57716487
has answer: http://stackoverflow.com/a/48977179
has answer: http://stackoverflow.com/a/29869452
has comment: http://stackoverflow.com/comment/47833618
score: 137
tagged with: client-side-scripting
has comment: http://stackoverflow.com/comment/47833717
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/35005474
tagged with: react-router
has comment: http://stackoverflow.com/comment/47833517
has comment: http://stackoverflow.com/comment/47833494
accepted answer: http://stackoverflow.com/a/29869452
type: Question
tagged with: reactjs
has answer: http://stackoverflow.com/a/37981165
downvote count: 0
upvote count: 137
tagged with: javascript
has answer: http://stackoverflow.com/a/36633892
has answer: http://stackoverflow.com/a/50836782
has body: I'm using react and react-router for my application on the client side. I can't seem to figure out how to get the following query parameters from a url like: http://xmen.database/search#/?status=APPROVED&page=1&limit=20 My routes look like this (the path is totally wrong I know): var routes = ( <DefaultRoute handler={SearchDisplay}/> ); My route is working fine but I'm just not sure how to format the path to get the parameters I want. Appreciate any help on this!
has title: Getting query parameters from react-router hash fragment
has answer: http://stackoverflow.com/a/51363129
has answer: http://stackoverflow.com/a/73099289
possible better answer: http://stackoverflow.com/a/43630848
answer count: 10

http://stackoverflow.com/q/29897540
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has title: Angular JS page not found using http-server
has comment: http://stackoverflow.com/comment/47918946
has comment: http://stackoverflow.com/comment/47922329
tagged with: httpserver
has comment: http://stackoverflow.com/comment/47920567
has comment: http://stackoverflow.com/comment/47922066
type: Question
has answer: http://stackoverflow.com/a/29908844
tagged with: javascript
has comment: http://stackoverflow.com/comment/47922298
has answer: http://stackoverflow.com/a/29899027
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/47917815
has body: I have a simple angular app with a directory structure that looks like the following: -lpbm -shared - js - css -public app.js index.html I run http-server within the lpbm folder which creates http://localhost:8080 I then try to access http://localhost:8080/public/index.html but i get a blank page and the following error in my terminal window: "GET /public/index.html" Error (404): "not found" This was working before, and something random must be stopping it from working correctly, as the directory and url structure are correct. I've tried removing all my custom files other than my index.html and app.js which are below index.html: Cheapest Fares Our cheapest fares from London app.js: angular.module('app', ['ngMessages', 'ngMessageFormat', 'ngRoute', 'ngAnimate']) .controller('AppController', function() { console.log('working?'); }) Is there any obvious reason this is not working? if i open up a test angular app and do the same http-server process it works, suggesting it is something wrong with my app.js or index.html but i can't spot what, i've literally removed everything and it still refuses to load.
has comment: http://stackoverflow.com/comment/47921993
tagged with: angularjs
has comment: http://stackoverflow.com/comment/47918859

http://stackoverflow.com/a/29973517
has body: I have determined here that the problem resides in using height(), when I should actually be using innerHeight() here because of the padding that I am also applying in the same line. jQuery's height() is initially applying the height of the element and ignoring the padding because height() does not include padding. jQuery's innerHeight() includes padding and can accept the CSS that's being applied in the same line. UPDATE: I have recently become aware of imagesloaded.js and this shaves some time off of the window.load time, also removing the opportunity for page elements to be jumping around due to images rendering.
score: 2
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29971322
answers question: http://stackoverflow.com/q/29971322
upvote count: 2
has comment: http://stackoverflow.com/comment/48066991
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/q/29869961
score: -1
possible better answer: http://stackoverflow.com/a/29869994
has body: I am trying to check an HTML input form to see if it contains an @ symbol. HTML: Javascript: var at = document.getElementById("emailCheck").value.indexOf("@"); function continuePlease() { if (at == -1) { document.getElementById("invalidEmail").innerHTML = "Please enter a valid email."; } else { changeData(); } } function changeData() { document.getElementById("title").innerHTML = " Information Confirmed "; document.getElementById("lock").innerHTML = "This Account is now locked."; document.getElementById("time").innerHTML = " You will have 30 minutes to send the provided wallet address the correct amount of Bitcoin or the account will unlock again. "; document.getElementById("daemon").innerHTML = " Our Bit-Daemon is watching the address 24/7, once a payment is made, the contents of the account will be sent to your Email. Thanks, Paypal Trader."; document.getElementById("pig").innerHTML = ""; document.getElementById("cow").innerHTML = ""; document.getElementById("invalidEmail").innerHTML = "Please enter a valid email."; } What's happening is that when it performs the function continuePlease() it does both the code in the IF and in the ELSE. It should do one or the other, not both. I think I need a better way to check for the @ symbol.
answer count: 3
tagged with: function
tagged with: email
downvote count: 1
has answer: http://stackoverflow.com/a/29870171
favorite count: 0
accepted answer: http://stackoverflow.com/a/29870053
tagged with: http://stackoverflow.com/tag/html
tagged with: input
has answer: http://stackoverflow.com/a/29869994
type: AnsweredQuestion
upvote count: 0
has answer: http://stackoverflow.com/a/29870053
type: Question
has title: Javascript checking @ in email
tagged with: javascript

http://stackoverflow.com/a/29939445
upvote count: 2
has body: The error you got is a PHP one but you are writing Javascript (with jQuery). Your Javascript code need to be placed inside &lt;script&gt;&lt;/script&gt; tag on a HTML file or directly on a js file included in your HTML file. Maybe if you have HTML and PHP on same file, you forgot a PHP closing tag ?&gt; before starting to write your JS code. Moreover, be careful, you have a placeholder that will also cause an error on this line : $('#editor_form').sho`enter code here`w();
answers question: http://stackoverflow.com/q/29939286
downvote count: 0
type: Answer
score: 2

http://stackoverflow.com/a/29991883
downvote count: 0
has comment: http://stackoverflow.com/comment/48104368
answers question: http://stackoverflow.com/q/29991518
has comment: http://stackoverflow.com/comment/48117914
has comment: http://stackoverflow.com/comment/48104902
has body: http://jsfiddle.net/5DMjt/1257/ function ClickToEditCtrl($scope) { $scope.check = "yes"; } Link your code to a controller that contains the value you are putting in your model. Go back and read angular docs before you start trying out.
type: Answer
has comment: http://stackoverflow.com/comment/48104792
score: 1
upvote count: 1

http://stackoverflow.com/comment/47875971
has text: I've added an example
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29870784

http://stackoverflow.com/q/29928425
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29928621
upvote count: 1
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/29929909
has answer: http://stackoverflow.com/a/29928470
has comment: http://stackoverflow.com/comment/47978821
tagged with: javascript
has answer: http://stackoverflow.com/a/29928492
score: 0
possible better answer: http://stackoverflow.com/a/29928492
has answer: http://stackoverflow.com/a/29928621
has comment: http://stackoverflow.com/comment/47979119
favorite count: 0
has body: I'm trying to get the image to change based on one second timer, but the image stays one the first object in the array the code I have so far is Lab 8 - Jackhammer Man The issue I'm coming across is the mouseover event will not activate, I am having trouble finding the error in my code as the debuggers I have aren't finding any. Any help trying to get the mouseover function of the image changing ever so often would be appreciated.
has comment: http://stackoverflow.com/comment/47978890
has title: Jackhammers not changing on mouseover
answer count: 4

mentionsinput.js
tag name: mentionsinput.js
tags question: http://stackoverflow.com/q/29849729
type: Tag

http://stackoverflow.com/comment/47992145
score: 1
has text: PS: the deferred is used to transform asynchronized code into promise. So the method must return the promise object, which will be resolved "later", in the asynchronized pieces of code it contains.
type: AnswerComment
comment on: http://stackoverflow.com/a/29935044
type: Comment

ember.js
tags question: http://stackoverflow.com/q/29979960
tags question: http://stackoverflow.com/q/29920107
tags question: http://stackoverflow.com/q/29962978
tags question: http://stackoverflow.com/q/29886720
tags question: http://stackoverflow.com/q/29962447
tags question: http://stackoverflow.com/q/29958076
tags question: http://stackoverflow.com/q/29969980
tags question: http://stackoverflow.com/q/29940816
type: Tag
tags question: http://stackoverflow.com/q/29877438
tag name: ember.js
tags question: http://stackoverflow.com/q/29875441
tags question: http://stackoverflow.com/q/29977192
tags question: http://stackoverflow.com/q/29950686
tags question: http://stackoverflow.com/q/29962898
tags question: http://stackoverflow.com/q/29872412
tags question: http://stackoverflow.com/q/29979564
tags question: http://stackoverflow.com/q/29971131
tags question: http://stackoverflow.com/q/29956364
tags question: http://stackoverflow.com/q/29966629
tags question: http://stackoverflow.com/q/29978357
tags question: http://stackoverflow.com/q/29947680
tags question: http://stackoverflow.com/q/29951458
tags question: http://stackoverflow.com/q/29903327
tags question: http://stackoverflow.com/q/29929514
tags question: http://stackoverflow.com/q/29895762
tags question: http://stackoverflow.com/q/29983765
tags question: http://stackoverflow.com/q/29860575
tags question: http://stackoverflow.com/q/29961150
tags question: http://stackoverflow.com/q/29916573

http://stackoverflow.com/q/29998657
answer count: 2
has answer: http://stackoverflow.com/a/29998676
tagged with: javascript
has comment: http://stackoverflow.com/comment/48116912
tagged with: jscript
accepted answer: http://stackoverflow.com/a/29998724
score: 0
possible better answer: http://stackoverflow.com/a/29998676
has title: SyntaxError in Code
has comment: http://stackoverflow.com/comment/48116695
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29998724
has body: Here in my code I'm getting SyntaxError: missing : after property id at var ShipVal = $('#rdshiptype').val(); $('.card_number').click(function () { $('#shippingadd').validate({ //alert("hello");return false; var ShipVal = $('#rdshiptype').val(); if(ShipVal == '0_0' || ShipVal == '' ) { $.bootstrapGrowl(SHIPPING_METHOD_REQUIRED, {type: 'danger', 'delay': 3000}); $('#rdshiptype').parent('div').addClass('has-error'); $('#rdshiptype').focus(); $("#BtnNext").button('reset'); return false; } else { $('#rdshiptype').parent('div').removeClass('has-error'); } $("#BtnNext").button('loading'); }); });
type: Question

http://stackoverflow.com/q/29943717
type: AnsweredQuestion
duplicate of: http://stackoverflow.com/q/28744753
has body: In the case I have a code structure as follows : Thing.prototype = { doSomething: function() { $(selector).click(this.handleClick.bind(null, this)); }, handleClick: function(self, event) { console.log(this); //Window console.log(self); //Thing } } How could one bind the Thing this context to the self argument and still keep the behavior of the this object as if no arguments were bound using the bind method? Note : I know I can bind this and use e.originalEvent.target to get the behaviour I want but I'm just curious if there is another way I hope I'm getting through with what I want to achieve, leave a comment if something is ambiguous.
has comment: http://stackoverflow.com/comment/48008342
accepted answer: http://stackoverflow.com/a/29943762
type: Question
tagged with: javascript
tagged with: jquery
has title: Bind this argument to named argument
tagged with: prototype
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/29943762
linked to: http://stackoverflow.com/q/28744753

http://stackoverflow.com/comment/48114456
score: 0
comment on: http://stackoverflow.com/q/29944695
type: QuestionComment
type: Comment
has text: @slicedtoad, the last one I think.

http://stackoverflow.com/q/29936669
tagged with: cordova
type: UnansweredQuestion
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/29937529
score: 1
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
has title: Need exact location of deviceready() in cordova.js
has body: The below code returns me the cordova object. By using the object I am accessing cordava.js &lt;script&gt; function onLoad() document.addEventListener("deviceready", onDeviceReady(cordova), false); &lt;/script&gt; Now my query is, from the eventlistener it calls deviceready function. I am asking here where is deviceready function definition. Where can i find this.

http://stackoverflow.com/comment/47820845
type: Comment
type: QuestionComment
has text: Works fine for me, too, here the plunk: http://plnkr.co/edit/HyLVxGU0qkvq16uohrPK?p=preview
score: 0
comment on: http://stackoverflow.com/q/29847282

http://stackoverflow.com/comment/48075841
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/29977956
type: Comment
has text: Try them both and see which one is faster.

http://stackoverflow.com/comment/47904452
type: QuestionComment
has text: Can you please add your HTML output?
type: Comment
score: 2
comment on: http://stackoverflow.com/q/29890505

http://stackoverflow.com/q/29921031
answer count: 2
downvote count: 0
tagged with: javascript
linked to: http://stackoverflow.com/q/7486085
has answer: http://stackoverflow.com/a/29921331
has body: I'm developing a game (tic tac toe) it has multiplayer feature using nodeJS, also the problem is not the game, the problem is handling different rooms... Im using socket.join etc, so user can join different room; to join different games also boards i pass through url game name, example: localhost?gameId=test Then i parse this name and start sending board to these users. Also the problem is, when i have more then one more, the game collapses, also the board info from room 1 collapse with room 2... i cant find the error, i paste the code here: Create.html jsfiddle.net/svaae1vL/ Enter.html jsfiddle.net/6qzbpbxx/ Server.js jsfiddle.net/1q0qo8xo/ Like i sayd before, the problem is: room1: player1, player2 room2: player3, player4 room1: [x,o,x] [0, 0, 0] [x,x,x] room2: [x,o,x] [0, 0, 0] [x,x,x] Also when i click in room1, it affects room2, please help im stuck since days...
tagged with: http://stackoverflow.com/tag/html
score: 8
favorite count: 0
upvote count: 8
accepted answer: http://stackoverflow.com/a/29921331
tagged with: node.js
has answer: http://stackoverflow.com/a/29921706
type: AnsweredQuestion
has title: NodeJS Tic Tac Toe multiplayer Game
possible better answer: http://stackoverflow.com/a/29921706
type: Question

http://stackoverflow.com/q/29986731
has answer: http://stackoverflow.com/a/29986768
has title: Jquery on click not working very weird
has comment: http://stackoverflow.com/comment/48092784
has answer: http://stackoverflow.com/a/29986810
has comment: http://stackoverflow.com/comment/48093203
favorite count: 0
type: UnansweredQuestion
downvote count: 2
tagged with: php
has answer: http://stackoverflow.com/a/29987019
has comment: http://stackoverflow.com/comment/48092731
answer count: 4
upvote count: 0
has comment: http://stackoverflow.com/comment/48092773
has answer: http://stackoverflow.com/a/29987036
has comment: http://stackoverflow.com/comment/48092649
has comment: http://stackoverflow.com/comment/48092644
type: Question
has comment: http://stackoverflow.com/comment/48094382
linked to: http://stackoverflow.com/q/203198
has body: My sourcecode : Gets transformed for design to the below code : (when i view the page in my browser) Problem : I can not get my Jquery functions working for the checkbox. If the checkbox is clicked I want to show / hide another box. Code Jquery : $(".eanvoera5").on('click', function() { alert('hitest'); } Its driving me crazy.. Somebody has an idea ?
has comment: http://stackoverflow.com/comment/48092664
score: -2
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/a/29883365
downvote count: 0
answers question: http://stackoverflow.com/q/29883329
has comment: http://stackoverflow.com/comment/47890729
has body: JQuery uses $(window).width(). It's a function, not a property.
upvote count: 2
type: Answer
has comment: http://stackoverflow.com/comment/47890709
score: 2

http://stackoverflow.com/a/29922080
accepted answer of: http://stackoverflow.com/q/29921774
answers question: http://stackoverflow.com/q/29921774
type: Answer
upvote count: 3
has comment: http://stackoverflow.com/comment/47972078
has body: You could create an array of the properties you want to display from the object and loop over them like this: var arr = ['brand', 'model', 'network', 'mins'] for (i = 0; i &lt; arr.length; i++) { //Upercase first letter var label = arr[i].charAt(0).toUpperCase() + arr[i].slice(1); //create html elements var li = document.createElement("li"), text = document.createTextNode(label + ": " + cont[i][arr[i]]); li.appendChild(text); ulCont.appendChild(li); } //append to body after loop body.appendChild(ulCont);
has comment: http://stackoverflow.com/comment/47969627
score: 3
has comment: http://stackoverflow.com/comment/47968900
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/29855113
score: 0
answer count: 1
tagged with: c#
tagged with: asp.net-mvc
type: UnansweredQuestion
tagged with: kendo-grid
has answer: http://stackoverflow.com/a/29855407
tagged with: javascript
tagged with: kendo-ui
has title: How can I get the model data from my event sender data for specific selected row?
type: Question
has body: In my kendo grid, I have this Event attached: .Events(events =&gt; events.DataBound("Planning.reSelectMeasurements('#=Label#')")) From kendo grid: @(Html.Kendo().Grid&lt;PlanningViewParam&gt;().Name("Planning") .ClientRowTemplate( // INSERT HTML AND JS HERE ) .DataSource(datasource =&gt; datasource.Ajax().Batch(false) .ServerOperation(false) .Read(read =&gt; read.Action("ReadMeasurements", "Planning", new { viewType = "A" })) .Model(model =&gt; { model.Id(p =&gt; p.Order); model.Field(p =&gt; p.Label).Editable(false); model.Field(p =&gt; p.Color).Editable(false); })).Pageable(p=&gt;p.Enabled(false)) .HtmlAttributes(new { style = "height:202px; width:225px;",@class = "light-list-box"}) .Scrollable(scrollable =&gt; scrollable.Height(100).Virtual(false)) .Selectable(selectable =&gt; selectable .Mode(GridSelectionMode.Single) .Type(GridSelectionType.Row)) .Events(events =&gt; events.DataBound("Planning.reSelectMeasurements('#=Label#')")) Is it possible to pass information from my view model to this function instead of the literal string return? I noticed when I ran firebug and I put a breakpoint next to the function, it says label gets passed in as "#=Label#". Where: reSelectMeasurements: function (label) { if (label == "Point") { Planning.reSelectPoint("A"); } else if (label == "Angle") { Planning.reSelectAngle("A"); } } EDIT: Latest attempt: if (events.sender._data.PointLabel == "Point") { Planning.reSelectPoint("A"); } else if (events.sender._data.Label == "Angle") { Planning.reSelectAngle("A"); } when I get to _data. on debugging, it contains an array of data. How do I pass in the specific row I selected in so that I can pass in the proper Label data? so the hierarchy looks something like events.sender._data.[0].Label ?

http://stackoverflow.com/comment/48077473
comment on: http://stackoverflow.com/q/29978830
score: 0
has text: Well, yeah. Im using prompt and alert for learning purposes, as they are the only thing i know at the moment, to use, when making a text game. And i have not learned how to store indexes or reassign Arrays yet.
type: QuestionComment
type: Comment

http://stackoverflow.com/q/29989952
answer count: 1
has answer: http://stackoverflow.com/a/29990763
has comment: http://stackoverflow.com/comment/48099303
tagged with: asp.net
has comment: http://stackoverflow.com/comment/48100086
tagged with: http://stackoverflow.com/tag/html
type: UnansweredQuestion
has title: OnBlur after OnFocus calls method
tagged with: c#
has body: I am currently working with a set of textboxes in a grid that represent days of the week. There is also a drop down list (with its selected index) that also shows the dates for the week. Also there is a text area that represents specific comments for each day of the chosen week as well. When focusing, either with clicks or TAB, my Javascript function calls out the server side method (C#) for the selected index change method of the data drop down. Each day passes its index back to the function, then runs the SelectedIndexChanged method. This way when I click on a week day, I can show the comments and change the date drop down, rather than have to resort to using the drop down. I did this by adding the attributes like so: gridTextBox.Attributes.Add("onfocus", "changeSelectedDayComments(" + index.ToString() + ")"); All that said, the issue I'm facing is when I try to enter text in a cell, flicker occurs and deletes my text. Is there a corresponding way of adding attribute for onBlur after using onFocus to call to a method, using Javascript only? Thanks in advance
tagged with: javascript
has comment: http://stackoverflow.com/comment/48099183
type: Question
score: 0

http://stackoverflow.com/comment/47908172
type: Comment
comment on: http://stackoverflow.com/q/29892412
has text: What do you mean by _call my Alert service from app.config_? Do you want to configure it? And what about _ how can I catch all http errors in one place and display them_? Isn't that what this code is supposed to do?
score: 0
type: QuestionComment

http://stackoverflow.com/a/29875798
upvote count: 1
downvote count: 0
has body: if getUsersFromLocal is not a controller or service, and you are invoking this function manually, you should pass $http and $scope objects to it, like this module.controller('TestController', function($scope, $http) { function getUsersFromLocal($scope,$http) { $http.get('http://localhost:8080/people'). success(function(data) { $scope.data = data; }); } getUsersFromLocal($scope, $http); // pass this services manually });
type: Answer
answers question: http://stackoverflow.com/q/29875703
score: 1

http://stackoverflow.com/comment/48158696
comment on: http://stackoverflow.com/a/29887014
has text: I try really hard to make PouchDB newbie-friendly, but some of the concepts are difficult, it's true. :( Sorry I couldn't make it easier for you. If you try using ES7 with Babel, you may find asynchronous programming to be much more beginner-friendly: http://pouchdb.com/2015/03/05/taming-the-async-beast-with-es7.html
score: 1
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/47860024
score: 0
comment on: http://stackoverflow.com/a/29867504
type: Comment
has text: @T.JCrowder yes, this is exactly my point, you can't apply this to JavaScript but it might be true for other languages.
type: AnswerComment

http://stackoverflow.com/comment/47923763
has text: Nothing in your code makes it red, can you attach CSS file?
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/29900463
type: Comment

http://stackoverflow.com/comment/48054820
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29899808
has text: http://stackoverflow.com/questions/14527387/script7002-xmlhttprequest-network-error-0x2ef3-could-not-complete-the-operati

http://stackoverflow.com/comment/47980781
type: AnswerComment
type: Comment
has text: So the data is coming in as a constant stream, so if i disconnect i will lose data between when I disconnect and reconnect. So my "approach", what i am trying to do is connect a second connection first, then disconnect first. That way, i 'lose' nothing.
score: 0
comment on: http://stackoverflow.com/a/29883920

http://stackoverflow.com/comment/47869459
score: 0
has text: @ShawnJacobson Thanks for the great article, I understand that keypress occurs after keydown, before input and before keyup. I am just wondering why the keyCode differs between the two when lowercase but not when uppercase.
comment on: http://stackoverflow.com/q/29872098
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/47918213
has text: Hi, thanks for the quick response. My friend made this javascript for me so I am not quite sure where to add it in my js file. Could you kindly guide me through?
score: 1
comment on: http://stackoverflow.com/q/29897300
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29937650
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47996866
tagged with: php
possible better answer: http://stackoverflow.com/a/29937776
type: AnsweredQuestion
upvote count: 0
linked to: http://stackoverflow.com/q/5108860
has comment: http://stackoverflow.com/comment/47996797
tagged with: mysql
duplicate of: http://stackoverflow.com/q/5108860
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/47997231
score: -1
answer count: 3
accepted answer: http://stackoverflow.com/a/29943231
downvote count: 1
has answer: http://stackoverflow.com/a/29937708
has body: I have developed a web page using php and mysql lanuages. But,I want to refresh the web page which is run on local host automatically after updating the connected database.How can I do it?
favorite count: 0
tagged with: ajax
has answer: http://stackoverflow.com/a/29937776
has title: Automatically refresh the web page after updating the database
has answer: http://stackoverflow.com/a/29943231

http://stackoverflow.com/a/29955110
type: Answer
has comment: http://stackoverflow.com/comment/48031556
answers question: http://stackoverflow.com/q/29955054
score: 0
has comment: http://stackoverflow.com/comment/48031055
has comment: http://stackoverflow.com/comment/48031041
has comment: http://stackoverflow.com/comment/48031063
has comment: http://stackoverflow.com/comment/48031257
has body: You can use the Array.prototype.push method: var res = []; for (var i = 0; i &lt; o.length; i++) { res.push.apply(res, o[i].users); } If the array should contain unique elements: res = res.filter(function(val, i, arr) { return arr.indexOf(val) === i; });
has comment: http://stackoverflow.com/comment/48031025

http://stackoverflow.com/q/29845715
has comment: http://stackoverflow.com/comment/47817279
favorite count: 0
tagged with: frontend
type: AnsweredQuestion
score: 1
upvote count: 1
has title: Sort an array with JS objects in it by two values
type: Question
tagged with: object
has body: I have an array with roughly 50 JS objects inside, each object in the array has a name, catname, dish_sort_id and sort_id currently i am trying to sort it so that in the array it goes group objects via catname and if dish_sort_id &lt; then dish_sort_id of next object. Below is the code i am using to sort the array despite using this code some items are appearing in the wrong order, but they are being sorted A.sort(function(a,b){ if(a.catname == b.catname &amp;&amp; a.dish_sort_id &gt; b.dish_sort_id){ return -1; } else if(a.catname == b.catname &amp;&amp; a.dish_sort_id &lt; b.dish_sort_id){ return 1; } else if(a.catname == b.catname &amp;&amp; a.dish_sort_id == b.dish_sort_id){ return 0; } });
tagged with: javascript
tagged with: sorting
has answer: http://stackoverflow.com/a/29845853
has comment: http://stackoverflow.com/comment/47817226
has comment: http://stackoverflow.com/comment/47817189
has comment: http://stackoverflow.com/comment/47817325
has comment: http://stackoverflow.com/comment/47817067
answer count: 1
tagged with: arrays
downvote count: 0
accepted answer: http://stackoverflow.com/a/29845853
has comment: http://stackoverflow.com/comment/47817181

http://stackoverflow.com/a/29849464
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: Visible="false" means the resultant &lt;div&gt; and its contents are not rendered (i.e. the browser literally won't know anything about them because they will not be in the HTML that the browser receives). If you want it to be hidden but still there for your code to deal with, then use style="display:none;" or appropriate class definition. For example... &lt;asp:Panel ID="panel" runat="server" style="display:none;"&gt; &lt;asp:DropDownList ID="ddlSearchDropdownlist" runat="server"&gt;&lt;/asp:DropDownList&gt; &lt;/asp:Panel&gt; Or... &lt;style type="text/css"&gt; .myHiddenPanel { display: none; } &lt;/style&gt; &lt;asp:Panel ID="panel" runat="server" CssClass="myHiddenPanel"&gt; &lt;asp:DropDownList ID="ddlSearchDropdownlist" runat="server"&gt;&lt;/asp:DropDownList&gt; &lt;/asp:Panel&gt;
upvote count: 2
accepted answer of: http://stackoverflow.com/q/29849313
answers question: http://stackoverflow.com/q/29849313
score: 2

http://stackoverflow.com/comment/47981591
type: QuestionComment
comment on: http://stackoverflow.com/q/29929289
has text: @squint the line below it removes the two numbers ! var removed = arr.splice(6, 4);
score: 0
type: Comment

http://stackoverflow.com/a/30084582
type: AcceptedAnswer
type: Answer
answers question: http://stackoverflow.com/q/30002398
has body: As 5mb are too much for browser. I now tested it with 50% of width and height. So the picture is now just 2,33mb big. And as you can see, it works now in Firefox and Chrome and the picture is loading in about 2 seconds. The performance is also okay. But for sure I cannot zoom that much into the map anymore, otherwhise it get very pixeled. So I capped it at zooming 7x. So the only other solution would be tiling images, but that would be way to hard to do for this project. And as I said this will kill the soft zooming.
accepted answer of: http://stackoverflow.com/q/30002398
score: 0

http://stackoverflow.com/q/29977469
has comment: http://stackoverflow.com/comment/48074639
score: -2
has answer: http://stackoverflow.com/a/29977587
tagged with: javascript
has comment: http://stackoverflow.com/comment/48074553
has comment: http://stackoverflow.com/comment/48074552
has title: Uncaught ReferenceError: changePhone is not defined
has comment: http://stackoverflow.com/comment/48074497
answer count: 3
has comment: http://stackoverflow.com/comment/48074613
upvote count: 0
tagged with: jquery
has answer: http://stackoverflow.com/a/29977854
favorite count: 0
has comment: http://stackoverflow.com/comment/48074904
has comment: http://stackoverflow.com/comment/48074647
type: AnsweredQuestion
has body: I have some text inputs on my site for phone numbers. I want to keep all numbers in one format not some like 123-456-7890 and others 1234567890. I've tried writing a code to change this but it is giving me an error of Uncaught ReferenceError: changePhone is not defined. Here is my code: &lt;input type="text" id="phone" onblur="changePhone(this.id)"&gt; function changePhone(id){ $(id).text(function(i, number) { number = number.replace(/(\d{3})(\d{3})(\d{4})/, "$1-$2-$3"); return number; }); } When running validation my code checks out as valid so I am not understanding why it doesn't work. On a side note: Is there a PHP solution to achieve this or is jquery my best option? EDIT: Here is a fiddle of my code: http://jsfiddle.net/4uk9hhtc/
has answer: http://stackoverflow.com/a/29977687
downvote count: 2
accepted answer: http://stackoverflow.com/a/29977854
type: Question
possible better answer: http://stackoverflow.com/a/29977687
has comment: http://stackoverflow.com/comment/48074709

http://stackoverflow.com/q/29928942
type: UnansweredQuestion
tagged with: animation
has body: I've got a largish (~1,300) set of markers that I'm placing on a map over a timeline. Basically it's like playing a video where over the time sequence, markers are placed using google.maps.Animation.DROP on a map. We have standard video/audio player-type controls that allow you to navigate the timeline: play/pause, skip to start, skip to end, and a scrubber bar to move arbitrarily within the timeline. If I start with the map empty and the timeline paused at the beginning and then jump to the end there's a brief delay as all of those marker objects are created and then they all drop onto the map together. This is fine. Once a marker's been placed and the user moves backward in the timeline (to a point where a particular marker should no longer be visible) I do a marker.setMap(null) and the marker is hidden. From what I've read this is the correct way to remove a marker and it works. The big problem manifests if you create/drop all (or a large number) of the markers, then navigate back in the timeline (such that the large number of markers is removed), and then jump forward again. This creates a nasty flash of pins on the map that then disappear and suddenly drop from the top of the map. As mentioned, the correct effect (pins drop in without appearing on the map beforehand) happens the first time the pins drop, but subsequent drops cause this odd behavior. For small numbers of pins it's largely imperceptible, but with a lot of pins it's much more distracting. It seems like there must be something in the internal state of the marker that marker.setMap(null) is not truly resetting, but I'm not at all sure what that might be. I originally created new markers as needed and then destroyed them when they disappeared, but this overhead made things sluggish. In theory I feel like my approach should work throughout, but I basically get one good shot with the right effect and repeats behave badly. Does anyone see something I'm doing wrong or have suggestions on how to make this…
has answer: http://stackoverflow.com/a/30077350
has comment: http://stackoverflow.com/comment/47980537
has comment: http://stackoverflow.com/comment/47983386
has comment: http://stackoverflow.com/comment/48094532
type: Question
score: 5
tagged with: google-maps
upvote count: 5
has comment: http://stackoverflow.com/comment/48095405
tagged with: javascript
has comment: http://stackoverflow.com/comment/47983433
tagged with: google-maps-api-3
answer count: 1
downvote count: 0
has title: Re-dropping Multiple Google Maps Markers Without Repaint On Map
favorite count: 0
has comment: http://stackoverflow.com/comment/47983106

http://stackoverflow.com/comment/47973617
comment on: http://stackoverflow.com/q/29925948
type: Comment
type: QuestionComment
score: 2
has text: *"Presumably this would give rise to a call stack"* nope, since it's asynchronous, the call stack would not grow out of control.

http://stackoverflow.com/comment/48064332
comment on: http://stackoverflow.com/q/29972211
has text: I am calling .push on the array. if the array doesn't exist, that is, if the dynamic property hasn't been defined as an array on the results array, JavaScript complains that push isn't a method of "results".
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/a/29894228
upvote count: 5
downvote count: 0
answers question: http://stackoverflow.com/q/29894093
score: 5
has body: You should be using var usernameInput = React.findDOMNode(this.refs.username); to get a reference to the component's DOM node using refs. The getDOMNode method has been deprecated getDOMNode is deprecated and has been replaced with React.findDOMNode().
type: Answer

http://stackoverflow.com/q/29963129
has comment: http://stackoverflow.com/comment/48048435
possible better answer: http://stackoverflow.com/a/29964540
answer count: 2
has comment: http://stackoverflow.com/comment/48048373
has title: Is the Promise constructor callback executed asynchronously?
has comment: http://stackoverflow.com/comment/48047189
has body: Suppose I have this code function y(resolve, reject) { console.log("Result"); resolve(); } var promise = new Promise(y); What I want to know is whether the function y will be executed asynchronously or not.
has comment: http://stackoverflow.com/comment/48048523
downvote count: 0
has answer: http://stackoverflow.com/a/29963279
favorite count: 0
has comment: http://stackoverflow.com/comment/48048389
tagged with: promise
linked to: http://stackoverflow.com/q/42118900
has comment: http://stackoverflow.com/comment/48048366
has comment: http://stackoverflow.com/comment/121834658
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/48046885
score: 21
accepted answer: http://stackoverflow.com/a/29963279
upvote count: 21
has comment: http://stackoverflow.com/comment/48046648
type: Question
has answer: http://stackoverflow.com/a/29964540
has comment: http://stackoverflow.com/comment/48048310
has comment: http://stackoverflow.com/comment/120000229
has comment: http://stackoverflow.com/comment/48048581
tagged with: es6-promise
tagged with: javascript
has comment: http://stackoverflow.com/comment/48046849
has comment: http://stackoverflow.com/comment/48048259
has comment: http://stackoverflow.com/comment/48047815

http://stackoverflow.com/comment/47964588
comment on: http://stackoverflow.com/q/29921073
type: Comment
type: QuestionComment
has text: @jwatts1980 I'm not sure if you read my question, but I've seen some solutions involving Ajax. HOWEVER, I am trying to do this through a UserControl (.ascx file) so I am not sure that method will work. On this solution: http://stackoverflow.com/questions/19701658/how-to-call-c-sharp-method-in-jquery they define a url and POST to it, but I don't think I can define a url because I will eventually use this control as a Widget in Sitefinity CMS
score: 0

http://stackoverflow.com/q/30000766
has comment: http://stackoverflow.com/comment/48121334
downvote count: 0
has comment: http://stackoverflow.com/comment/50395176
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/48121229
score: 2
has comment: http://stackoverflow.com/comment/48120396
answer count: 0
upvote count: 2
has comment: http://stackoverflow.com/comment/48120462
tagged with: ionic-framework
type: Question
tagged with: dependency-injection
has title: Can't inject factory service from another module in angularjs
tagged with: javascript
has body: I am new to angularjs. I am trying to build a mobile application inspired from modular approach defined here: http://thaiat.github.io/blog/2014/02/26/angularjs-and-requirejs-for-very-large-applications/ Now I am trying to create a service using factory method in one of my modules core. I have another module called home. Now when I try to inject service from core to home, I get an error: Error: [$injector:unpr] Unknown provider: glue.core.geoLocationServiceProvider &lt;- glue.core.geoLocationService I have searched through internet and here. None of the solutions are working for me. the code of my home module's controller is: define([ '../module', '../namespace', ], function(module, namespace) { 'use strict'; var name = namespace + ".homeController"; var dependencies = ['$scope', '$http', '$ionicLoading', 'glue.core.geoLocationService']; var controller = function($scope, $http, $ionicLoading, core) { } module.controller(name, dependencies.concat(controller)); }); I have also uploaded the project here on github: https://github.com/neerajsohal/test/tree/development Any help would be great. I am going mad with this.
has comment: http://stackoverflow.com/comment/50447078

http://stackoverflow.com/comment/47944293
comment on: http://stackoverflow.com/a/29911052
score: 2
has text: I don't want the javascript files, I need the content generated by javascript written in the HTML.
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/47889961
type: Comment
has text: this function is now causing the issue "unexpected token function"
type: AnswerComment
comment on: http://stackoverflow.com/a/29882877
score: 0

typeahead
type: Tag
tag name: typeahead
tags question: http://stackoverflow.com/q/29925753
tags question: http://stackoverflow.com/q/29900047
tags question: http://stackoverflow.com/q/30000700

http://stackoverflow.com/a/29863358
answers question: http://stackoverflow.com/q/29863302
type: Answer
has body: You can use .map to call $.getScript on each element of the array. Then you can apply $.when to the result of this: $.when.apply(null, json.script.map(function(e) { return $.getScript(e); })) .done(function( script, textStatus ) { success(json); }) .fail(function( jqxhr, settings, exception ) { errormessage( exception ); });
downvote count: 0
score: 1
upvote count: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29863302

http://stackoverflow.com/a/29863279
downvote count: 0
has body: First, if it is not a typo, your "First" is missing a closing div at the very bottom. After you fix that, if it is a typo, you should be able to do: var $something = $(first).find('.edit-modal-content').append($(second)); Then when you are ready you can append that to the body.
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29863087
answers question: http://stackoverflow.com/q/29863087
type: Answer
score: 1
upvote count: 1

http://stackoverflow.com/comment/47842886
has text: this is a pure CSS issue... best solution is overriding what you don't want the child to inherit
score: 0
comment on: http://stackoverflow.com/q/29858381
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/48084588
type: QuestionComment
comment on: http://stackoverflow.com/q/29982580
has text: By default, the image slider has stopped working, menu effects have been disappeared, but the wow slider at the bottom (Hot Properties Section) is perfectly working.
score: 0
type: Comment

http://stackoverflow.com/comment/48003207
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29941208
has text: do you have users also defined like index.js, maybe error is bacause of this
score: 0

datetimepicker
type: Tag
tags question: http://stackoverflow.com/q/29954528
tags question: http://stackoverflow.com/q/29867190
tag name: datetimepicker

http://stackoverflow.com/a/30059998
has body: Apparently it's a wanted feature to be able to add context / pass params into the transition object (for willTransitionTo and willTransitionFrom). Here's a pull request with lots of comments discussing the issue / use cases https://github.com/rackt/react-router/pull/590
type: Answer
answers question: http://stackoverflow.com/q/29980090
score: 0

http://stackoverflow.com/comment/47938991
score: 0
type: Comment
type: QuestionComment
has text: How about if I were exporting multiple things with the export syntax last?
comment on: http://stackoverflow.com/q/29908282

http://stackoverflow.com/q/29947892
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/48016908
has title: Quiz answer highlighting both options
has answer: http://stackoverflow.com/a/29948283
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
possible better answer: http://stackoverflow.com/a/46745453
has answer: http://stackoverflow.com/a/46745453
upvote count: 2
tagged with: css
type: AnsweredQuestion
score: 2
accepted answer: http://stackoverflow.com/a/29948283
has body: I am building an employability quiz at university and each question has a Yes and a No answer. If I click the Yes answer, it highlights green and shows an answer below. If I click the No answer however, it highlights red, and it also highlights the Yes answer box green even though it hasn't been clicked. This is Question 1 HTML: $(document).ready(function() { //get total of questions var $questionNumber = $('h2').length; console.log($questionNumber); //caching final score var $totalScore = 0; $('li').click(function() { //caching variables var $parent = $(this).parent(); var $span = $(this).find('.fa'); //deactivate options on click $parent.find('li').off("click"); //check for .correct class //if yes if ($(this).hasClass('correct')) { //add .correctAnswer class $(this).addClass('correctAnswer'); //find next span and change icon $span.removeClass('fa fa-square-o').addClass('fa fa-check-square-o'); //reduce opacity of siblings $(this).siblings().addClass('fade'); //show answer var $answerReveal = $parent.next('.answerReveal').show(); var $toShowCorrect = $answerReveal.find('.quizzAnswerC'); var $toShowFalse = $answerReveal.find('.quizzAnswerF'); $toShowCorrect.show(); $toShowFalse.remove(); //add 1 to total score $totalScore += 1; //console.log($totalScore); } else { //add .wrongAnswer class $(this).addClass('wrongAnswer').addClass('fade'); //change icon $span.removeClass('fa fa-square-o').addClass('fa fa-check-square-o'); //reduce opacity of its siblings $(this).siblings().addClass('fade'); //show wrong Message var $answerReveal = $parent.next('.answerReveal').show(); var $toShowCorrect = $answerReveal.find('.quizzAnswerC'); var $toShowFalse = $answerReveal.find('.quizzAnswerF'); $toShowCorrect.remove(); $toShowFalse.show(); //locate correct answer and highlight $parent.find('.correct').addClass('correctAnswer'); }; }); //end click function //print Results function printResult() { var resultText = ' '; if ($totalScore === $questionNumber) { resultText += 'You got ' + …
type: Question
answer count: 2
downvote count: 0

http://stackoverflow.com/q/29879739
favorite count: 0
has comment: http://stackoverflow.com/comment/47883700
has comment: http://stackoverflow.com/comment/47883657
has answer: http://stackoverflow.com/a/29879770
has comment: http://stackoverflow.com/comment/47883597
upvote count: 1
has comment: http://stackoverflow.com/comment/47883772
type: AnsweredQuestion
has body: Here, I want to create a something like slideshow concept which get the value one by one using setInterval function.I have just tried to implement based logically, but it not working as expected,just got error output.So how to repair and improve my code below? jQuery setInterval(function() { var getValue = $('#slideShow').find('input:first').val() .fadeOut(1000) .next() .fadeIn(1000) .end() .appendTo('#slideShow'); alert(getValue); }, 3000); html &lt;div id="slideShow"&gt; &lt;input type="hidden" value="one"/&gt; &lt;input type="hidden" value="two"/&gt; &lt;input type="hidden" value="three"/&gt; &lt;/div&gt;
score: 1
accepted answer: http://stackoverflow.com/a/29879770
has comment: http://stackoverflow.com/comment/47883603
type: Question
has comment: http://stackoverflow.com/comment/47883634
answer count: 1
downvote count: 0
tagged with: javascript
has title: How to get input value one by one using setInterval function
tagged with: jquery

http://stackoverflow.com/comment/47866180
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29870605
has text: when i click on the script inside the div this function dont work, only if i click outside of the script but in the div space `$('#popupDiv').click(function() { $('#popupDiv').hide(); createCookie('hide', true, 1) return false; `

http://stackoverflow.com/q/29872126
type: AnsweredQuestion
upvote count: 7
has title: How to animate and change a slider counter position in a clean way?
type: Question
score: 7
has answer: http://stackoverflow.com/a/29877468
answer count: 2
possible better answer: http://stackoverflow.com/a/29874212
has body: I have a Swiper slider and a counter position like "1/10". I would like to change that current slide number (the 1) with an animation. I know how to replace the number but with this animation, it's like another story: As you can see on the gif, it's working nicely if I click moderately on my slider, but when I double-triple-or-crazy click on the next link, that totally breaks the counter, due to the clone made in this gif example. Do you know how can I do that in a better way? I made a jsfiddle, working for the first count change only: — http://jsfiddle.net/asb39sff/1/ // Init var $c_cur = $("#count_cur"), $c_next = $("#count_next"); TweenLite.set($c_next, {y: 12, opacity: 0}, "count"); // Change counter function function photos_change(swiper) { var index = swiper.activeIndex +1, $current = $(".photo-slide").eq(index), dur = 0.8, tl = new TimelineLite(); // Just a test tl.to($c_cur, dur, {y: -12, opacity: 0}, "count") .to($c_next, dur, {y: 0, opacity: 1}, "count") //$c_cur.text(index); //$c_next.text(index + 1); }
tagged with: swiper.js
downvote count: 0
has answer: http://stackoverflow.com/a/29874212
tagged with: javascript
tagged with: jquery
tagged with: gsap
favorite count: 0
has comment: http://stackoverflow.com/comment/47871671
accepted answer: http://stackoverflow.com/a/29877468

http://stackoverflow.com/comment/47875470
score: 0
comment on: http://stackoverflow.com/a/29875457
type: Comment
has text: You can use : $scope.quantity = 100; and in your binding: ng-repeat="item in items | limitTo:quantity"
type: AnswerComment

http://stackoverflow.com/a/29995177
score: 1
has comment: http://stackoverflow.com/comment/48110153
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29995062
has comment: http://stackoverflow.com/comment/48110788
has comment: http://stackoverflow.com/comment/48111686
has body: Test with this CSS (background and font color supported). li:nth-child(odd) { background: black; } li &gt; a { color: black } li:nth-child(odd) &gt; a { color:white; } http://jsfiddle.net/kz0m5we6/
type: Answer
answers question: http://stackoverflow.com/q/29995062
has comment: http://stackoverflow.com/comment/48110391
upvote count: 1

http://stackoverflow.com/a/31328488
has comment: http://stackoverflow.com/comment/50769440
upvote count: 0
has body: What you're trying to do is a FIFO file (acronym for First In First Out), which as you said works like a socket. There's a node.js module that allows you to work with fifo files. I don't know what do you want that for, but there are better ways to work with sockets on node.js. Try socket.io instead. You could also have a look at this previous question: Reading a file in real-time using Node.js Update 1 I'm not familiar with any module that would do what you want with a regular file, instead of with a socket type one. But as you said, you could use tail -f to do the trick: // filename must exist at the time of running the script var filename = 'somefile.txt'; var spawn = require('child_process').spawn; var tail = spawn('tail', ['-f', filename]); tail.stdout.on('data', function (data) { data = data.toString().replace(/^[\s]+/i,'').replace(/[\s]+$/i,''); console.log(data); }); Then from the command line try echo someline &gt; somefile.txt and watch at the console. You might also would like to have a look at this: https://github.com/layerssss/node-tailer
type: Answer
has comment: http://stackoverflow.com/comment/54307326
downvote count: 1
answers question: http://stackoverflow.com/q/29923192
score: -1

http://stackoverflow.com/comment/48045765
comment on: http://stackoverflow.com/a/29962653
type: Comment
has text: you can probably try adding it inside settimeout. `setTimeout(function(){ /* insert the function here */ }, 3000);`
score: 0
type: AnswerComment

http://stackoverflow.com/q/29916854
has body: i'm using this http://www.dropzonejs.com/ in my create form When user click "Click here to add files" the files are stored in Files/TempFile but when user click submit on my create method i want to move all files from Files/TempFile to Files/TicketFile uploaded from the user, or if user click cancel to delete all files from Files/TempFile. The problem is what if there are several user that trying to upload files in the same time. If one of the user click cancel or submit how to know which files to move or delete. CREATE VIEW @{ ViewBag.Title = "Create"; } @using (Html.BeginForm("Create", "Ticket", FormMethod.Post, new { enctype = "multipart/form-data" })) { @Html.AntiForgeryToken() @Html.ValidationSummary(true) Ticket @Html.LabelFor(model => model.idTicket) @Html.EditorFor(model => model.idTicket) @Html.ValidationMessageFor(model => model.idTicket) @Html.LabelFor(model => model.idProject, "Project") @Html.DropDownList("idProject", String.Empty) @Html.ValidationMessageFor(model => model.idProject) @Html.LabelFor(model => model.tickettDescription) @Html.EditorFor(model => model.tickettDescription) @Html.ValidationMessageFor(model => model.tickettDescription) @Html.LabelFor(model => model.assignment, "User") @Html.DropDownList("assignment") @Html.ValidationMessageFor(model => model.assignment) } @Html.ActionLink("Back to List", "Index") Save Method public ActionResult SaveUploadedFile() { bool isSavedSuccessfully = true; string fName = ""; try { foreach (string fileName in Request.Files) { HttpPostedFileBase file = Request.Files[fileName]; //Save file content goes here fName = file.FileName; if (file != null && file.ContentLength > 0) { string path = Server.MapPath("~/Files/TempFile/") + file.FileName; file.SaveAs(path); } } } catch (Exception ex) { isSavedSuccessfully = false; } if (isSavedSuccessfully) { return Json(new { Message = fName }); } else { return Json(new { Message = "Error in saving file" }); } } i tried not to store to TempFile and when i click create to…
type: Question
tagged with: asp.net-mvc
tagged with: javascript
score: 0
has title: How to delete uploaded files from specific user
accepted answer: http://stackoverflow.com/a/29917097
answer count: 1
tagged with: jquery
tagged with: dropzone.js
has answer: http://stackoverflow.com/a/29917097
type: AnsweredQuestion

http://stackoverflow.com/comment/47877415
type: Comment
has text: Thanks @Jimmy for your help, that's some really interesting scripts. I'll surely take a look.
comment on: http://stackoverflow.com/a/29865301
type: AnswerComment
score: 0

http://stackoverflow.com/comment/48070583
type: Comment
type: QuestionComment
has text: my user collection does not have a profile field by default
comment on: http://stackoverflow.com/q/29975316
score: 0

http://stackoverflow.com/q/29973426
type: AnsweredQuestion
has title: Google Map with Local Churches, how to construct API call?
has comment: http://stackoverflow.com/comment/48067887
favorite count: 0
has comment: http://stackoverflow.com/comment/48067550
has comment: http://stackoverflow.com/comment/48069865
tagged with: google-places-api
type: Question
upvote count: 2
has comment: http://stackoverflow.com/comment/48067133
answer count: 1
accepted answer: http://stackoverflow.com/a/29974867
has body: Is there are way to retrieve a map from Google using the API so that it displays a list of local churches with churches with markers? I have the basic syntax, and I have a basic API account setup, but I am not how/if I can use the type field. var mapOptions = { center: new google.maps.LatLng("-33.8670522", "151.1957362"), zoom: 11, scrollwheel: false, streetViewControl: false, mapTypeId: google.maps.MapTypeId.ROADMAP }; var map = new google.maps.Map(document.getElementById("googlemaps"), mapOptions);
tagged with: google-maps
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/48067855
tagged with: javascript
has answer: http://stackoverflow.com/a/29974867

http://stackoverflow.com/comment/48110480
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29995292
score: 1
has text: Did you even google your question? I copypastad your title into google and [this question](http://stackoverflow.com/questions/19807665/auto-refresh-for-every-5-mins) was the 2nd result.

http://stackoverflow.com/comment/47881936
type: QuestionComment
comment on: http://stackoverflow.com/q/29878791
has text: Share your source code, pls. That will help us understand what you are trying to do.
score: 0
type: Comment

http://stackoverflow.com/q/29978313
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has title: Duplicate section of PHP Form with different name identifiers
type: UnansweredQuestion
upvote count: 1
tagged with: php
type: Question
has answer: http://stackoverflow.com/a/29978669
score: 1
has comment: http://stackoverflow.com/comment/48076209
has comment: http://stackoverflow.com/comment/48076812
has body: I've created a PHP form that looks like this, to add details about faculty members. I want to be able to duplicate this section (inside the borders) with different IDs. Can I store each member's details in an array? This is what it should look like after adding another member. My code is below: &lt;html&gt; &lt;style&gt; .container { width:21%; border:1px solid #d3d3d3; } .container div { width:99%; } .container .header { background-color:#d3d3d3; padding: 2px; cursor: pointer; font-weight: bold; } .container .content { display: none; padding : 5px; } .faculty {border: 1px black solid;} &lt;/style&gt; &lt;head&gt; &lt;meta charset="UTF-8"&gt; &lt;script src="jquery-1.11.2.min.js"&gt;&lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;form action="added.php" method="post"&gt; &lt;div class="container"&gt;&lt;div class="header"&gt;Faculty&lt;/div&gt; &lt;div class="content"&gt; &lt;input type="button" id="f_add" value="Add Member" /&gt; &lt;input type="button" id="f_rem" value="Remove Last" /&gt; &lt;div class="faculty" name="f_1" id="f_1"&gt; Name: &lt;input type="text" name="f_name_1" required /&gt;&lt;br&gt; Role:&amp;nbsp;&amp;nbsp; &lt;input type="text" name="f_role_1" required /&gt;&lt;br&gt; Email: &lt;input type="text" name="f_email_1" /&gt; &lt;br&gt; Biography: &lt;textarea name="f_bio_1" rows="5" cols="38"&gt;&lt;/textarea&gt;&lt;br&gt; Office Hours:&lt;br&gt;&lt;input type="checkbox" name="f_mon_0" /&gt; Mon &lt;input type="checkbox" name="f_tue_0" /&gt; Tue &lt;input type="checkbox" name="f_wed_0" /&gt; Wed &lt;input type="checkbox" name="f_thu_0" /&gt; Thu &lt;input type="checkbox" name="f_fri_0" /&gt; Fri &lt;br&gt; Image: &lt;input type="file" name="f_image_0" /&gt;&lt;br&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;input type="submit" value="Submit"/&gt; &lt;script&gt; $(".header").click(function () { $(this).next().slideToggle(500, function () {}); }); $("#f_add").click(function () { $(".faculty").clone().prop({name: "f2", id: "f2"}).appendTo(".content"…
downvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/48076221

http://stackoverflow.com/q/29864939
type: AnsweredQuestion
has title: how to reuse ui-grid external pagination and sort methods?
tagged with: angular-ui-grid
type: Question
has answer: http://stackoverflow.com/a/29865732
score: 0
answer count: 1
has body: I'm trying to use ui-grid with external pagination and external sort in a project. how can i modify ui-grid once and use it several place?
tagged with: javascript
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/29865732

http://stackoverflow.com/a/29918948
answers question: http://stackoverflow.com/q/29918690
has body: Using native JS var profile = document.querySelectorAll('.profile-feed .col-sm-6'); var childs = profile[0].querySelectorAll('*');
score: 0
type: Answer

http://stackoverflow.com/q/29954675
linked to: http://stackoverflow.com/q/3522090
has body: I'm developing a chrome extension which injects a link on every tweet. The injection implementation idea was taken from a official Twitter plugin where I saw that the injection was handled by running setInterval() function every two seconds. I wonder about performance though. Before that, I had been dealing with MutationObserver in order to get new DOM elements, but it didn't work for me on some cases, so I gave a try on the idea above. In my case, when the user clicks on the injected link, my plugin should request Twitter the geolocation and, if found, return it, else it would be saved (maybe using indexedDB?) so it isn't showed again. This adds an extra query on whether or not to show that injected link on every tweet. $(document).ready(function() { $('body').append(' '); setInterval( function() { inyect(); }, 2000); }); function inyect() { $(".tweet, .js-tweet").each(function(){ var inyected = $(this).find('.mapLink').length ? true : false; if ( ! inyected ) { // also, check against the "geo-fails" list. if not in, do: var id = $(this).attr('data-tweet-id'); var geoElement = $(this).find('span.ProfileTweet-geo'); geoElement .parent() .prepend('map'); } }); } $('body').on('click', 'a.mapLink', function(e) { e.preventDefault(); var elem = $(e.target) var id = elem.attr('tweet-id') // request Twitter if the tweet contains geolocation data // and save the position in that case // show map // else, SAVE that tweet id into the "geo-fails" list // show message and hide the link. } Knowing my context, what are your recommendations on those two aspects (performance on injecting links & storage)?
has comment: http://stackoverflow.com/comment/48060696
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/48038974
has title: Should I use setInterval() on a Content Script?
has comment: http://stackoverflow.com/comment/48039831
answer count: 0
tagged with: twitter
type: Question
has comment: http://stackoverflow.com/comment/48039207
tagged with: javascript
has comment: http://stackoverflow.com/comment/48153248
has comment: http://stackoverflow.com/comment/48038020
score: 0
tagged with: google-chrome-extension

http://stackoverflow.com/comment/47852728
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29863721
has text: @user3201500, I'll take a look, although I'm not familiar with onsen.

http://stackoverflow.com/q/29973681
tagged with: indexof
has comment: http://stackoverflow.com/comment/48067869
tagged with: javascript
has comment: http://stackoverflow.com/comment/48067438
has comment: http://stackoverflow.com/comment/48067183
has comment: http://stackoverflow.com/comment/48068066
answer count: 1
downvote count: 0
score: 1
has body: I'm trying to use indexof to tell me if a string appears on page. The function below should cycle through all checkboxes (name="comment") in my form checking for each checkbox's value within the rest of the document (only because I can't figure out how to search just one span). If the string value is found to exist elsewhere on the page, that checkbox will change css style. function loop() { var comment=document.forms[0].comment; var ii; for (ii=0;ii&lt;comment.length;ii++) { str=comment[ii].value; id = comment[ii].id; if(document.body.innerHTML.toString().indexOf(str) !=-1) { document.getElementById(id).style.visibility = "hidden"; } } } The result is that all checkboxes turn "hidden". I thought the problem was the checkbox finding its own value in the HTML, but the same happens when I search for nonsense. Am I using indexof incorrectly? Can anyone point out how and where? I don't want to use window.find. To elaborate: Checkbox 1 value is "A IS FOR APPLE". Check the page for the string "A IS FOR APPLE". If found, make checkbox 1 hidden. Go to checkbox 2 and repeat.
favorite count: 0
has comment: http://stackoverflow.com/comment/48067227
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/48067262
has comment: http://stackoverflow.com/comment/48067155
has title: Am I using indexof correctly?
has comment: http://stackoverflow.com/comment/48067211
has comment: http://stackoverflow.com/comment/48068215
has comment: http://stackoverflow.com/comment/48067229
upvote count: 1
has comment: http://stackoverflow.com/comment/48067201
has answer: http://stackoverflow.com/a/29973908
has comment: http://stackoverflow.com/comment/48067250
type: Question
has comment: http://stackoverflow.com/comment/48067986
has comment: http://stackoverflow.com/comment/48067312

http://stackoverflow.com/tag/json
tags question: http://stackoverflow.com/q/29878522
tags question: http://stackoverflow.com/q/29921096
tags question: http://stackoverflow.com/q/29861379
tags question: http://stackoverflow.com/q/29875534
tags question: http://stackoverflow.com/q/29882601
tags question: http://stackoverflow.com/q/29936660
tags question: http://stackoverflow.com/q/29854384
tags question: http://stackoverflow.com/q/29929921
tags question: http://stackoverflow.com/q/29904750
tags question: http://stackoverflow.com/q/29912282
tags question: http://stackoverflow.com/q/29869499
tags question: http://stackoverflow.com/q/29872731
tags question: http://stackoverflow.com/q/29965573
tags question: http://stackoverflow.com/q/29898573
tags question: http://stackoverflow.com/q/29917665
tags question: http://stackoverflow.com/q/29872387
tags question: http://stackoverflow.com/q/29921795
tags question: http://stackoverflow.com/q/29913280
tags question: http://stackoverflow.com/q/29980922
tags question: http://stackoverflow.com/q/29996686
tags question: http://stackoverflow.com/q/29849955
tags question: http://stackoverflow.com/q/29863837
tags question: http://stackoverflow.com/q/29972635
tags question: http://stackoverflow.com/q/29875597
tags question: http://stackoverflow.com/q/29937203
tags question: http://stackoverflow.com/q/29964553
tags question: http://stackoverflow.com/q/29895583
tags question: http://stackoverflow.com/q/29977735
tags question: http://stackoverflow.com/q/29928807
tags question: http://stackoverflow.com/q/29884795
tags question: http://stackoverflow.com/q/29928734
tags question: http://stackoverflow.com/q/29975813
tags question: http://stackoverflow.com/q/29953238
tags question: http://stackoverflow.com/q/29974907
tags question: http://stackoverflow.com/q/29926720
tags question: http://stackoverflow.com/q/29901933
tags question: http://stackoverflow.com/q/29992106
tags question: http://stackoverflow.com/q/29987238
tags question: http://stackoverflow.com/q/29956126
tags question: http://stackoverflow.com/q/29871445
tags question: http://stackoverflow.com/q/29914141
tags question: http://stackoverflow.com/q/29961134
tags question: http://stackoverflow.com/q/29900394
tags question: http://stackoverflow.com/q/29868675
tags question: http://stackoverflow.com/q/29962617
tags question: http://stackoverflow.com/q/29939268
tags question: http://stackoverflow.com/q/29903981
tags question: http://stackoverflow.com/q/29926387
tags question: http://stackoverflow.com/q/29851113
tags question: http://stackoverflow.com/q/29954886
tags question: http://stackoverflow.com/q/29901178
tags question: http://stackoverflow.com/q/29854056
tags question: http://stackoverflow.com/q/29941255
tags question: http://stackoverflow.com/q/29906901
tags question: http://stackoverflow.com/q/29981943
tags question: http://stackoverflow.com/q/29879904
tags question: http://stackoverflow.com/q/29850172
tags question: http://stackoverflow.com/q/29970545
tags question: http://stackoverflow.com/q/29930648
tags question: http://stackoverflow.com/q/29936971
tags question: http://stackoverflow.com/q/29852175
tags question: http://stackoverflow.com/q/29908852
tags question: http://stackoverflow.com/q/29889599
tags question: http://stackoverflow.com/q/29888401
tags question: http://stackoverflow.com/q/29883917
tags question: http://stackoverflow.com/q/29872443
tags question: http://stackoverflow.com/q/29921218
tags question: http://stackoverflow.com/q/29865168
tags question: http://stackoverflow.com/q/29960988
tags question: http://stackoverflow.com/q/29986590
tags question: http://stackoverflow.com/q/29846033
tags question: http://stackoverflow.com/q/29932238
tags question: http://stackoverflow.com/q/29979960
tags question: http://stackoverflow.com/q/29908267
type: Tag
tags question: http://stackoverflow.com/q/29853126
tags question: http://stackoverflow.com/q/29883271
tags question: http://stackoverflow.com/q/29864253
tags question: http://stackoverflow.com/q/29911443
tags question: http://stackoverflow.com/q/29907075

http://stackoverflow.com/a/29922258
has body: No. YOU will have to do that by preloading the images. This is a hover example: https://css-tricks.com/snippets/jquery/image-preloader/ , what you need is probably onScroll preloader. Google it! An example: http://luis-almeida.github.io/unveil/ , there's more out there.
type: Answer
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/47966499
has comment: http://stackoverflow.com/comment/47966406
downvote count: 0
answers question: http://stackoverflow.com/q/29921885

http://stackoverflow.com/a/29985598
answers question: http://stackoverflow.com/q/29982844
type: Answer
has body: I hope this helps. index.html {{selectedID}} {{location.publisher}}: Select One application.js file should be like: angular.module('demo', []) .controller('demoController', function($scope) { $scope.Locations = [{ "id": "1", "p_id": 22, "publisher": "Bing", "status_id": 12, "notes": "", "callback_at": "", "call_result_id": "" }, { "id": "2", "p_id": 32, "publisher": "Local", "status_id": 12, "notes": "", "callback_at": "", "call_result_id": "" }, { "id": "3", "p_id": 32, "publisher": "new", "status_id": 12, "notes": "", "callback_at": "", "call_result_id": "" }]; $scope.results = [{ "id": 1, "label": "No Answer", "created_at": "2015-04-03 11:13:47", "updated_at": "2015-04-03 11:13:47" }, { "id": 2, "label": "Busy", "created_at": "2015-04-03 11:13:47", "updated_at": "2015-04-03 11:13:47" }, { "id": 3, "label": "Call", "created_at": "2015-04-03 11:13:47", "updated_at": "2015-04-03 11:13:47" }, { "id": 4, "label": "Verification", "created_at": "2015-04-03 11:13:47", "updated_at": "2015-04-03 11:13:47" }, { "id": 5, "label": "triggered", "created_at": "2015-04-03 11:13:47", "updated_at": "2015-04-03 11:13:47" }, { "id": 6, "label": "Issue", "created_at": "2015-04-03 11:13:47", "updated_at": "2015-04-03 11:13:47" }, { "id": 7, "label": "Support", "created_at": "2015-04-03 11:13:47", "updated_at": "2015-04-03 11:13:47" }, { "id": 8, "label": "null", "created_at": "2015-04-03 11:13:47", "updated_at": "2015-04-03 11:13:47" }] $scope.setAllDropDowns = function(inputId) { $scope.call_result_id = inputId; } });
score: 2
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29982844
upvote count: 2

http://stackoverflow.com/comment/48071538
score: 0
type: Comment
type: QuestionComment
has text: Is it only added at the end? Also googling : `"background-color: initial" redactor` gave a result from mid 2014 that seemed similar.
comment on: http://stackoverflow.com/q/29975542

http://stackoverflow.com/q/29983563
score: 2
has body: I have a plugin and it has a below custom page template. This template requires jQuery. I've a variable $link_to_js liked to google library but I want it to link it to the WordPress internal jQuery library? &lt;?php /* Template Name: Checkout Template */ // Need to replace below with WordPress library??? //$link_to_js = "http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"; ?&gt; &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /&gt; &lt;link href="&lt;?php echo $link_to_css; ?&gt;" rel="stylesheet" type="text/css" /&gt; &lt;script type="text/javascript" src="&lt;?php echo $link_to_js; ?&gt;"&gt;&lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="authnet_container"&gt;&lt;!--CONTAINER START--&gt; &lt;/div&gt;&lt;!--FOOTER END--&gt; &lt;/body&gt; &lt;/html&gt; I've added below code in main plugin file but it does not add? function my_init() { if (!is_admin()) { wp_enqueue_script('jquery'); } } add_action('init', 'my_init'); Please advice the best way to add jQuery library to the custom plugin page template? Thanks
upvote count: 2
tagged with: wordpress
has comment: http://stackoverflow.com/comment/48088475
has comment: http://stackoverflow.com/comment/48089854
type: Question
tagged with: javascript
has title: Add WordPress jQuery to cutom page template
has comment: http://stackoverflow.com/comment/48089081
has comment: http://stackoverflow.com/comment/48086315
answer count: 1
downvote count: 0
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/48088300
has comment: http://stackoverflow.com/comment/48089665
has comment: http://stackoverflow.com/comment/48088373
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29985076
has comment: http://stackoverflow.com/comment/48089149
tagged with: php
has comment: http://stackoverflow.com/comment/48088829

http://stackoverflow.com/q/29985991
has body: I have below script code (function($) { $.fn.youamaAjaxLogin = function(options) { function start() { //start } .... How can I call function start() outside (function($) { Please help
has comment: http://stackoverflow.com/comment/48092496
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/48092459
downvote count: 0
has title: How to call a jquery plugin function outside plugin script
tagged with: javascript
tagged with: jquery
score: 4
has answer: http://stackoverflow.com/a/29986239
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
upvote count: 4
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29987677

http://stackoverflow.com/q/29957095
score: 1
has title: Find orphan scopes to cut memory leaks
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/48045216
tagged with: javascript
has answer: http://stackoverflow.com/a/29957914
has body: I encoutered a situation where some vanilla listener was closing a scope, such as: $(window).on('click', function() { $scope.doSomething(); }) This listener was not properly unbound, hence this $scope was never garbage collected. Since it is a pretty big Angular application, I suspect that could happen in many other places. Is there a way to get all the scopes in memory? Getting them all from the DOM elements is not enough as that is precisely the case I want to solve: the element has been destroyed, the scope has the $$destroyed attribute set to true, but it is still in memory. If there is no Angular way to get that and I am left with standard Javascript profiling please let me know and I would delete the question (as it probably becomes a duplicate with standard memory leaks detection methods).
answer count: 1
downvote count: 0
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
tagged with: memory-leaks

http://stackoverflow.com/a/29986604
has comment: http://stackoverflow.com/comment/48092746
upvote count: 6
has comment: http://stackoverflow.com/comment/48093360
answers question: http://stackoverflow.com/q/29986571
has body: You need to implement what server must response on / requests. For example: app.get('/', function(req, res, next) { res.send("Hello world"); }); Without it, express doesn't know how to handle /.
has comment: http://stackoverflow.com/comment/48092614
score: 6
type: Answer
downvote count: 0
has comment: http://stackoverflow.com/comment/48093180

http://stackoverflow.com/q/29872201
score: 0
has comment: http://stackoverflow.com/comment/47869590
answer count: 1
tagged with: jquery
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has title: HTML JQuery: Pass selected value onclick to elements name
type: AnsweredQuestion
upvote count: 2
has comment: http://stackoverflow.com/comment/47869626
downvote count: 2
has comment: http://stackoverflow.com/comment/47869561
has answer: http://stackoverflow.com/a/29872386
accepted answer: http://stackoverflow.com/a/29872386
has body: I currently have a dropdown menu so the user can select an option to refine their search by like so: Toggle Dropdown restaurant beauty salon bars other What I am wanting to do is when an option is selected from the drop down menu to update an elements name so I can then access whatever was selected on the form afters its been submitted. At the minute ive got this: $(document).ready(function(){ $('ul.dropdown-menu li').click(function() { var field = document.createElement("input"); field.name=$(this).find("span.t").text(); } }); }); How would I go about doing what i specified because I am a little unsure
type: Question
tagged with: javascript
tagged with: forms
has comment: http://stackoverflow.com/comment/47869611

http://stackoverflow.com/q/29957005
downvote count: 0
tagged with: javascript
score: 1
favorite count: 0
type: Question
tagged with: meteor
has answer: http://stackoverflow.com/a/29957202
upvote count: 1
tagged with: geojson
answer count: 1
has body: I have the following Mongo call, how do I return a sorted list of places depending on the nearest geo coordinates? Venues.find({'location.coordinates': { $near : { $geometry : { type : "Point" , coordinates: params.coordinates } }, $maxDistance : 10000 } });
type: UnansweredQuestion
tagged with: mongodb
has title: How do I sort a Mongo collection by geocoordinates near

angular-ui-grid
tags question: http://stackoverflow.com/q/29990700
tags question: http://stackoverflow.com/q/29864939
tag name: angular-ui-grid
tags question: http://stackoverflow.com/q/29874536
type: Tag
tags question: http://stackoverflow.com/q/29852849

http://stackoverflow.com/comment/48084639
type: Comment
type: QuestionComment
has text: `$rootScope.userLogged` is not going to be set on the new page after reload, since Angular app completely reinitialize all the services and scopes after new page load.
comment on: http://stackoverflow.com/q/29982574
score: 0

http://stackoverflow.com/comment/48121946
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/30001502
score: 1
has text: Yeah, IE8 has one foot in the grave!

http://stackoverflow.com/a/29972568
type: Answer
has comment: http://stackoverflow.com/comment/48069104
has comment: http://stackoverflow.com/comment/48068249
has comment: http://stackoverflow.com/comment/48069130
has comment: http://stackoverflow.com/comment/48068550
has comment: http://stackoverflow.com/comment/48069007
has comment: http://stackoverflow.com/comment/48065186
score: 0
has body: Your Content-length isn't right. It's set to the length of user but you send more than that in the POST data. It seems the web server is cutting your data up to the wrong length, then can't parse the malformed string. Make your POST data into a variable, so you can get the length without duplicating it: var data = "type="+encodeURIComponent(type)+"&amp;user="+encodeURIComponent(user); request.setRequestHeader("Content-length", data.length); Then when you call send: request.send(data); Side note: added encodeURIComponent to properly encode the values.
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29972255
has comment: http://stackoverflow.com/comment/48071152
accepted answer of: http://stackoverflow.com/q/29972255

http://stackoverflow.com/comment/47969635
comment on: http://stackoverflow.com/a/29923295
score: 0
type: AnswerComment
has text: Im not sure what you mean sorry, (a dev newbie).. but I have it on a test server? http://37.61.236.221/~langtonsco/menu/
type: Comment

http://stackoverflow.com/a/29902243
has comment: http://stackoverflow.com/comment/47973141
score: 0
has comment: http://stackoverflow.com/comment/47929047
type: Answer
has body: There are a few issues with your code but I think the specific issue here is that your HTML markup for each option is incorrect. It should be: &lt;option value="{0}"&gt;{1}&lt;/option&gt; However, you'd be better off returning an array of Car objects to your JS function and creating the HTML in a JS for loop; sending HTML down the pipe is not very efficient. This could be a typo, but you refer to Car and Cars (Car is the syntactically correct version). Also, you've got Cars.objects.none() as the form's queryset. You need Cars.objects.all().
has comment: http://stackoverflow.com/comment/47927374
answers question: http://stackoverflow.com/q/29900914
has comment: http://stackoverflow.com/comment/47927478

servlets
tags question: http://stackoverflow.com/q/29879562
tags question: http://stackoverflow.com/q/29942173
tags question: http://stackoverflow.com/q/29952178
tags question: http://stackoverflow.com/q/29876525
tags question: http://stackoverflow.com/q/29880224
tag name: servlets
tags question: http://stackoverflow.com/q/29913454
type: Tag
tags question: http://stackoverflow.com/q/29941627
tags question: http://stackoverflow.com/q/29973786
tags question: http://stackoverflow.com/q/29875532

http://stackoverflow.com/comment/47849225
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29861778
score: 2
has text: just show what code you tried, and facing errors, so we will help.

http://stackoverflow.com/a/36255439
answers question: http://stackoverflow.com/q/29958777
score: 0
type: Answer
has body: It may be a bug on React Native old version. you should update your version. check this: https://github.com/facebook/react-native/issues/2904

http://stackoverflow.com/q/29858836
favorite count: 0
upvote count: 8
has answer: http://stackoverflow.com/a/29859713
tagged with: http://stackoverflow.com/tag/html
has title: Javascript Image() missing `Origin` header when loading src
has body: Having a fun time with canvas and particularly Google Chrome. Right now I'm loading an image via Javascript that is to be used in a canvas wrapped with EaselJS. Here's how I'm loading the image (hosted on S3): imageLoad: function(imageUrl, imageId) { var image = new Image(); image.crossOrigin = "Anonymous"; image.imageId = imageId image.onload = this.handleImageLoad; image.src = imageUrl; } Images are stored on an Amazon S3 bucket with the following CORS properties: <?xml version="1.0" encoding="UTF-8"?> * GET 1 * The Problem It appears that the browser is not setting the Origin header when loading the image above. This particularly happens if the image has already been loaded outside of javascript and cached by the browser. However - and here's where it gets weird - once a second attempt is made to load the image using Javascript, then CORS security issues go away (and apparently the browser sets an Origin header). We've tested this behavior multiple times, and also confirmed it by setting up a server that forces CORS headers with each response. It does appear that the browser is not adding Origin headers even when asked explicitly. The Question So given all of this information, what can we do to work around the problem? Can Amazon CloudFront be forced to always add CORS headers? Is there a problem with image.crossOrigin = "Anonymous"?
type: UnansweredQuestion
type: Question
tagged with: cors
score: 8
has comment: http://stackoverflow.com/comment/105644932
downvote count: 0
answer count: 1
tagged with: javascript

http://stackoverflow.com/a/29969063
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29968605
has body: Your variable filters is an array. I think it should be a string to work. So just do that: var filters = []; filters.push(selector); filters = filters.join(', '); In fact, if you'll only use one filter at a time (as it appears), you can use your variable selector directly, as it already contains your filter class name. Hope it helps!
type: Answer
has comment: http://stackoverflow.com/comment/48058115
has comment: http://stackoverflow.com/comment/48060543
has comment: http://stackoverflow.com/comment/48060139
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/29968605
has comment: http://stackoverflow.com/comment/48059812
upvote count: 1

http://stackoverflow.com/a/29900816
upvote count: 1
has body: as outlined in google's specification under 'Role of the Search Engine Crawler' it states The search engine agrees to display in the search results the corresponding pretty URLs: thus, http://www.example.com/#!veryAwsomeDynamicPage is displayed in the search results while google fetches the content on http://www.example.com/?_escaped_fragment=veryAwsomeDynamicPage so http://www.example.com/#!veryAwsomeDynamicPage shall be in the sitemap.xml
score: 1
answers question: http://stackoverflow.com/q/29895733
accepted answer of: http://stackoverflow.com/q/29895733
type: AcceptedAnswer
downvote count: 0
type: Answer

http://stackoverflow.com/comment/47836736
has text: To abide by the rules here on StackOverflow, you should paste the code that is relevant to your question directly into your question. StackOverflow does not allow questions who's only reference to required code is in an external link because these external links have a habit of disappearing or getting changed rendering the original question worthless in the future.
comment on: http://stackoverflow.com/q/29855166
score: 1
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47908835
type: Comment
score: 0
comment on: http://stackoverflow.com/a/29892220
type: AnswerComment
has text: Check out my code here : http://meteorpad.com/pad/NzPH5k4hnvNm5gtyz/Youtube for an example. :)

http://stackoverflow.com/comment/48037474
type: QuestionComment
has text: @SethT It should be up to us to promote best practices and not even mention poor ones. All that does is promote laziness and produce bad developers.
score: 0
comment on: http://stackoverflow.com/q/29927952
type: Comment

http://stackoverflow.com/q/29898816
score: 2
has answer: http://stackoverflow.com/a/29898869
type: AnsweredQuestion
upvote count: 2
tagged with: switch-statement
type: Question
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29898869
tagged with: arrays
downvote count: 0
answer count: 1
tagged with: jquery
favorite count: 0
has body: So my friends and I have boon working on an app for the past few days, only issue is that neither of us know JavaScript. It went well until this point. I have learned a bunch from googling but I just can not seem to solve this problem. So we have a drop down menu that calls a function, select id="vg" class="dropdown" onchange="vgchosen.call(this, event)"&gt; this brings us down to our function, titled vgchosen. in this function, there is a switch method that is there to help evaluate witch drop down menu option was picked. function vgchosen(event) { alert(this.options[this.selectedIndex].text); var vgc = document.getElementById("vg").selectedIndex; var y = document.getElementById("vg").options; switch (y[vgc].text) { case "Action": var actionvgc = [ "You should play |Skyrim", "You should play |Killing Floor 2", "You Should play |Counter Strike Global Offensive", "You should play |Left 4 Dead", "You should play |House of the Dead", "You should play |Elite: Dangerous", "You should play |Middle Earth: Shadow of Mordor", "You should play |Crypt of the Necro Dancer", "You should play |The Witcher 3: Wild Hunt", "You should play |Dark Souls", ]; setInterval(function() { var i = Math.round((Math.random()) * actionvgc.length); if (i == actionvgc.length) --i; $("#actionvgc").html(actionvgc[i]); }, 1 * 1000); break; case "Shooter": var shootervgc = [ "You should play |Skyri", "You should play |Killing Floor ", "You Should play |Counter Strike Global Offensiv", "You should play |Left 4 Dea", "You should play |House of the Dea", "You should play |Elite: Dangerou", "You should play |Middle Earth: Shadow of Mordo", "You should play |Crypt of the Necro Dance", "You should play |The Witcher 3: Wild Hun", "You should play |Dark Soul", ]; setInterval(function() { var i = Math.round((Math.random()) * shootervgc.length); if (i == shootervgc.length) --i; $("#actionvgc").html(shootervgc[i]); }, 1 * 1000); break; } } when you start the function with a option selection, everything works fi…
has title: stop a nested if loop that is inside a switch method | Javascript

http://stackoverflow.com/q/29900887
tagged with: ios
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/29901481
score: 0
tagged with: cordova
type: UnansweredQuestion
has title: Cordova/PhoneGap and iOS Session Persistence
type: Question
has body: I'm running a Cordova app with Angular on the front-end and Node.js/Express + Passport on the backend. Everything is dandy, but my user sessions don't persist on iOS. Closing and reopening the app on an iOS effectively logs a user out. How can I persist the session/cookies on an iOS device? Can I achieve this with JavaScript or will I have to change settings in the iOS build?

http://stackoverflow.com/a/29929563
type: Answer
has comment: http://stackoverflow.com/comment/47981752
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29929307
score: 1
answers question: http://stackoverflow.com/q/29929307
has body: There seems to be a span on top of your input field. You can focus on the input field if you simply remove the code below:
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/comment/47974367
has text: Notice that `Promise.each` doesn't cover recursion.
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29926059

http://stackoverflow.com/comment/47981001
type: Comment
type: QuestionComment
has text: put your style attribute on the iframe directly instead. What is not working in this? Give us more details please !
comment on: http://stackoverflow.com/q/29929265
score: 0

http://stackoverflow.com/q/29885618
upvote count: 2
answer count: 3
has comment: http://stackoverflow.com/comment/48227091
downvote count: 1
tagged with: variables
tagged with: string
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47895389
has title: What do curly brackets mean in a variable declaration?
has answer: http://stackoverflow.com/a/29885650
score: 1
has answer: http://stackoverflow.com/a/29885641
type: Question
has body: What do curly brackets ({}) do in variable declarations, when surrounding multiple pairs of the form integer:string? For example, what do they mean here? char = {0:'(',3:') ',6:' - '}; In this case, it's from the following phone number formatting script: function formatPhone(obj) { var numbers = obj.value.replace(/\D/g, ''), char = {0:'(',3:') ',6:' - '}; obj.value = ''; for (var i = 0; i &lt; numbers.length; i++) { obj.value += (char[i]||'') + numbers[i]; } } I believe that the line defining char is the one that's causing it to fail.
tagged with: character-arrays
tagged with: javascript
has answer: http://stackoverflow.com/a/29885639

http://stackoverflow.com/q/29896492
has comment: http://stackoverflow.com/comment/47936351
has answer: http://stackoverflow.com/a/29896830
downvote count: 0
accepted answer: http://stackoverflow.com/a/29896830
has body: I have two times with hh:mm:ss a format. like var StartTime="11:50:33 AM"; var EndTime= "10:50:33 AM; I want the validation for EndTime &gt; StartTime. i need compare the two times. If StartTime is greater than EndTime, then i want to show a error message If EndTime is greater than StartTime, then i want to run next code. I have tried this below code var t1 = moment($scope.StartTime, "hh:mm:ss a"); var t2 = moment($scope.EndTime, "hh:mm:ss a"); var t3 = moment(t2.diff(t1)).format("hh:mm:ss"); But this make does not well.
favorite count: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/29897001
tagged with: momentjs
type: AnsweredQuestion
has title: compare validation between two (hh:mm:ss a) times in moment.js
score: 1
has answer: http://stackoverflow.com/a/29897358
upvote count: 1
type: Question
possible better answer: http://stackoverflow.com/a/29897358
tagged with: javascript
answer count: 3

http://stackoverflow.com/q/29857847
has answer: http://stackoverflow.com/a/29858156
has comment: http://stackoverflow.com/comment/47841667
has answer: http://stackoverflow.com/a/29857955
tagged with: javascript
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/47841694
answer count: 5
tagged with: http://stackoverflow.com/tag/html
downvote count: 1
has answer: http://stackoverflow.com/a/29858567
has answer: http://stackoverflow.com/a/29858175
has comment: http://stackoverflow.com/comment/47841730
upvote count: 0
has title: Deleting certain html blocks from HTML String - Javascript or Jquery
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47841756
has comment: http://stackoverflow.com/comment/47942936
has comment: http://stackoverflow.com/comment/47841698
type: Question
has body: I have a certain HTML string which roughly looks like follows : 1 a 5 4 I want to write a generalized function that takes an integer as input. If, for example input = 2, the function should return an HTML string that is like this 1 a If input parameters = 3 1 a 5 and so on. Any suggestions to how I can achieve this ?
has answer: http://stackoverflow.com/a/29858017
score: -1
has comment: http://stackoverflow.com/comment/47841621
has comment: http://stackoverflow.com/comment/47841769

http://stackoverflow.com/a/29927053
has body: You need to Parse your JSON Response before accessing it: var restourantAddressRequest = "https://maps.googleapis.com/maps/api/geocode/json?latlng="+restLatitude+","+restLongtitude+"&amp;key=API_KEY"; var json= JSON.parse(restourantAddressRequest); //alert(restourantAddressRequest.results.formatted_address); $("#restaurant_address").html("Address: " + restourantAddressRequest.results.formatted_address); Hope this will work.
answers question: http://stackoverflow.com/q/29926720
type: Answer
has comment: http://stackoverflow.com/comment/47976171
downvote count: 0
score: 1
upvote count: 1

http://stackoverflow.com/q/29949344
favorite count: 0
has title: How to remove object/array from javascript variable?
type: UnansweredQuestion
upvote count: 1
has comment: http://stackoverflow.com/comment/48020209
score: 0
has comment: http://stackoverflow.com/comment/48019592
has answer: http://stackoverflow.com/a/29949477
downvote count: 1
type: Question
has body: How to remove object/array from javascript variable?
tagged with: javascript
answer count: 2
has answer: http://stackoverflow.com/a/29949381
linked to: http://stackoverflow.com/q/19544452

http://stackoverflow.com/q/29954507
accepted answer: http://stackoverflow.com/a/29966606
has body: I need to display a report in a new window when i click in a dock item, the report is generated but the window does not open. XHTML code: &lt;p:layoutUnit position="south" size="60"&gt; &lt;p:dock&gt; &lt;p:menuitem value=".PDF" icon="/images/dock/pdf.png" action="#{RelatorioPlanoAquisicaoBIDMB.btnGerarRelatorioOnClick()}" onclick="this.disabled=true" ajax="false" oncomplete= "this.disabled=false; javascript:ResourceNews('relatorios/#{RelatorioPlanoAquisicaoBIDMB.chaveArquivo}-relatorio_plano_aquisicao.pdf','750','550','no')" update="growl" /&gt; &lt;p:menuitem value="Sair" icon="/images/dock/sair.png" action="#{RelatorioPlanoAquisicaoBIDMB.btnSairOnClick()}" onclick="this.disabled=true" /&gt; &lt;/p:dock&gt; &lt;p:ajaxStatus style="margin:15px;margin-right:25px;margin-bottom:0px; text-align:right"&gt; &lt;f:facet name="start"&gt; &lt;p:graphicImage value="../images/gifs/ajax-loader2.gif" /&gt; &lt;/f:facet&gt; &lt;/p:ajaxStatus&gt; JavasCript code: function ResourceNews(url, l, a, s){ var x = parseInt((screen.width-l)/2); var y = parseInt((screen.height-a)/2); var win = window.open(url,'','width='+l+',height='+a+',scrollbars='+s); win.moveTo(x,y); } The method that opens a new window has to be invoked in "onComplete", because the window has to open only when the report is ready. But it doesn't open, it opens only if is in "onclick", but in this case the system doesn't find the .pdf because it hasn't finished being generated. Any idea how to solve this problem?
type: AnsweredQuestion
score: 0
type: Question
has comment: http://stackoverflow.com/comment/48029804
tagged with: primefaces
has answer: http://stackoverflow.com/a/29966606
tagged with: http://stackoverflow.com/tag/xhtml
tagged with: javascript
has title: when I try to open a new browser window using js in XHTML, the window does not open
answer count: 1

http://stackoverflow.com/comment/48031919
type: AnswerComment
comment on: http://stackoverflow.com/a/29955518
type: Comment
has text: Thank you, but this seems to just replace the entire first line. I really need to isolate the single quotes in the case of this inevitably changing.
score: 0

http://stackoverflow.com/a/35794200
type: Answer
has body: According to this webpage, the driver is closed-source. There is now an open-source driver that has been integrated into the kernel as of December 2013. To use it, simply update your Raspberry Pi and run: sudo modprobe bcm2835-v4l2 To have the device node /dev/video0 created. You can now use v4l2 compatible applications instead of uv4l, of which, there is greater availability.
score: 0
answers question: http://stackoverflow.com/q/29862997

http://stackoverflow.com/comment/47975613
comment on: http://stackoverflow.com/q/29926677
has text: It looks like you are `serializeArray` to get the data (which btw returns an array of objects, not JSON). In that case you might want to have a look at [Convert form data to JavaScript object with jQuery](http://stackoverflow.com/q/1184624/218196)
type: Comment
type: QuestionComment
score: 3

http://stackoverflow.com/q/29979696
accepted answer: http://stackoverflow.com/a/29979731
has body: I have an object called Breadcrumb, which has a function expandEllipses. The following works fine: mbc = jQuery('#breadcrumb').breadcrumb({ items : initItems }); jQuery("body").on("click", ".breadcrumb .breadcrumbEllipses", function(e) { mbc.expandEllipses(); }); However, I was wondering how to do this in a jQuery event handler where I don't have the object right there with me: jQuery("body").on("click", ".breadcrumb .breadcrumbEllipses", function(e) { parObj = &lt;parent of the .breadcrumbEllipses instance that triggered this event&gt; protoObj = &lt;Prototype object from parentObj&gt; protoObj.expandEllipses(); }); This is what ended up working from Barmar's answer: jQuery.fn.breadcrumb = function(options) { var bc = new Breadcrumb(this, options); this.data('breadcrumb', bc); return bc; }; jQuery("body").on("click", ".breadcrumb .breadcrumbEllipses", function(e) { bcObj = jQuery(this).closest(".breadcrumb").data("breadcrumb"); bcObj.expandEllipses(); });
downvote count: 2
answer count: 1
favorite count: 0
type: AnsweredQuestion
upvote count: 0
has title: Call Prototype Object Method in JQuery Event Handler
tagged with: prototype
type: Question
score: -2
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29979731

http://stackoverflow.com/comment/48106178
has text: I don't see this error in my console , I am working on my local host and the local files "remote files" are in the same directory as the html page.
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29989256

http://stackoverflow.com/q/29959451
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/48040343
tagged with: css
has body: I am trying bouncing effect using css3 key-frame animation. here is fiddle link: click Background of box is changing but my requirement is to give bouncing effect to background image not background color. What exactly I need: A bouncing(jumping) teddy on trampoline with two states: (1. with arms up, 2. with arms down) while jumping. Any ideas how to achieve it? Thank you!
has comment: http://stackoverflow.com/comment/48040323
upvote count: 2
type: UnansweredQuestion
score: 2
type: Question
downvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/29960070
has comment: http://stackoverflow.com/comment/48040307
has comment: http://stackoverflow.com/comment/48040235
has title: Bouncing effect using css3 keyframes animation

http://stackoverflow.com/a/29985143
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/48101101
has comment: http://stackoverflow.com/comment/48099291
upvote count: 1
type: Answer
has body: Use AJAX. That way your PHP script will be run "in the background" and you'll be able to redirect your user to a new page on success. Below is a simple jQuery example. &lt;script&gt; function runScript() { $.get( "file.php", function() { window.location = "http://www.pagetoredirectto.com/" }); } &lt;/script&gt;
answers question: http://stackoverflow.com/q/29984943

http://stackoverflow.com/a/29979157
downvote count: 0
answers question: http://stackoverflow.com/q/29949928
type: Answer
has body: Thanks Tapani and Michael, Your help definitely pointed me in the right direction. With the info you provided I was able to find more info on the spec and what browsers support the api. Chrome 42.0.2311.90 (64-bit) does not seem to support the battery API. Chromium Version 22.0.1225.0 (149762) also does not support the battery API. Chrome Canary Version 44.0.2387.0 canary (64-bit) supports the spec on MDN (https://developer.mozilla.org/en-US/docs/Web/API/Battery_Status_API) but does not support the navigator.battery namespace. Firefox supports the navigator.battery namespace but does not support the navigator.getBattery() function. Safari Version 8.0.5 (10600.5.17) doesn't support anything referring to the battery api that I can tell. I didn't get around to checking this on mobile but I don't suspect that mobile browsers would be more consistent api or even have it implemented better than any of the above browsers. Seems fairly new and the browsers organizations are still trying to figure out and are struggling to follow the documented spec. Reminds me a bit of CSS flex-box a bit. Thanks guys!
accepted answer of: http://stackoverflow.com/q/29949928
score: 4
upvote count: 4
type: AcceptedAnswer

http://stackoverflow.com/comment/48007860
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29942120
has text: No, this does *not* print out `1` after 100ms. It does so only when you call `o.foo()` somewhere!
score: 0

http://stackoverflow.com/comment/52101771
type: AnswerComment
has text: You should probably add `--save`, like this: `npm install react-native-button --save`.
comment on: http://stackoverflow.com/a/29911085
type: Comment
score: 3

http://stackoverflow.com/q/29955406
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/48031988
has title: Select all single quotes from the first row using regex
upvote count: 1
has answer: http://stackoverflow.com/a/29955518
answer count: 7
has comment: http://stackoverflow.com/comment/48031736
has answer: http://stackoverflow.com/a/29955711
tagged with: regex
possible better answer: http://stackoverflow.com/a/29955647
accepted answer: http://stackoverflow.com/a/29955711
has answer: http://stackoverflow.com/a/29955868
favorite count: 0
has body: Say I have a string which would render as: ('First Name', 'Last Name') ('Thomas', 'Jenkins') ('Samuel', 'Adams') In reality the string would look something like this (unformatted): ('First Name', 'Last Name')\n ('Thomas', 'Jenkins')\n ('Samuel', 'Adams') How would I, using just Regex, select the the single quotes from just the first row from this text (everything before the first \n)? Note that this is just example text and the actual text could have several more fields of single quotes. My ultimate goal here would be to use a replace to change those single quotes ' to double quotes ". I see that I can select the first using something like ^[^\n]*, but how in the world do I select the single quotes from the bunch? Thank you for your time. Edit: The end result would be something like the following (first row has double quotes): ("First Name", "Last Name") ('Thomas', 'Jenkins') ('Samuel', 'Adams')
has comment: http://stackoverflow.com/comment/48031861
has comment: http://stackoverflow.com/comment/48031602
has comment: http://stackoverflow.com/comment/48032403
has answer: http://stackoverflow.com/a/29956015
has comment: http://stackoverflow.com/comment/48031778
has comment: http://stackoverflow.com/comment/48031723
has comment: http://stackoverflow.com/comment/48031881
has comment: http://stackoverflow.com/comment/48031618
has comment: http://stackoverflow.com/comment/48032094
has comment: http://stackoverflow.com/comment/48031798
type: AnsweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/48031955
has answer: http://stackoverflow.com/a/29955741
has answer: http://stackoverflow.com/a/29955647
has comment: http://stackoverflow.com/comment/48032120
type: Question
has comment: http://stackoverflow.com/comment/48031992
has answer: http://stackoverflow.com/a/29955515

http://stackoverflow.com/comment/47840779
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29855739
has text: I updated testcase with changed jquery.jqgrid.src.js from github but problem persists.

http://stackoverflow.com/q/29978007
upvote count: 2
answer count: 3
has comment: http://stackoverflow.com/comment/48075681
has comment: http://stackoverflow.com/comment/48075975
has answer: http://stackoverflow.com/a/51798392
has body: I;m trying to implement lodash to refactor this for loop, what would BE THE best way to go for it _.filter or a _.forEach ? for(var i = 0; i &lt; origPam.length; i ++){ if(origPam[i].editor.mapped !==newPam[i].editor.mapped){ $scope.$apply(); } }
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/48075904
tagged with: for-loop
score: 2
has answer: http://stackoverflow.com/a/29978392
tagged with: arrays
downvote count: 0
favorite count: 0
has title: How to refactor a for loop with lodash _.filter vs _.forEach?
tagged with: angularjs
type: Question
has comment: http://stackoverflow.com/comment/48076417
tagged with: lodash
has answer: http://stackoverflow.com/a/29994345

http://stackoverflow.com/comment/47929029
has text: thanks @SirDemon, i've tried this one already .. (I didnt have much luck) as the table doesn't get sorted (on click) just the arrows near the title changes ... but anyway an answer with keeping the ` ` will be better as it part of my table design .. (css)ed
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29894198

http://stackoverflow.com/a/29946627
type: Answer
has comment: http://stackoverflow.com/comment/48014172
answers question: http://stackoverflow.com/q/29946368
has comment: http://stackoverflow.com/comment/48014241
upvote count: 2
has comment: http://stackoverflow.com/comment/48014528
has comment: http://stackoverflow.com/comment/48014442
score: 2
accepted answer of: http://stackoverflow.com/q/29946368
has comment: http://stackoverflow.com/comment/48014358
has comment: http://stackoverflow.com/comment/48014313
has comment: http://stackoverflow.com/comment/48014589
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/48014500
downvote count: 0
has comment: http://stackoverflow.com/comment/48014266
has body: The answer is case 3. The browser will send all requests in the order you make them. Generally speaking a computer will carry out your instructions in the order your issue them. If you want or need special behavior such as throttling the rate of the requests or not sending the subsequent requests until prior ones have finished you will need to implement that your self.

http://stackoverflow.com/comment/47986931
score: 0
has text: Isn't the data pushed during the each loop though?
comment on: http://stackoverflow.com/q/29932238
type: Comment
type: QuestionComment

mpd
tag name: mpd
type: Tag
tags question: http://stackoverflow.com/q/29878363

http://stackoverflow.com/q/29918690
upvote count: 0
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
has body: How can I determine if some particular div has any child existed inside dom // does this particular div has any child? ...
has answer: http://stackoverflow.com/a/29918877
has answer: http://stackoverflow.com/a/29918948
has answer: http://stackoverflow.com/a/29918742
linked to: http://stackoverflow.com/q/2161634
score: -1
has answer: http://stackoverflow.com/a/29918798
favorite count: 0
duplicate of: http://stackoverflow.com/q/2161634
type: Question
tagged with: css
has answer: http://stackoverflow.com/a/29918799
answer count: 6
has answer: http://stackoverflow.com/a/29918769
has title: determine if particular div has any child existed inside dom
downvote count: 1
has comment: http://stackoverflow.com/comment/47958483

http://stackoverflow.com/q/29969398
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/48058786
tagged with: javascript
has title: Angularjs ng-hide animation not working
accepted answer: http://stackoverflow.com/a/29980523
has comment: http://stackoverflow.com/comment/48058757
has comment: http://stackoverflow.com/comment/48058792
tagged with: angularjs
type: Question
tagged with: animation
has comment: http://stackoverflow.com/comment/48059252
tagged with: css
has body: I tried angularjs animation from this plunker. But on my local, animation is not working. Normal hide/show is working but animation is not shown. My code is al below: index-show.html LEFT RIGHT this is just a sample div {{myValue}} app-show.css .animate-hide { -webkit-transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 2s; -moz-transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 2s; -o-transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 2s; transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 2s; line-height:20px; opacity:1; padding:10px; border:1px solid black; background:white; position: absolute; left: 0; } .animate-hide.ng-hide { left: -100%; opacity:0; padding:0 10px; } app-show.js var app = angular.module("myApp1", ["ngAnimate"]); app.controller("MyCtrl", function ($scope) { $scope.myValue=false; }); Please let me know what I am missing??
has comment: http://stackoverflow.com/comment/48059256
score: 0
has comment: http://stackoverflow.com/comment/48058913
answer count: 1
has answer: http://stackoverflow.com/a/29980523
has comment: http://stackoverflow.com/comment/48059673

http://stackoverflow.com/q/29920645
has comment: http://stackoverflow.com/comment/47963187
tagged with: asp.net-mvc
has title: Jquery combobox set selected value
tagged with: javascript
tagged with: jquery
score: 0
has comment: http://stackoverflow.com/comment/47963195
has comment: http://stackoverflow.com/comment/47962725
type: UnansweredQuestion
tagged with: combobox
has body: My code is the following: View @Html.LabelFor(m => m.Employee.ManagerId) @Html.DropDownListFor(m => m.Employee.ManagerId, Model.Employee.ManagerList, new { @placeholder = "Select a Manager...", @disabled = "true" }) @Html.ValidationMessageFor(m => m.Employee.ManagerId) View (Jquery Code) This functions calls the controller in order to get the list that will be filled in ManagerList. function RefreshManagers(engineerSelected) { if (engineerSelected != "") { $.ajax({ url: '@Url.Action("ReloadManagersByEmployee", "Locator")', type: 'POST', data: { employeeId: engineerSelected }, success: function (data) { $("#Employee_ManagerId").empty(); $.each(data.managers, function (index, optiondata) { $(document.createElement('option')) .attr('value', optiondata.Value) .text(optiondata.Text) .appendTo($("#Employee_ManagerId")); }); $("#Employee_ManagerId").combobox("refresh"); }, error: function (xhr) { alert("Unable to reload managers"); } }); } else { $("#Employee_ManagerId").empty(); $("#Employee_ManagerId").append(" Select a Manager... "); } $("#Employee_ManagerId").combobox("refresh"); } Controller: The controller returns the following: public JsonResult ReloadManagersByEmployee(string employeeId) { //Do the stuff...call the corresponding service and get the list, then: return Json(new { managers = managerList }); } Note: When creating the list 'managerList' I have already pre-selected the value that I want to show. Problem: The selected manager (previously selected when creating the list) is not correctly set when JQuery creates the combobox. I have checked the list just before returning it to the view and is correctly set. Question: Once the RefreshManagers() function loads the manager list, how can I do to change the selected value of that list to the one already selected in the controller? Question 2: The Manager list is refreshed correctly by applying the change that @Stephen Muecke told but when passing the model to the controller, the manager id selected is not passed…
answer count: 0
type: Question
tagged with: c#

http://stackoverflow.com/comment/48048649
has text: @SureshKumar - simple, you need to change `height` to `max-height`, in the above, simply replace `200px` for the largest forseeable potential height. Note that the element wont grow to that height, it will only grow to the height needed for its contents, up to that value. As such, the element will only grow as high as its contents.
comment on: http://stackoverflow.com/a/29961810
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/47891894
has text: Regex is pretty damn fast, super compact and will save you hundreds of lines of coding down the road. And *it's not even that hard to learn*. Don't be intimidated by it! Even after learning just the basics, several string-related problems will become trivial to you.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29883892

http://stackoverflow.com/comment/47957475
has text: https://jsfiddle.net/#&togetherjs=J7xoDyscuw this is a jsFiddle just we need to include the _timer and the angular script because in the jsFiddle it is my path
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29916797

http://stackoverflow.com/q/29859313
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47906260
tagged with: css
answer count: 0
downvote count: 0
score: 1
type: Question
has title: Tumblr Custom Description on Tagged Pages
tagged with: javascript
has body: I want to put up a header with description on the top of the tagged page Example: http://splexlibrary.tumblr.com/tagged/clothing I want a custom description under "#clothing" with links and text.. preferably in a new box. But, I want this to be different in specific tags. Example, new links and text in "#build mode" and so on. (I know this has been asked before, but hopefully its someone seeing this that knows)
upvote count: 1

http://stackoverflow.com/comment/48077110
has text: Well i tried removing the " charatcer using javascript regex. It stil gave the same error
type: QuestionComment
comment on: http://stackoverflow.com/q/29976787
type: Comment
score: 0

http://stackoverflow.com/comment/48085231
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29977774
score: 0
has text: Yeah, I was afraid of that. The actual html structure is a jumbled mess created by a Woocommerce Product Options plugin. I'll post a live link when I publish the site. Right now it's just on my local server.

http://stackoverflow.com/q/29866507
tagged with: cookies
downvote count: 1
type: Question
tagged with: javascript
score: -1
upvote count: 0
has body: I'm trying to write two functions to set and get a cookie that save the user favorite background-color : function set_background_cookie(){ if ( navigator.cookieEnabled ) { favColor = window.prompt( "insert your favorite color please : " , "") ; document.body.style.backgroundColor = favColor ; document.cookie = "favoriteColor=" + favColor + ";" + "expires=Sat, 25 Apr 2020 12:11:05 GMT" ; } } function get_background_cookie(){ var start , End , color ; var CookiesArray = document.cookie.split(';') ; start = CookiesArray[0].indexOf('='); End = start + CookiesArray.length ; color = CookiesArray[0].substring(start + 1 , End ) ; document.body.style.backgroundColor = color ; } setting the cookie is perfect but I have a problem with getting it what was my problem ?? this is the whole page : &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;script&gt; function get_background_cookie(){ var start , End , color ; var CookiesArray = document.cookie.split(';') ; start = CookiesArray[0].indexOf('='); End = start + CookiesArray.length ; color = CookiesArray[0].substring(start + 1 , End ) ; document.body.style.backgroundColor = color ; } function set_background_cookie(){ if ( navigator.cookieEnabled ) { favColor = window.prompt( "insert your favorite color please : " , "") ; document.body.style.backgroundColor = favColor ; document.cookie = "favoriteColor=" + favColor + ";" + "expires=Sat, 25 Apr 2020 12:11:05 GMT" ; } } window.onload = function(){ set_background_cookie(); get_background_cookie(); } &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;/body&gt; &lt;/html&gt;
has answer: http://stackoverflow.com/a/29866706
answer count: 1
favorite count: 0
type: UnansweredQuestion
has title: javascript background cookie

http://stackoverflow.com/a/29981673
score: 0
type: Answer
has body: Try this. The problem is that you are using Same declared array for each alternatives. So to solve this, you just need to move that array inside the loop, so that every alternative gets it's own fresh array. var alternatives = [{id_alternative : 40},{id_alternative : 47},{id_alternative : 56}] $.each(alternatives, function(index, item){ item.answers = [{alternative:0},{alternative:0},{alternative:0}];//with three objects in here; $.each(item.answers, function(i, ans){ ans.alternative = item.id_alternative; }); }); console.log(alternatives); &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
answers question: http://stackoverflow.com/q/29981605

http://stackoverflow.com/a/29988120
has comment: http://stackoverflow.com/comment/48096853
answers question: http://stackoverflow.com/q/29987763
accepted answer of: http://stackoverflow.com/q/29987763
type: AcceptedAnswer
upvote count: 2
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/48096084
has body: You appear to have two issues: 1) You don't want a post to be created if the textarea is empty Simple fix . . . check to see if it is empty, before calling the logic to add the new post (and use jQuery's $.trim() to account for only blank spaces): $('#button').click(function() { var text = $.trim($('#poster').val()); if (text !== "") { $('#posts').prepend("&lt;div class='post'&gt;" + text + "&lt;span class='close-post'&gt;&amp;times;&lt;/span&gt;&lt;/div&gt;"); $('#poster').val(''); } }); 2) The 'X' buttons are not closing the posts This also should be a pretty easy fix . . . the reason that they are not working is because the 'X' buttons don't exist when the page is loaded so $('.close-post').click(function() { is not binding to them on page load. You will need to delegate that event binding, so that it will apply to the 'X' buttons that are dynamically added after the page is loaded. Now, not knowing what version of jQuery that you are using (I can't access jsFiddle from work), I'll point you to the right place to figure out the correct way to do it: https://api.jquery.com/on/ If it is jQuery 1.7 or higher, you would do it like this: $("#posts").on("click", ".close-post", function() { $(this).parent().hide(); }); If your version is earlier than that, then investigate the jQuery .delegate() and .live() methods to determine which is the right one to use for your code..
downvote count: 0

http://stackoverflow.com/a/67392420
type: Answer
score: 0
has body: this html worked in react getImage
answers question: http://stackoverflow.com/q/29975138

http://stackoverflow.com/a/29952887
has body: Well it seems they recently added this feature in the newest version with: data-search-text="Your Search Query"
upvote count: 1
score: 1
downvote count: 0
answers question: http://stackoverflow.com/q/29950697
type: Answer

pace.js
tag name: pace.js
type: Tag
tags question: http://stackoverflow.com/q/29860627

http://stackoverflow.com/comment/47824186
type: Comment
comment on: http://stackoverflow.com/a/29849001
has text: Thanks for the answer. If I don't use stop, after a few scrolls animations are getting messed up and doesn't load stable. I tried it before and I also tried it now after your answer but still no luck (atleast with my methods :))
score: 0
type: AnswerComment

http://stackoverflow.com/a/29857427
has body: The "best" way is pretty subjective. You'll see different answeres here and all over the web. Looking at your C# example, if you're goal is to replicate something similar to that class in an object orientated fashion, this might be a good starting point function MyObj () { this.Fours = 0; this.Sixes = 0; this.Eights = 0; this.Tens = 0; this.Twelves = 0; this.Twenties = 0; this.Hundreds = 0; this.RollDice = function() { console.log('here is a function') } }; Sample usage var myObj = new MyObj(); console.log(myObj); // -- MyObj {Fours: 0, Sixes: 0, etc... myObj.RollDice(); // -- here is a function JSFiddle Link
answers question: http://stackoverflow.com/q/29857143
has comment: http://stackoverflow.com/comment/47843454
has comment: http://stackoverflow.com/comment/47842751
has comment: http://stackoverflow.com/comment/47841032
downvote count: 0
has comment: http://stackoverflow.com/comment/47840973
type: Answer
score: 2
upvote count: 2

http://stackoverflow.com/q/29850174
downvote count: 0
tagged with: javascript
has body: I'm having a weird issue with pushState/popstate where it seems my initial page is saved twice. It's a bit hard to explain without an example. something like this: current page is www.bing.com copy/paste my URL into URL bar and page loads click on a link on the page (this link fires an AJAX request which then manipulates the DOM to display the data retrieved.) press back button which brings me to the same page as in step2 press back button again but I'm still on the the same page as step2/4 press back button again and this bring me back to www.bing.com As you can see, I need to press the back button twice to get me back to www.bing.com when it should have only needed 1. a short explanation of my page (code is at the bottom of the page): when the page loads, initial list for the dropdown selection is retrieved via AJAX and populates the select tag. user has option to click on 3 links which determine the contents of the dropdown selection. Example: If I click on Option B link, this fires the same AJAX from step1 but only retrieves data suitable for Option B. The user makes a selection from the dropdown and presses search. This triggers another AJAX function which retrieves the relevant data and displays the formatted information inside the mysearchresults div. I tried playing around with placement (e.g. before or after AJAX call) of pushState and the placement now seems the one that give me the least problem. Although I do encounter the issue I mentioned above. Here's my code. I had to strip out a lot of code/functions to make it short and readable but please be assured the AJAX calls/data display are working. Option B | Option H | Option BG Select your course Search Me $(document).ready(function() { var onClickCourseTypeHandler = function(event) { event.preventDefault(); getCourses({ type:$(event.target).data("type") }); window.history.pushState({ html:$("#content").html(), coursecode:$("#coursecode").val() }, "", main?type="+pagevars.type); } var onClicksearchbutton…
has comment: http://stackoverflow.com/comment/47894462
upvote count: 8
answer count: 4
favorite count: 0
has answer: http://stackoverflow.com/a/29926291
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29885388
accepted answer: http://stackoverflow.com/a/29926291
tagged with: pushstate
linked to: http://stackoverflow.com/q/20156939
has answer: http://stackoverflow.com/a/29885231
has answer: http://stackoverflow.com/a/52062829
possible better answer: http://stackoverflow.com/a/29885388
has title: weird issue with pushState/popstate - initial page seems to have been "pushed" twice
score: 8

http://stackoverflow.com/q/29856618
has comment: http://stackoverflow.com/comment/47839439
favorite count: 0
tagged with: cordova
has comment: http://stackoverflow.com/comment/47839588
has answer: http://stackoverflow.com/a/29857103
tagged with: node.js
type: AnsweredQuestion
score: 3
has title: Cordova: Sockets, PushNotifications, or repeatedly polling server?
has answer: http://stackoverflow.com/a/29857040
upvote count: 3
possible better answer: http://stackoverflow.com/a/29857103
has body: I have a Cordova/PhoneGap app. I'd like to have some semblance of real-time updates when the app is in the foreground. What's the least resource-intensive way to accomplish this? Should I use socket.io, pushnotification plugins, or just make an API request every few seconds? What's the least taxing on both the device and the server?
accepted answer: http://stackoverflow.com/a/29857040
type: Question
has comment: http://stackoverflow.com/comment/47839458
tagged with: javascript
answer count: 2
has comment: http://stackoverflow.com/comment/47839383
linked to: http://stackoverflow.com/q/10738073
downvote count: 0

http://stackoverflow.com/q/29995444
has comment: http://stackoverflow.com/comment/48111135
has answer: http://stackoverflow.com/a/37709854
has answer: http://stackoverflow.com/a/51573390
has answer: http://stackoverflow.com/a/45632421
has answer: http://stackoverflow.com/a/44887092
type: Question
has comment: http://stackoverflow.com/comment/48111413
score: 86
has answer: http://stackoverflow.com/a/30471736
has answer: http://stackoverflow.com/a/62743860
has comment: http://stackoverflow.com/comment/48111714
upvote count: 86
has answer: http://stackoverflow.com/a/42719121
has answer: http://stackoverflow.com/a/56755256
has comment: http://stackoverflow.com/comment/48114300
tagged with: javascript
has comment: http://stackoverflow.com/comment/48111100
tagged with: reactjs
has title: React: checker is not a function
possible better answer: http://stackoverflow.com/a/42719121
has comment: http://stackoverflow.com/comment/48110956
has comment: http://stackoverflow.com/comment/48111019
has comment: http://stackoverflow.com/comment/48111578
downvote count: 0
accepted answer: http://stackoverflow.com/a/30471736
favorite count: 0
has answer: http://stackoverflow.com/a/56662602
has comment: http://stackoverflow.com/comment/48111464
has body: I'm getting this weird warning message in the console for my React app. Warning: Failed propType: checker is not a function Check the render method of Chart. I do not have any checker method at all. If I remove my propTypes, the warning is gone. Any ideas? My react component: var Chart = React.createClass({ //... propTypes: { legend: React.PropTypes.bool, max: React.PropTypes.number, min: React.PropTypes.number, series: React.PropTypes.arrayOf( React.PropTypes.shape({ label: React.PropTypes.string, values: React.PropTypes.arrayOf( React.PropTypes.arrayOf( React.PropTypes.oneOfType( React.PropTypes.number, React.PropTypes.object // Date ) ) ), colorIndex: React.PropTypes.string }) ).isRequired, threshold: React.PropTypes.number, type: React.PropTypes.oneOf(['line', 'bar', 'area']), units: React.PropTypes.string, xAxis: React.PropTypes.arrayOf(React.PropTypes.string) }, render: function() { return (&lt;svg&gt;...&lt;/svg&gt;); } //... }); The payload I send to the Chart component is this one: var series = [ {label: 'first', values: [[5,2], [4,3], [3,3], [2,2], [1,1]], colorIndex: "graph-1"}, {label: 'second', values: [[5,3], [4,2], [3,0], [2,0], [1,0]], colorIndex: "graph-2"} ];
has answer: http://stackoverflow.com/a/48885818
has answer: http://stackoverflow.com/a/49969289
type: AnsweredQuestion
answer count: 12
has answer: http://stackoverflow.com/a/29997797

http://stackoverflow.com/q/29997705
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/3076414
downvote count: 7
type: Question
linked to: http://stackoverflow.com/q/7564832
has comment: http://stackoverflow.com/comment/48115804
has comment: http://stackoverflow.com/comment/48114958
duplicate of: http://stackoverflow.com/q/3076414
tagged with: javascript
score: -1
linked to: http://stackoverflow.com/q/13421463
has answer: http://stackoverflow.com/a/29997833
tagged with: same-origin-policy
answer count: 3
has answer: http://stackoverflow.com/a/29998032
has body: Mobile app where it needs to get access to a JSON file in another server. And its showing cross origin policy blocked. So is there any way to bypass or have the access to the file ?
has comment: http://stackoverflow.com/comment/48115252
possible better answer: http://stackoverflow.com/a/29997833
has comment: http://stackoverflow.com/comment/48115678
favorite count: 0
has title: How to bypass Cross origin policy
has answer: http://stackoverflow.com/a/29997920
tagged with: php
upvote count: 6
has comment: http://stackoverflow.com/comment/48115733
has comment: http://stackoverflow.com/comment/48114943
accepted answer: http://stackoverflow.com/a/29998032

http://stackoverflow.com/comment/47853350
type: QuestionComment
has text: @pankajparkar i actually need for a webapp where there is a viewer , so functionally the person can open the viewer in a new tab/window and do something else in the the webapp looking at the viewer
comment on: http://stackoverflow.com/q/29863988
score: 0
type: Comment

http://stackoverflow.com/a/41112048
has body: Add to your posts the class {TagsAsClasses}. Then tag all life posts with "life" and book posts with "book". Then you can style like this: .life { background-color: black; } .book { background-color: blue; }
score: 0
answers question: http://stackoverflow.com/q/29917187
type: Answer

http://stackoverflow.com/comment/47952901
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29902594
has text: Thanks. Unfortunatly not. What I want is the camera to keep looking at the horizon, but without tilting the way it is now.
score: 0

http://stackoverflow.com/comment/47982838
type: QuestionComment
score: 0
has text: Why don't you just set the class to "active" on the HTML element.
comment on: http://stackoverflow.com/q/29930272
type: Comment

http://stackoverflow.com/comment/47918160
type: QuestionComment
score: 2
comment on: http://stackoverflow.com/q/29897723
has text: Have you imported Prototype.js?
type: Comment

http://stackoverflow.com/comment/89292937
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29853445
type: Comment
has text: Unfortunately, I have a more complex case (with a proxy and https protocol), and I had to use the `https` module

http://stackoverflow.com/comment/47957022
comment on: http://stackoverflow.com/q/29913327
type: Comment
type: QuestionComment
has text: I am not sure, what is the input and what shoud be the output. Given the data from previous games, you want to take two users, that did not yet play and predict, who will win with what probability? k-means can take the data and partition it into clusters. For example players with similar stats, but will not help you in predictions.
score: 0

http://stackoverflow.com/a/29896438
downvote count: 0
has body: there is a meta tag that you can redirect, but you should use header(), &lt;META HTTP-EQUIV="Refresh" Content="0; URL=page.php"&gt;
type: Answer
answers question: http://stackoverflow.com/q/29896314
score: 1
upvote count: 1

http://stackoverflow.com/comment/116337722
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/60339349
type: Comment
has text: The java file should be in `/src/android/`, then make sure that `/plugin.xml` is properly configured. I'd recommend to start with a plugin boilerplate.

http://stackoverflow.com/q/29876011
duplicate of: http://stackoverflow.com/q/4923077
tagged with: asp.net
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/4923077
tagged with: http://stackoverflow.com/tag/html
answer count: 0
has comment: http://stackoverflow.com/comment/47876632
type: Question
tagged with: c#
has title: Page Break after each table in body
has body: I have 2 tables in my body in html. When I press print button, I want to print each table in different page with "page break" in asp.net c#. I want it to work in chrome. There is any solution using jquery or javascript? my html code : &lt;table align="center"&gt; &lt;tr&gt; &lt;td colspan = 2 style="font-weight:bold;font-size:16px;padding:3px;text-align: center;"&gt; &lt;br/&gt; SCHEDULE TWO - LIFE BENEFITS policy No. &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&amp;nbsp;&lt;/td&gt; &lt;td&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td style="font-weight:bold;font-size:16px;padding:3px; text-align:center;"&gt; signed on behalf of : &lt;br/&gt; &lt;asp:Label ID="lblCompanyName" runat="server" Font-Size="Large"&gt;&lt;/asp:Label&gt; &lt;/td&gt; &lt;td style="font-weight:bold;font-size:16px;padding:3px;text-align:center;"&gt; signed on behalf of : Company &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/div&gt; &lt;table align="center"&gt; &lt;tr&gt; &lt;td style="padding:3px;font-size:16px;font-weight:bold;" class="style2"&gt;&lt;/td&gt; &lt;td style="font-weight:bold;font-size:16px;padding:3px;text-align:center;" class="style1"&gt; &lt;br/&gt; &lt;br/&gt; &lt;br/&gt; &lt;br /&gt; Policy No: &amp;nbsp;&lt;asp:Label ID="Label1" runat="server" Font-Size="Large"&gt;&lt;/asp:Label&gt; &lt;/td&gt; &lt;td style="font-weight:bold;font-size:16px;padding:3px; text-align:right;"&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td style="padding:3px;font-size:16px;font-weight:bold;"&gt; FIRST PARTY: &lt;/td&gt; &lt;td&gt; &amp;nbsp;&lt;/td&gt; &lt;td&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td colspan = 3 style="text-align:center;font-size:16px;font-weight:bold; height:59px;"&gt; &lt;br/&gt; &lt;br/&gt; Company &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td colspan = 3 style="text-align: center;padding:3px;font-size:16px;font-weight:bold;"&gt; Hereinafter referred to as the First Party or Company (Insurer). &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td style="padding:3px;font-size:16px;font-weight:b…
tagged with: javascript
has comment: http://stackoverflow.com/comment/47876700
score: 0
has comment: http://stackoverflow.com/comment/47876614
has comment: http://stackoverflow.com/comment/47876781
tagged with: jquery

http://stackoverflow.com/comment/48118090
type: Comment
comment on: http://stackoverflow.com/a/29996352
score: 0
type: AnswerComment
has text: Yep exactly! I actually came to the same solution you updated to an hour back! Thanks for the validation <3

http://stackoverflow.com/q/29949436
type: AnsweredQuestion
tagged with: cookies
accepted answer: http://stackoverflow.com/a/29950097
type: Question
linked to: http://stackoverflow.com/q/60174
has title: Can PHP set cookie function, Overwrite cookie value created with JQuery cookie
downvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/48020345
favorite count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/48020219
has body: I am currently trying to have one set cookie and the value of the cookie gets overwritten by PHP effectively when a user logs in, but it just creates a separate cookie, here is a snippet of code which am setting the cookie value &lt;?php include("db_connect.php"); $input_game = $_POST['game']; $input_user = $_POST['email']; $sql = "UPDATE users_table SET Pref_Game = '" . $input_game . "' WHERE Email='" . $input_user . "'"; if ($conn-&gt;query($sql) === TRUE) { $cookie_name2 = "content"; $sql="SELECT Pref_Game FROM users_table WHERE Email='$input_user'"; $result = $conn-&gt;query($sql); $row = $result-&gt;fetch_object(); setcookie($cookie_name2,$row-&gt;Pref_Game, time() + (86400 * 30), "/"); // 86400 = 1 day } else { //Error } ?&gt; Below is the JQuery cookie code just for clarity: $("#test-cookie").click(function() { $.cookie('content', 'test'); location.reload(); }); Is there anyway that PHP can update/overwrite the cookie value created by JQuery?
has answer: http://stackoverflow.com/a/29950097
has comment: http://stackoverflow.com/comment/48116788
upvote count: 2
tagged with: php
score: 2

http://stackoverflow.com/comment/48029803
type: Comment
score: 1
comment on: http://stackoverflow.com/a/29954485
type: AnswerComment
has text: ..and remove the inline `onsubmit` event ;-)

http://stackoverflow.com/q/29933514
type: Question
answer count: 2
downvote count: 0
has answer: http://stackoverflow.com/a/43536930
favorite count: 0
tagged with: angularjs
tagged with: input
upvote count: 11
possible better answer: http://stackoverflow.com/a/43536930
has answer: http://stackoverflow.com/a/29933598
accepted answer: http://stackoverflow.com/a/29933598
has title: Angular Routes / input autofocus
score: 11
type: AnsweredQuestion
tagged with: autofocus
tagged with: javascript
has body: I'm using angular route. Each page(route) has an input field. I have successfully used the attribute autofocus on the first page. When I navigate to the other pages, the input does not autofocus. Returning to the first page does not autofocus the input again. I understand now why it doesn't work but would like to know if there is a way to accomplish this. I'm new to Angular and I'm not sure I understand what I read about ngFocus: https://docs.angularjs.org/api/ng/directive/ngFocus
tagged with: routes

http://stackoverflow.com/a/34965593
has body: there's also triggerOnClick boolean config option (6.0.1, 5.1.2) which achieves the same; also to be used with hideTrigger: true
score: 0
type: Answer
answers question: http://stackoverflow.com/q/29944517

http://stackoverflow.com/q/29922001
has body: What should I do in order to fix this string to be a vali1d javascript JSON object? txt = '{"Categories" : [{"label":"petifores","id":"1"}, {"label":"wedding cake","id":"2"}, {"label":"shapes of cakes","id":"3"}, {"label":"printable photos","id":"4","children": [{"label":"series","id":"7"}, {"label":"kids","id":"8"}, {"label":"animals","id":"9"}, {"label":"sport","id":"10"}, {"label":"various pictures","id":"11"}, {"label":"Cars","id":"12"}, {"label":"girls","id":"13"}, {"label":"artists","id":"14"}] {"label":"special events","id":"5"}, {"label":"graduations","id":"6"}]}';
has answer: http://stackoverflow.com/a/29922204
downvote count: 2
has title: in javascript im getting an error when converting the following string to json object, anybody help me find whats wrong with this string?
tagged with: javascript
tagged with: jquery
favorite count: 0
possible better answer: http://stackoverflow.com/a/29922159
has answer: http://stackoverflow.com/a/29922225
answer count: 5
has comment: http://stackoverflow.com/comment/47965354
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47965377
upvote count: 0
tagged with: php
type: Question
has answer: http://stackoverflow.com/a/29922159
has answer: http://stackoverflow.com/a/29922324
has answer: http://stackoverflow.com/a/29922094
score: -2
accepted answer: http://stackoverflow.com/a/29922094
tagged with: http://stackoverflow.com/tag/json

http://stackoverflow.com/q/29851331
has comment: http://stackoverflow.com/comment/47829614
has comment: http://stackoverflow.com/comment/47829722
has comment: http://stackoverflow.com/comment/47829427
tagged with: mysql
upvote count: 1
type: Question
downvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47828715
has answer: http://stackoverflow.com/a/29852506
has body: I have a table and i should make update operations with them .I get data from mysql and firstly I should get $id of loop and pass to another page and get $id from second page and then i know how to update only I dont know how to get appropriate id to update it in second page I am newbie in php js List of books Create Book name Author Category <?php $id = 0; while($info = mysql_fetch_array( $data )) { $id++; // Print " "; Print " Name: ".$info['name'] . " "; // Print " Pet: ".$info['author'] . " "; // Print " "; Print" "; Print" ".$info['name']." "; Print " ".$info['author']." "; Print " ".$info['category']." "; Print " ".' Edit '." "; Print " ".' Delete '." "; Print " "; } ?> function delete_user( id ){ //this script helps us to alert("dd") //var answer = confirm('Are you sure? +id'); } not working in line Print " ".' Edit '." ";
has title: Get id from php code catch by onclick method js then pass to another page
answer count: 1
score: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/47829127
accepted answer: http://stackoverflow.com/a/29852506
tagged with: php
has comment: http://stackoverflow.com/comment/47829574
type: AnsweredQuestion

http://stackoverflow.com/comment/47868197
score: 0
type: AnswerComment
has text: I realized I made a typo above. `app.factory('User')` returns `User`. I could put more code up, but it's the same as above. Just more functions. Some are `.prototype`, others, like `get`, aren't.
comment on: http://stackoverflow.com/a/29871541
type: Comment

http://stackoverflow.com/q/29953020
type: AnsweredQuestion
has title: capturing a div with jquery selector
score: 1
has comment: http://stackoverflow.com/comment/48027114
upvote count: 1
has answer: http://stackoverflow.com/a/29953096
type: Question
possible better answer: http://stackoverflow.com/a/29953096
tagged with: javascript
tagged with: jquery
has body: I'm stumped. I have a form that is dynamically populated from the results of a mysql query. Depending on how many rows are returned, the procedure will add a div for each row, and populate each div with a questionaire. Initially each div is hidden, and for each div there is a toggle button, and a description of the contents of that record in the mysql table. Each div is dynamically assigned an id, such as "ACH" plus the index number of the record returned from the mysql query. In the example I'm working with now, there are two divs, one is "ACH925" and the other "ACH926", and this is clearly evident in the debugger. The problem is that the toggle button for the first div toggles both. No problem with the toggle button for div2; it only toggles div2. Also, the toggle button for div1 has a reversible effect on div2. If both divs are not in the same visibility mode, the div1 toggle button will set div2 to hidden if div1 is set to display, or display when div1 is hidden. I want each div to be independent and show or hide one or both. some html code written in a php string, where $value is the index number returned from the query: $(document).ready(function() { var rows=1; for (i=0; i&lt;=rows-1; i++) { var table = document.getElementById("ACHTable'.$value.'"); var row = table.insertRow(-1); var cell = row.insertCell(-1); cell.width = "12%"; cell.innerHTML = "&lt;button id=\"shwBtn'.$value.'\" class=\"showBtn\" type=\"button\"&gt;Show / Hide&lt;/button&gt;"; cell = row.insertCell(-1); cell.width = "88%"; cell.style.fontSize="14px"; cell.innerHTML = "DisputeID: '.$value.';&amp;nbsp;&amp;nbsp;Dispute Date: '.$dd[$ctr].';&amp;nbsp;&amp;nbsp;Merchant: '.$mer[$ctr].'"; cell.innerHTML+= ";&amp;nbsp&amp;nbsp;Transaction Amount: $'.money_format('%i', ($amt[$ctr]/100)).'"; } }); and the following code where the toggles are executed: $(document).ready(function () { var container = $("#ACH'.$value.'"); console.log(container.prop("id")); $(".showBtn").click(function () { container.t…
has answer: http://stackoverflow.com/a/29953085
answer count: 3
downvote count: 0
accepted answer: http://stackoverflow.com/a/29953085
favorite count: 0
has comment: http://stackoverflow.com/comment/48030546
has answer: http://stackoverflow.com/a/29953328
tagged with: http://stackoverflow.com/tag/html
tagged with: php

http://stackoverflow.com/a/29893731
has comment: http://stackoverflow.com/comment/47910750
score: 2
upvote count: 2
has comment: http://stackoverflow.com/comment/47913243
type: Answer
has comment: http://stackoverflow.com/comment/47911562
has comment: http://stackoverflow.com/comment/81782089
has body: If you want to calculate difference between two dates using javascript: Then, function dateDiff() { var dtFrom = document.getElementById('txtFromDate').value; var dtTo = document.getElementById('txtToDate').value; var dt1 = new Date(dtFrom); var dt2 = new Date(dtTo); var diff = dt2.getTime() - dt1.getTime(); var days = diff/(1000 * 60 * 60 * 24); alert(dt1 + ", " + dt2); alert(days); return false; } function isNumeric(val) { var ret = parseInt(val); } HTML: From Date : To Date : Difference AFTER EDIT: Following solution is to get all dates between specified dates. Working Demo // using Datepicker value example code $('#getBetween').on('click', function () { var start = $("#from").datepicker("getDate"), end = $("#to").datepicker("getDate"); var between = getDates(start, end); $('#results').html(between.join(' ')); }); // This function doing this work. function getDates(start, end) { var datesArray = []; var startDate = new Date(start); while (startDate <= end) { datesArray.push(new Date(startDate)); startDate.setDate(startDate.getDate() + 1); } return datesArray; }
answers question: http://stackoverflow.com/q/29893571
downvote count: 0

http://stackoverflow.com/comment/47982409
type: QuestionComment
has text: Not sure I understand what you want. Do you mean this http://jsfiddle.net/06paz5ef/?
comment on: http://stackoverflow.com/q/29930063
score: 0
type: Comment

http://stackoverflow.com/a/29917590
has comment: http://stackoverflow.com/comment/48003869
upvote count: 2
accepted answer of: http://stackoverflow.com/q/29891394
answers question: http://stackoverflow.com/q/29891394
has comment: http://stackoverflow.com/comment/47999269
type: AcceptedAnswer
downvote count: 0
has body: You have to create and place the data value labels yourself. How to do this can be seen in this answer. I created a fiddle adjusting it to your code. Only the first data series (foo) has labels for now. you will have to adjust the position. The relevant code: $.each(plot.getData()[0].data, function (i, el) { if (el.length &gt; 1) { var o = plot.pointOffset({ x: el[0], y: el[1] }); $('&lt;div class="data-point-label"&gt;' + el[1] + '&lt;/div&gt;').css({ position: 'absolute', left: o.left + 4, top: o.top, 'text-align': 'center', display: 'none' }).appendTo(plot.getPlaceholder()).fadeIn('slow'); } }); But you may also have to cleanup your data. You have multiple data points with the same x values (which means bars behind / in front of each other which leads to some being invisible). Take a look at the side-by-side and stack plugins on the flot plugin page.
has comment: http://stackoverflow.com/comment/47994715
type: Answer
score: 2

http://stackoverflow.com/a/29870248
upvote count: 5
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29870232
score: 5
type: AcceptedAnswer
type: Answer
has body: Id must be unique. You can assign the same class to the links and do this: $(".code").click(function() { $("#CodeModal").modal('show') });
answers question: http://stackoverflow.com/q/29870232

angular-strap
tag name: angular-strap
type: Tag
tags question: http://stackoverflow.com/q/29950892

http://stackoverflow.com/comment/48005265
has text: Both. First I load the page completely which contains links (of this ajax type). The loaded page contains the same links. I will send you a private message now with the complete code of the initial HTML and the complete code with the ajax loaded stuff. Just a second.
score: 0
type: Comment
comment on: http://stackoverflow.com/q/29937249
type: QuestionComment

http://stackoverflow.com/comment/47885146
type: AnswerComment
type: Comment
has text: Would it be possible to make it so that instead of removing the 3 letters... replace any 3 letters of the word with 3 random letters?
comment on: http://stackoverflow.com/a/29879693
score: 0

http://stackoverflow.com/a/69725331
score: 1
answers question: http://stackoverflow.com/q/29973533
upvote count: 1
has body: You can listen to the click event and then loop through all the pointLabels check if the click is in that box. If this is the case you get the corresponding label from the array containing all the labels. Then you can open use window.location = link or window.open(link) to go to your link. Example that searches the color on google on click: const options = { type: 'radar', data: { labels: ["Red", "Blue", "Yellow", "Green", "Purple", "Orange"], datasets: [{ label: '# of Votes', data: [12, 19, 3, 5, 2, 3], borderColor: 'orange' }, { label: '# of Points', data: [7, 11, 5, 8, 3, 7], borderColor: 'pink' } ] }, options: { onClick: (evt, activeEls, chart) =&gt; { const { x, y } = evt; let index = -1; for (let i = 0; i &lt; chart.scales.r._pointLabelItems.length; i++) { const { bottom, top, left, right } = chart.scales.r._pointLabelItems[i]; if (x &gt;= left &amp;&amp; x &lt;= right &amp;&amp; y &gt;= top &amp;&amp; y &lt;= bottom) { index = i; break; } } if (index === -1) { return; } const clickedLabel = chart.scales.r._pointLabels[index]; window.open(`https://www.google.com/search?q=color%20${clickedLabel}`); // Blocked in stack snipet. See fiddle console.log(clickedLabel) } } } const ctx = document.getElementById('chartJSContainer').getContext('2d'); new Chart(ctx, options); &lt;body&gt; &lt;canvas id="chartJSContainer" width="600" height="400"&gt;&lt;/canvas&gt; &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/3.6.0/chart.js"&gt;&lt;/script&gt; &lt;/body&gt; Fiddle: https://jsfiddle.net/Leelenaleee/fnqr4c7j/22/
type: Answer
downvote count: 0

tdd
tags question: http://stackoverflow.com/q/30000858
type: Tag
tags question: http://stackoverflow.com/q/29945075
tags question: http://stackoverflow.com/q/29954669
tag name: tdd

http://stackoverflow.com/comment/48075282
type: Comment
type: QuestionComment
has text: @sємsєм OP says that getting the value from the URL is working, so this is not a duplicate of _that_ question.
comment on: http://stackoverflow.com/q/29975414
score: 0

http://stackoverflow.com/q/29974949
has comment: http://stackoverflow.com/comment/48069877
has comment: http://stackoverflow.com/comment/48069820
has comment: http://stackoverflow.com/comment/48070755
answer count: 1
has comment: http://stackoverflow.com/comment/48070674
has comment: http://stackoverflow.com/comment/48069980
has comment: http://stackoverflow.com/comment/48070080
favorite count: 0
has comment: http://stackoverflow.com/comment/48070883
has body: So I was given this question earlier today : You have 100 cats. (You are quite lucky to own so many cats!) You have arranged all your cats in a line. Initially, none of your cats have any hats. You take 100 rounds walking around the cats. Every time you stop at a cat, you put a hat on it if it doesn't have one, and you take its hat off if it has one on. The first round, you stop at every cat. The second round, you only stop at every 2nd cat (#2, #4, #6, #8, etc.). The third round, you only stop at every 3rd cat (#3, #6, #9, #12, etc.). You continue this process until the 100th round (i.e. you only visit the 100th cat). Write a program that prints which cats have hats at the end. I know that the answer would be all perfect squares. I tried to solve it using JavaScript, my answer is almost correct except for the 100th cat. I think there is something wrong with one of my loops which is why the last element of the array isn't what it should be. Here is what I came up with : var cats = []; for (var i = 0; i &lt; 100; i++) { cats.push(0); } for (var j = 1; j &lt;= cats.length; j++) { for (var k = 0; k &lt;= cats.length; k+= j) { if (cats[k] === 0) { cats[k] = 1; } else if (cats[k] === 1) { cats[k] = 0; } } } console.log(cats); The expected output is : [ 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 ] Whereas the output I am getting is: [ 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/48071090
score: 3
has comment: http://stackoverflow.com/comment/48071328
has comment: http://stackoverflow.com/comment/48070198
has title: Creating perfect squares using nested loops in JavaScript
has answer: http://stackoverflow.com/a/29975707
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/48071209
has comment: http://stackoverflow.com/comment/48069842
has comment: http://stackoverflow.com/comment/48070949
has comment: http://stackoverflow.com/comment/48070846
has comment: http://stackoverflow.com/comment/48069927
tagged with: javascript
has comment: http://stackoverflow.com/comment/48070995
has comment: http://stackoverflow.com/comment/48070923
has comment: http://stackoverflow.com/comment/48070586
has comment: http://stackoverflow.com/comment/48071017
upvote count: 4

http://stackoverflow.com/a/29899933
score: 2
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29899086
has body: I suggest you do not use same element, but to clone the footer and add there new css class. That way you will avoid content jumping in time when you change the css position from fixed to relative or static and vice versa. It is also good for responsive design, because you have more control: var realFooter = $('.floating'); var floatingFooter = realFooter.clone().addClass('floating-div').appendTo( $('body') ); function stickyDiv() { var scrollTop = $(window).scrollTop(); var winHeight = $(window).height(); var footerOffsetTop = realFooter.offset().top; if ((scrollTop+winHeight) > footerOffsetTop) { floatingFooter.fadeOut('fast'); } else { floatingFooter.fadeIn('fast'); } } $(document).scroll(function () { stickyDiv(); }); .sticky { position:fixed; bottom:10px; margin:0 auto; z-index:1000; } .floating { background: #ddd; height:100px; } .floating-div { background:#888; position: fixed; left: 0; bottom: 0; width: 100%; } #top { height:900px; } #wrapper { height:1000px; background:#fff; } #footer { background:#ccc; height:100px; bottom:0px; position:relative; } floating footer footer Same script on Fiddle. By the way there are several errors in your original script as: assigning events on document instead on window calculating floatingFooter outside of stickyDiv() wrong calculation of footer position, should use offset()
has comment: http://stackoverflow.com/comment/47922851
answers question: http://stackoverflow.com/q/29899086
has comment: http://stackoverflow.com/comment/47949022
upvote count: 2
has comment: http://stackoverflow.com/comment/47922955
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/47922720

http://stackoverflow.com/comment/47869766
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29871971
score: 0
has text: Note that setTimeout() and setInterval() aren't 100% accurate...so when you say you want it to move to the next set 22 minutes later, it's important to be aware that it might not be *exactly* 22 minutes. If accuracy is important, you could implement the timing on the server and have the server push updates to the client using WebSockets (e.g. with socket.io).

http://stackoverflow.com/comment/47867126
type: Comment
type: QuestionComment
has text: Does it have to be *after* you fill the array or can it be during? What do you mean by cleaning the array? What do you want to happen when two identical integers are side by side?
score: 1
comment on: http://stackoverflow.com/q/29871091

http://stackoverflow.com/q/29981726
has answer: http://stackoverflow.com/a/29981814
has answer: http://stackoverflow.com/a/29981763
accepted answer: http://stackoverflow.com/a/29981763
tagged with: javascript
has comment: http://stackoverflow.com/comment/48082929
answer count: 3
upvote count: 1
has answer: http://stackoverflow.com/a/29981871
tagged with: jquery
favorite count: 0
has title: JQuery - Pass data to callback, from each element in a collection
has body: In my HTML I have these links: Show More Comments Show More Comments and so on. Every link has same class and a unique ID. In JQuery I do this: var $el = $( "a.more-comments-link" ); Here I get a collection of all links. I want to add click event to each element and get the ID from each element in a collection and pass it to callback. I have tried this: $el.click({id: $el.attr('id')}, tst); tst is just a simple callback function with event parameter. All this do is just gets the ID from first element in a collection.
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
downvote count: 0
score: 1
possible better answer: http://stackoverflow.com/a/29981871
type: Question

http://stackoverflow.com/comment/48029408
comment on: http://stackoverflow.com/a/29953687
has text: oh.. my bad! As you might have noticed, I'm a complete noob. Thank you so much for solving 3 mistakes 33 minutes!!
score: 0
type: AnswerComment
type: Comment

mvvm
tags question: http://stackoverflow.com/q/29882370
tags question: http://stackoverflow.com/q/29950343
type: Tag
tag name: mvvm

http://stackoverflow.com/q/29910823
has comment: http://stackoverflow.com/comment/47944242
has comment: http://stackoverflow.com/comment/47944079
upvote count: 56
has comment: http://stackoverflow.com/comment/47943984
has comment: http://stackoverflow.com/comment/47944111
has comment: http://stackoverflow.com/comment/47944053
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/67758718
score: 55
has answer: http://stackoverflow.com/a/29911171
has comment: http://stackoverflow.com/comment/47944200
has answer: http://stackoverflow.com/a/71605421
has comment: http://stackoverflow.com/comment/74958099
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/47944131
possible better answer: http://stackoverflow.com/a/49963912
has answer: http://stackoverflow.com/a/73799347
has title: $(...).popover is not a function
has body: I have looked through quite a few posts on here dealing with this issue, but none of them seem to solve my problem. I have imported the jQuery and Bootstrap js files in the right order. Things such as bootstrap panels are working perfectly fine for me. My script imports are like this: &lt;script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"&gt;&lt;/script&gt; &lt;script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"&gt;&lt;/script&gt; &lt;link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet"&gt; However, when I try $('[data-toggle="popover"]').popover(); I get the following message in the Chrome console: Uncaught TypeError: $(...).popover is not a function At first I thought maybe popover was not being included in CDN's copy, so I went ahead and downloaded a local copy with all the plugins included from here: http://getbootstrap.com/customize/ and got the same error message (re-pointed the script tags towards the local js file). Doing a search for "popover" the bootstrap.min.js file: http://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js Shows that popover is included in the file.
has answer: http://stackoverflow.com/a/49963912
tagged with: javascript
has comment: http://stackoverflow.com/comment/47943843
has comment: http://stackoverflow.com/comment/47943904
has comment: http://stackoverflow.com/comment/47944307
has answer: http://stackoverflow.com/a/67414183
has comment: http://stackoverflow.com/comment/47944043
has comment: http://stackoverflow.com/comment/47944340
has comment: http://stackoverflow.com/comment/47944224
has answer: http://stackoverflow.com/a/39548147
has comment: http://stackoverflow.com/comment/47944167
has answer: http://stackoverflow.com/a/77170224
accepted answer: http://stackoverflow.com/a/29911171
has comment: http://stackoverflow.com/comment/47944191
has comment: http://stackoverflow.com/comment/47943983
answer count: 10
tagged with: jquery
has answer: http://stackoverflow.com/a/67738690
favorite count: 0
has answer: http://stackoverflow.com/a/69893132
has comment: http://stackoverflow.com/comment/47944074
has comment: http://stackoverflow.com/comment/47944030
tagged with: twitter-bootstrap
has comment: http://stackoverflow.com/comment/47943779
has comment: http://stackoverflow.com/comment/47944266

http://stackoverflow.com/q/29857911
has comment: http://stackoverflow.com/comment/89800286
downvote count: 0
has comment: http://stackoverflow.com/comment/47842190
answer count: 0
tagged with: javascript
tagged with: jasmine
favorite count: 0
type: Question
has comment: http://stackoverflow.com/comment/47841757
score: 1
has comment: http://stackoverflow.com/comment/47841895
has comment: http://stackoverflow.com/comment/47841837
tagged with: chutzpah
has title: How do I Run Jasmine Unit Tests Synchronously?
upvote count: 1
tagged with: unit-testing
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47842240
has body: I am currently using chutzpah to run Jasmine JavaScript unit tests in Visual Studio. I have a globally scoped DOM element that i need to reset each time a couple of my tests run. I am currently using beforeEach() to clear out the DOM element so the next test can use and populate accordingly. However, it looks like i am running into async problems where the element is being cleared in one test while executing in a different test. Bottom line: Is there any way to run each test synchronously in Jasmine? Current structure looks something like this: describe('baseView', function () { beforeEach(function() { $('#elementToClear').html(''); }); it('run 2.', function () { var baseView = new BaseView(); baseView.populateElement(); expect($('#elementToClear').html()).toBe('populated') }); it('run 1.', function () { var baseView = new BaseView(); baseView.populateElement(); expect($('#elementToClear').html()).toBe('populated') }); });

http://stackoverflow.com/a/29893015
has comment: http://stackoverflow.com/comment/48563854
has comment: http://stackoverflow.com/comment/48163793
accepted answer of: http://stackoverflow.com/q/29888529
answers question: http://stackoverflow.com/q/29888529
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/48152548
type: Answer
has comment: http://stackoverflow.com/comment/54948675
has comment: http://stackoverflow.com/comment/48140451
has comment: http://stackoverflow.com/comment/48563975
has comment: http://stackoverflow.com/comment/48653091
score: 2
has body: There are multiple ways to locate the desired element, though I would chain element.all() and element() and use by.xpath() locator strategy: var a = element.all(by.repeater("app in userApps")).element(by.xpath(".//a[strong = 'appName1']")); a.click(); Or, using filter(): element.all(by.repeater("app in userApps")).filter(function (elm) { return elm.evaluate("app.displayName").then(function (displayName) { return displayName === "appName1"; }); }).then(function (elms) { var link = elms[0].element(by.tagName("a")); link.click(); });
upvote count: 2

http://stackoverflow.com/a/29985076
score: 0
type: Answer
has body: You should include &lt;?php wp_head(); ?&gt; and &lt;?php wp_footer(); ?&gt; immediately before &lt;/head&gt; and &lt;/body&gt; respectively. These functions are what, among other things, include scripts and styles that have been queued. References: http://codex.wordpress.org/Function_Reference/wp_head http://codex.wordpress.org/Function_Reference/wp_footer At the very least add &lt;?php do_action("wp_enqueue_scripts"); ?&gt; as that will output all the queued scripts.
has comment: http://stackoverflow.com/comment/48091803
has comment: http://stackoverflow.com/comment/48089446
has comment: http://stackoverflow.com/comment/48089625
answers question: http://stackoverflow.com/q/29983563
has comment: http://stackoverflow.com/comment/48089482

http://stackoverflow.com/comment/47953268
has text: I didn't add any, are there some enabled by default? Only packages are accounts-ui, jquery so far. Thanks again on this!
type: Comment
comment on: http://stackoverflow.com/a/29885575
score: 0
type: AnswerComment

http://stackoverflow.com/q/29929781
has comment: http://stackoverflow.com/comment/47981892
tagged with: javascript
has body: I want to be able to create the html table like this without using any html and only writing JavaScript. How do I create the empty table data boxes with JavaScript? table { border: 1px solid black; } th { border: 1px solid blue; } td { border: 1px solid red; } One Two Three A B C
score: 0
tagged with: for-loop
answer count: 1
has comment: http://stackoverflow.com/comment/47982044
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47982570
tagged with: foreach
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29930449
type: Question
has title: How do I create the empty table data boxes with JavaScript?

http://stackoverflow.com/a/29995785
type: Answer
has body: Like Carorus said, you're almost there! Their example uses your code and it's probably best that you check that out and understand it. If you are looking for a jquery solution I threw this together very quickly, I hope it's what you are looking for. http://codepen.io/anon/pen/pJJKjZ?editors=101 $("#info").click(function(){ show() }); $(".close").click(function(){ hide(); }); var show = function(){ $("#myDiv").css('visibility', 'visible'); $("#info").css('visibility','hidden'); } var hide = function(){ $("#myDiv").css('visibility', 'hidden'); $("#info").css('visibility','visible'); }
score: 0
answers question: http://stackoverflow.com/q/29995614

http://stackoverflow.com/comment/47857112
comment on: http://stackoverflow.com/a/29864754
score: 0
type: AnswerComment
type: Comment
has text: i added for loop to create more elemenst http://jsfiddle.net/7c3v0s1s/7/ but is says Uncaught ReferenceError: dragSrcEl is not defined

http://stackoverflow.com/a/29951230
has body: It seems to me to be the positioning within the html markup of the #myModal element that is causing safari to render the modal as if it was a child element (as indeed that is how you have positioned it). From the Bootstrap documentation: Modal markup placement Always try to place a modal's HTML code in a top-level position in your document to avoid other components affecting the modal's appearance and/or functionality. Also the way in which the modal renders in chrome doesn't seem to be ideal either as it renders under the header and footer elements - rather that being on-top of all page elements (but as it is centred this is less noticeable). To fix the issue reposition the modal div and its contents from after the trigger button to before the close tag: Broken Markup (current) Send us a message //reposition as below to fix //form and stuff... Fixed Markup //form and stuff...
has comment: http://stackoverflow.com/comment/48127794
accepted answer of: http://stackoverflow.com/q/29941380
answers question: http://stackoverflow.com/q/29941380
has comment: http://stackoverflow.com/comment/48199452
score: 2
has comment: http://stackoverflow.com/comment/48123844
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/48199487
upvote count: 2
type: Answer

http://stackoverflow.com/comment/48070080
type: Comment
score: 3
has text: Change second for loop to `for (var k = j - 1; k < cats.length; k+= j) {`
comment on: http://stackoverflow.com/q/29974949
type: QuestionComment

http://stackoverflow.com/q/29906553
type: AnsweredQuestion
has body: I accidentally typed: var x = [1, 2, 3, 4]; console.log(x[1, 2]); //this will log 3 console.log(x[3, 1]); //this will log 2 It turns out I can use any number of comma-separated indices to refer to array elements. The last index is always used. If the last index is larger than the array, undefined is the result. Why does this syntax work?
score: 3
linked to: http://stackoverflow.com/q/7421013
has comment: http://stackoverflow.com/comment/47935777
accepted answer: http://stackoverflow.com/a/29906588
duplicate of: http://stackoverflow.com/q/7421013
type: Question
upvote count: 4
has comment: http://stackoverflow.com/comment/47935835
tagged with: javascript
has comment: http://stackoverflow.com/comment/47935813
has comment: http://stackoverflow.com/comment/47935852
has answer: http://stackoverflow.com/a/29906588
answer count: 1
favorite count: 0
has title: Why do JS arrays accept comma-separated indices?
has comment: http://stackoverflow.com/comment/47935724
has comment: http://stackoverflow.com/comment/47936063
downvote count: 1

http://stackoverflow.com/q/29956526
tagged with: gwt
score: 2
type: AnsweredQuestion
tagged with: java
has title: Creating generic GWT Events: is this a good approach?
type: Question
accepted answer: http://stackoverflow.com/a/29971227
tagged with: javascript
answer count: 1
downvote count: 0
tagged with: events
tagged with: generics
has body: I'm trying to create a simple way to fire CRUD-type events for different domain classes. I've created the following event class: public class EntityModifiedEvent&lt;E&gt; extends Event&lt;EntityModifiedEventHandler&lt;E&gt;&gt; { private E element; private ModType modType; private Class&lt;E&gt; clazz; private static Map&lt;String,GwtEvent.Type&lt;EntityModifiedEventHandler&lt;?&gt;&gt;&gt; types = new HashMap&lt;String, GwtEvent.Type&lt;EntityModifiedEventHandler&lt;?&gt;&gt;&gt;(); public EntityModifiedEvent(ModType modType, E element, Class&lt;E&gt; clazz) { this.element = element; this.modType = modType; this.clazz = clazz; } public Type&lt;EntityModifiedEventHandler&lt;?&gt;&gt; getType() { return getType(clazz); } @SuppressWarnings({"rawtypes", "unchecked"}) public static GwtEvent.Type&lt;EntityModifiedEventHandler&lt;?&gt;&gt; getType(Class clazz) { GwtEvent.Type type = types.get(clazz.toString()); if (type == null) { type = new GwtEvent.Type&lt;EntityModifiedEventHandler&lt;?&gt;&gt;(); types.put(clazz.toString(), type); } return type; } public E getElement(){ return element; } public ModType getModType() { return modType; } @SuppressWarnings({"unchecked", "rawtypes"}) @Override public Type&lt;EntityModifiedEventHandler&lt;E&gt;&gt; getAssociatedType() { return (Type) getType(); } @Override protected void dispatch(EntityModifiedEventHandler&lt;E&gt; handler) { handler.onEntityModified(this); }; public interface EntityModifiedEventHandler&lt;E&gt; extends EventHandler { void onEntityModified(EntityModifiedEvent&lt;E&gt; entityModifiedEvent); } So, any class can register itself as a listener as follow: getEventBus().addHandler(EntityModifiedEvent.getType(MyDomainClass.class), this); And the events will be fired like: getEventBus().fireEventFromSource(new EntityModifiedEvent&lt;MyDomainClass&gt;(ModType.CREATE, instanceModified, MyDomainClass.class), this); ModType is just a simple Enum with the different types of modifications. I have some concerns about havin…
favorite count: 0
has answer: http://stackoverflow.com/a/29971227
upvote count: 2
has comment: http://stackoverflow.com/comment/48051352

http://stackoverflow.com/a/29883785
type: Answer
answers question: http://stackoverflow.com/q/29883259
has body: You should consider using JQuery's animate() function to animate css values like opacity. Even better you could be using CSS animations. What you're doing is NOT a good way to achieve your goal. If you really want it that way you should use setInterval or setTimeout.
has comment: http://stackoverflow.com/comment/47939006
score: 0

http://stackoverflow.com/q/29989926
tagged with: reactjs-flux
answer count: 1
favorite count: 0
tagged with: flux
upvote count: 2
has title: React flux reset store value on route change
accepted answer: http://stackoverflow.com/a/30006036
type: AnsweredQuestion
score: 2
has answer: http://stackoverflow.com/a/30006036
tagged with: react-router
type: Question
tagged with: reactjs
has body: I have simple implementation of react and flux. i am creating new post with actions and stores but the problem that if the user going to another route and come back the this.postAdded still the same value. The store: class NewPostsStore { constructor() { this.title = ''; this.body = ''; this.postAdded = false; this.bindListeners({ createPost: PostsActions.createPost }); } createPost(res) { this.postAdded = res.add; } } The Action: class PostsActions { getPosts() { $.ajax({ url: url }).then((posts) => { this.dispatch(posts); }); } createPost(post) { $.ajax({ type:'POST', data: post, url: url }).then((res) => { this.dispatch(res); }); } } module.exports = Blog.createActions(PostsActions); The component: export default React.createClass({ mixins: [addons.LinkedStateMixin], getInitialState() { return NewPostStore.getState(); }, onChange() { this.setState(NewPostStore.getState()); }, componentDidMount() { PostsActions.getPosts(); NewPostStore.listen(this.onChange); }, componentWillUnmount() { NewPostStore.unlisten(this.onChange); }, submit(e) { e.preventDefault(); PostsActions.createPost({ title: this.state.title, body: this.state.body }); }, setMessage() { if(this.state.postAdded) { return success } else { return failed } }, render() { return ( Create {this.setMessage()} ); } }); How can i reset the state when go to other view?
downvote count: 0
tagged with: javascript

http://stackoverflow.com/comment/47864574
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29869421
has text: @FrankTocci Ah, okay, give me a minute and I'll update

http://stackoverflow.com/comment/47825384
has text: Your function requires an image element, right? the first thing you do is get the width and height from that element. For me it didn't work if I didn't change img.width to img.width() and the same for the height. Unless I am mistaken and it's not an image element you're passing to resizeImg()?
comment on: http://stackoverflow.com/a/29848855
type: AnswerComment
type: Comment
score: 0

http://stackoverflow.com/comment/47982808
comment on: http://stackoverflow.com/q/29925370
score: 0
type: Comment
type: QuestionComment
has text: Thx dandavis - the article you refer to is interesting and confirms my understanding that CSS and device pixels are not the same on all platfroms. I'm still none the wiser as to how to get the height of my device screen in CSS pixels and not device pixels

http://stackoverflow.com/comment/47855120
comment on: http://stackoverflow.com/a/29864850
type: AnswerComment
type: Comment
has text: no its no working as same i need to refresh the page... if i alert that tr_obj" alert(tr_obj); " it is returning 'tr_o' for first table value. so how can i delete instantly
score: 0

http://stackoverflow.com/comment/47968755
comment on: http://stackoverflow.com/q/29923542
score: 0
type: Comment
type: QuestionComment
has text: In your controller try: ->where ('chosen_title', '=', $firsttitle)->first(); and then $articledelete->delete();

http://stackoverflow.com/comment/48050989
type: AnswerComment
has text: Your combine sort I've usually seen called a merge sort, and is a definite winner IF both source arrays are sorted. OP wasn't clear about that (still waiting on a answer there). Excellent demonstration.
type: Comment
comment on: http://stackoverflow.com/a/29959549
score: 0

http://stackoverflow.com/comment/47933331
comment on: http://stackoverflow.com/q/29900098
type: Comment
has text: The page is probably submitting too early before the value is set. You'll need to trigger the postback from JavaScript after you set the value to make sure `__doPostBack()` isn't firing until you want it to. You should probably just use a regular html control in that case.
type: QuestionComment
score: 0

http://stackoverflow.com/a/29908869
upvote count: 2
answers question: http://stackoverflow.com/q/29908744
has comment: http://stackoverflow.com/comment/102494578
score: 2
downvote count: 0
type: Answer
has body: You can't sort objects but you can sort arrays, so you can create an array of HTMLOptionElementobjects and sort it and then append it to the select element. $('#country').append(function() { return $.map(result, function (key, value) { return new Option(key, value); }).sort(function (a, b) { return a.text.localeCompare(b.text); }); }); Here is a demo.

http://stackoverflow.com/comment/47817620
type: Comment
has text: Hm, k. Have you tried inspecting what the responses are in your ajax calls? I'd just want to verify that you're not pulling in something you don't want to. For example, an ORM might unexpectedly pull in joined tables and you end up with a giant model object instead of a small row like you expect.
type: QuestionComment
comment on: http://stackoverflow.com/q/29845708
score: 0

http://stackoverflow.com/a/29870016
answers question: http://stackoverflow.com/q/29869905
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/47865569
has comment: http://stackoverflow.com/comment/47865415
downvote count: 0
has body: Use isolate-scope within the directive.. $scope.control.moveNeedle = function () { $scope.ScoreRotateNeedle(); } return { scope: **{control: '='}**, restrict: 'E', templateUrl: 'svgmeter.html', link: link, controller: 'delightMeterController' }; Add this code to your controller $scope.ctrl = {}; in HTML use
type: Answer

http://stackoverflow.com/comment/48015100
comment on: http://stackoverflow.com/q/29947027
score: 0
has text: Check your commit log and see what's changed.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/64963748
comment on: http://stackoverflow.com/a/29858546
type: AnswerComment
type: Comment
score: 0
has text: thnx, your answer is perfect for asp.net mvc where we don't call .validate directly and rely on defaults only

http://stackoverflow.com/a/29967576
accepted answer of: http://stackoverflow.com/q/29967511
upvote count: 5
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/48054908
type: Answer
has comment: http://stackoverflow.com/comment/48054812
has comment: http://stackoverflow.com/comment/48054719
has comment: http://stackoverflow.com/comment/48055363
answers question: http://stackoverflow.com/q/29967511
has comment: http://stackoverflow.com/comment/48056069
has body: You should be appending the lis into the ul first. ul.append(li); $('.price-info').append(ul);
has comment: http://stackoverflow.com/comment/48055538
score: 5
has comment: http://stackoverflow.com/comment/48055873

http://stackoverflow.com/comment/48032516
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29955687
has text: Well, that's how it works, if you want to keep the first LI, you have to call remove on the other LI's, and then start adding the new LI's.
score: 0

http://stackoverflow.com/comment/47879911
has text: If `cartItems` changes, the template will change also. What is the problem?
comment on: http://stackoverflow.com/q/29877829
score: 1
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47931069
comment on: http://stackoverflow.com/q/29903915
score: 0
has text: @charlietfl : please see fiddle result and inspect categories in each object.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29920336
tagged with: javascript
has answer: http://stackoverflow.com/a/29921583
has title: Token google analytics and relationship webPropertyId / profilId
tagged with: google-oauth
score: 0
answer count: 1
has body: I am currently developing a dashboard with Google Analytics API, which will be accessible website back office. I realized this during this developing javaScript I block on 2 things: The first is the authentication must be transparent to the user via the use of a token. In my approach I utlise OAuth2 of the API by generating a token with the playground for this token to be valid I join my code gapi.analytics.ready(function() { var CLIENT_ID = 'XXXX.apps.googleusercontent.com'; var CLIENT_SECRET ='XXX...'; var ACCESS_TOKEN = 'XXX...'; var REFRESH_TOKEN ='XXXX....'; var EXPIRE_IN ='3600'; var TOKEN_TYPE ='Bearer'; var ACCESS_TYPE ='offline'; var SCOPE = 'https://www.googleapis.com/auth/analytics.readonly' gapi.analytics.auth.authorize({ clientid: CLIENT_ID, client_secret:CLIENT_SECRET, serverAuth: { access_token: ACCESS_TOKEN, refresh_token: REFRESH_TOKEN, //token_type: TOKEN_TYPE, //expires_in: EXPIRE_IN, //access_type: ACCESS_TYPE, } }); After the validity of the data are more accessible with a 401 error (logical because the token is no longer valid) or to my first question about how to obtain a valid token all the time? My second question concerns the recovery of data I based on the recovery of the profile number (like many such works). However SEVERAL of my sites using the tracking number (UA-XXXXXXXX-N). Knowing that sites use this number is the posibility to find the profilId thanks to the tracking number and accountId that lion can deduct. But I do not know how to arive. Es that someone already out how to make this relationship ??? Pending your answers thank you in advance (Sorry for the translation I utlise google translation)
type: UnansweredQuestion
tagged with: google-analytics-api
tagged with: access-token
type: Question
tagged with: google-analytics

http://stackoverflow.com/q/29962091
favorite count: 0
has answer: http://stackoverflow.com/a/29962343
accepted answer: http://stackoverflow.com/a/29962343
score: 2
type: AnsweredQuestion
type: Question
upvote count: 2
has body: How do I set the geocode from the response.loc: $("#details").html("Location: " + response.loc);. As the value for: var latlng = new google.maps.LatLng(59.6162,16.5528); var geocoder; var map; var infowindow = new google.maps.InfoWindow(); var marker; function initialize() { geocoder = new google.maps.Geocoder(); var latlng = new google.maps.LatLng(59.6162,16.5528); var mapOptions = { zoom: 13, center: latlng, mapTypeId: 'hybrid' } map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions); } function codeLatLng() { var input = document.getElementById('latlng').value; var latlngStr = input.split(',', 2); var lat = parseFloat(latlngStr[0]); var lng = parseFloat(latlngStr[1]); var latlng = new google.maps.LatLng(lat, lng); geocoder.geocode({'latLng': latlng}, function(results, status) { if (status == google.maps.GeocoderStatus.OK) { if (results[1]) { map.setZoom(15); marker = new google.maps.Marker({ position: latlng, map: map }); infowindow.setContent(results[1].formatted_address); infowindow.open(map, marker); } else { alert('No results found'); } } else { alert('Geocoder failed due to: ' + status); } }); } google.maps.event.addDomListener(window, 'load', initialize); // get geocode from IP // $.get("http://ipinfo.io", function (response) { $("#ip").html("Your IP: " + response.ip); $("#address").html("Location: " + response.city + ", " + response.region); $("#details").html("Location: " + response.loc); }, "jsonp");
tagged with: google-maps
answer count: 1
tagged with: javascript
tagged with: jquery
has title: How do you set a value from a getter?
downvote count: 0

http://stackoverflow.com/comment/47845534
comment on: http://stackoverflow.com/q/29859798
score: 0
type: Comment
type: QuestionComment
has text: @AlfonsoGarnett oh I don't disagree with the notion that it's a simple way to get a browser to cache something, but it's just that a JavaScript file isn't an image. Maybe it's not so obvious that the "load" event is about the *successful* load and interpretation of the image source.

http://stackoverflow.com/q/29984478
score: 2
has comment: http://stackoverflow.com/comment/48088888
downvote count: 0
tagged with: javascript
has body: I just stumbled on the IndexedDB example on MDN which contains the following: function openDb() { var req = indexedDB.open(DB_NAME, DB_VERSION); req.onsuccess = function (evt) { // Better use "this" than "req" to get the result // to avoid problems with garbage collection. // db = req.result; db = this.result; }; // Rest of code omitted for brevity } What is the problem with the garbage collector that should better be avoided?
has comment: http://stackoverflow.com/comment/48089059
has comment: http://stackoverflow.com/comment/48088354
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/29984939
has answer: http://stackoverflow.com/a/29984939
favorite count: 0
has answer: http://stackoverflow.com/a/29984692
type: Question
upvote count: 2
answer count: 2
tagged with: garbage-collection
has comment: http://stackoverflow.com/comment/48088321
has comment: http://stackoverflow.com/comment/48088414
has title: Using "this" in a callback vs external variable and the garbage collector
has comment: http://stackoverflow.com/comment/48088634
has comment: http://stackoverflow.com/comment/48088261
accepted answer: http://stackoverflow.com/a/29984692
has comment: http://stackoverflow.com/comment/48088540
has comment: http://stackoverflow.com/comment/48089007

http://stackoverflow.com/comment/47987447
comment on: http://stackoverflow.com/a/29932440
score: 0
type: AnswerComment
type: Comment
has text: short answer: yes. Why? i cannot think of a place where says that you cannot store an `object`'s reference inside another `object`.

http://stackoverflow.com/comment/47875575
has text: @energ1ser, Not sure how that could possibly work (are you seriously going to render hidden views for every course in the dropdown?) You need to use ajax to call a controller method (passing the ID of the selected course) which returns a partial view and then update the DOM.
score: 0
type: Comment
comment on: http://stackoverflow.com/q/29873787
type: QuestionComment

http://stackoverflow.com/q/29955816
has comment: http://stackoverflow.com/comment/48032407
has comment: http://stackoverflow.com/comment/48032482
upvote count: 1
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29955878
score: 1
has body: I tried to create an imgLoader function that take in 3 arguements : btn : the btn that got click img : the specific img that will be load on imgPath : the path to the img that I want to load I also want the btn to be optional, so I check if btn is true. Here is what I come up with : function imgLoader( btn, img, imgPath) { if (btn) { $btnBiDefault.removeClass('btn-bi-default-clicked'); btn.addClass('btn-bi-default-clicked'); } img.attr('src', imgPath); } I tried to call imgLoader in one of my click funtion : $name.click(function(e) { e.preventDefault(); imgLoader({ img: $img, imgPath: '/path-to-img/image.png' }); }); I got 0 error, not even warning on my .js file. I couldn't get my img to load. I keep getting : Uncaught TypeError: btn.addClass is not a function Can someone please give me a hint ?
has title: How can I create a helper function to change image using jQuery?
type: Question
downvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/48032451
favorite count: 0
accepted answer: http://stackoverflow.com/a/29955878
has comment: http://stackoverflow.com/comment/48032475

http://stackoverflow.com/a/29960366
has body: The code you are using is unnecessarily initializing the modal again on that element. Use modal('hide') : Docs, success: function () { $('#ResetPasswordModal').modal('hide'); }, If you further wish to use this again, 'toggle' would be a better option. $('#ResetPasswordModal').modal('toggle')
score: 0
answers question: http://stackoverflow.com/q/29960304
type: Answer

http://stackoverflow.com/comment/48120666
has text: this is perfect and exactly what I was looking ahead for have one more query which I will be uploading soon here by tomorrow. Please do check it out if you can help me out with that too.Thank You.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29974918

http://stackoverflow.com/comment/49117590
score: 0
type: Comment
type: QuestionComment
has text: @Merijndk yes. i dont know what is the main problem. but its working on other pc. all browser. only in my pc its not working properly
comment on: http://stackoverflow.com/q/29933592

http://stackoverflow.com/comment/47859866
type: Comment
comment on: http://stackoverflow.com/a/29867504
type: AnswerComment
has text: Nice answer. Although I think the problem is that javascript is not really single threaded. If you look at a simple Java program not starting any threads or anything and no asynchronous methods (actually asynchronous implies multi threaded I think) THEN it is impossible to create race conditions, right?
score: 0

http://stackoverflow.com/q/29846983
has title: count dynamic number of input elements on dom using jquery
type: AnsweredQuestion
score: 4
downvote count: 1
has answer: http://stackoverflow.com/a/29847204
type: Question
possible better answer: http://stackoverflow.com/a/29847004
has answer: http://stackoverflow.com/a/29847000
has answer: http://stackoverflow.com/a/29847004
has body: How can count all input elements with has id which starting with (myInputElem) inside dom using jquery. So there will be dynamic number of input elements like &lt;input id="myInputElem1" type="text" value="Eleme1"&gt; &lt;input id="myInputElem2" type="text" value="Eleme2"&gt; .. &lt;input id="myInputElemx" type="text" value="Elemex"&gt; So I just need to count them.
upvote count: 5
tagged with: javascript
tagged with: jquery
answer count: 3
accepted answer: http://stackoverflow.com/a/29847000
favorite count: 0

http://stackoverflow.com/comment/47857006
has text: fiddle: http://jsfiddle.net/craigiannazzi/jsqbbp9w/7/
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29865834

http://stackoverflow.com/a/29929892
has body: The regex below will convert the BBCode to HTML: result = subject.replace(/\[(b|i|p)\](.*?)\[\/(b|i|p)\]/g, "&lt;$1&gt;$2&lt;/$3&gt;"); You'll need to add more tags but you get the idea. Demo http://jsfiddle.net/tuga/sp5597aj/1/
type: Answer
upvote count: 1
downvote count: 1
answers question: http://stackoverflow.com/q/29929760
score: 0

http://stackoverflow.com/q/29998843
tagged with: node.js
linked to: http://stackoverflow.com/q/4568689
has comment: http://stackoverflow.com/comment/48120140
score: 0
duplicate of: http://stackoverflow.com/q/4568689
has title: Node JS Error when copying file across partition. How to resolve this issue?
has comment: http://stackoverflow.com/comment/48130102
tagged with: javascript
type: UnansweredQuestion
tagged with: express
has comment: http://stackoverflow.com/comment/48117077
linked to: http://stackoverflow.com/q/12196163
answer count: 0
has body: Node.JS fs.rename doesn&#39;t work Copying file from temporary folder to another partition gives error Just the same problem on windows (7) platform. Here is the form handler code I am using.. app.post('/contest/vacation-photo/:year/:month' , function(req, res){ var form = formidable.IncomingForm(); form.parse(req, function(err, fields, files){ if(err) return res.redirect(303, '/error'); if(err){ res.session.flash = { type: 'danger', intro: 'Oops!', message: 'There was an error in processing your submission. ' + 'Please try again.', }; return res.redirect(303, '/contest/vacation-photo'); } var photo = files.photo; var dir = vacationPhotoDir + '/' + Date.now(); var path = dir + '/' + photo.name; fs.mkdirSync(dir); fs.renameSync(photo.path, dir + '/' + photo.name); saveContestEntry('vacation-photo', fields.email, req.params.year, req.params.month, path); res.session.flash = { type: 'Hurray', intro: 'Good Luck!', message: 'You have entered into the contest.', }; return res.redirect(303, '/contest/vacation-photo/entries'); }); }); This is the error I am getting.. fs.js:638 return binding.rename(pathModule._makeLong(oldPath), ^ Error: EXDEV, cross-device link not permitted 'C:\Users\GARGAN~1\AppData\Local\T emp\upload_f6d504b9c38177d30e03ba2091e02168'
type: Question
tagged with: git

http://stackoverflow.com/a/29980044
has body: Here is a simpler method of achieving the same effect without grabbing the window.onresize event (which fires repeatedly throughout the resize event not just at the end). Using the heredoc function defined below allows for better maintainabilty and readability in your code. In this example I include the overlay which is not included in your javascript code. This method uses margins to center the iframe within the overlay which is fixed in one position and set to the width and height of the viewport. function heredoc(f) { return f.toString().match(/\/\*\s*([\s\S]*?)\s*\*\//m)[1]; }; var overlay = document.createElement("div"); var iframe = document.createElement("iframe"); iframe.setAttribute("src", "https://www.google.ca"); overlay.style.cssText = heredoc(function() {/* z-index: 2147483647; position: fixed; top: 0; width: 100vw; height: 100vw; background: rgba(0,0,0,0.8); */}); iframe.style.cssText = heredoc(function() {/* display: block; margin-top:20px; width: 450px; max-width: 100vw; height: 150px; border: 1px solid #ddd; overflow:visible; margin: 0 auto; margin-top: 20px; */}); overlay.appendChild(iframe); document.getElementById('main').appendChild(overlay); // you can also use // document.body.appendChild(overlay); // if you don't want to require that the user have an element with the id main /* for example only, not required */ body { width: 1000px; height: 1000px; } &lt;body&gt; &lt;p id="main"&gt; This is a bunch of text. Yadda yadda. &lt;/p&gt; &lt;/body&gt;
score: 1
has comment: http://stackoverflow.com/comment/48197451
has comment: http://stackoverflow.com/comment/48192900
upvote count: 1
has comment: http://stackoverflow.com/comment/48083815
answers question: http://stackoverflow.com/q/29979608
type: Answer
has comment: http://stackoverflow.com/comment/48189149
downvote count: 0

http://stackoverflow.com/q/29898985
accepted answer: http://stackoverflow.com/a/29899038
type: Question
tagged with: object
has comment: http://stackoverflow.com/comment/47920775
score: 3
has answer: http://stackoverflow.com/a/29899038
tagged with: javascript
has comment: http://stackoverflow.com/comment/47922035
has body: I have an object like : cols : [Object { name="firstname", type="string"}, Object { name="lastname", type="string"}, Object { name="valid", type="checkbox"} ....] I need to create, from this object, and object like : [ { data: 'firstname' }, { data: 'lastname' }, { data: 'valid', type: checkbox } ] The only rule is, if in the first object there is type="string", you just have to ignore it (check my second object). And of course it's just an example, so I need some automatic thing. I'm trying to work in this function : var headers = data.cols.map(function (el, index) { return el.name; }); Here I can retrieve my element el.name and el.type. But I don't know how can I create this specific object ? I tried with splice, push... but for create multiple lines etc.. I have no idea.
answer count: 2
possible better answer: http://stackoverflow.com/a/29899322
downvote count: 1
has comment: http://stackoverflow.com/comment/47920832
tagged with: arrays
favorite count: 0
upvote count: 4
type: AnsweredQuestion
has title: Create object from another object in JavaScript
has answer: http://stackoverflow.com/a/29899322

http://stackoverflow.com/q/29994912
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/48109800
has comment: http://stackoverflow.com/comment/48109513
possible better answer: http://stackoverflow.com/a/29995181
has answer: http://stackoverflow.com/a/29995181
has comment: http://stackoverflow.com/comment/48109720
tagged with: dry
accepted answer: http://stackoverflow.com/a/29995127
has comment: http://stackoverflow.com/comment/48109581
has comment: http://stackoverflow.com/comment/48109412
type: AnsweredQuestion
tagged with: refactoring
has comment: http://stackoverflow.com/comment/48109420
has body: I have this really long function that sets all the variable positions. Is it better to leave it like this or try to refactor it? If I refactor it the only way I can think of is to do something like: function getPosition(name, id){ var name+"Box" = id.getBoundingClientRect(); var name+"Top" = name+"Box".top + window.pageYOffset - de.clientTop; var name+"Bottom" = name+"Box".bottom + window.pageYOffset - de.clientTop; name+"Diff" = name+"Bottom" - name+"Top"; var pagePadding = winHight - ame+"Diff"; name+"StartP" = name+"Top" - (name+"Padding"-100); } Is this any better for speed? Code I am talking about: function getElementOffset(){ var de = document.documentElement; var winHight = window.innerHeight; var pageBox = featurePage.getBoundingClientRect(); var pageTop = pageBox.top + window.pageYOffset - de.clientTop; var pageBottom = pageBox.bottom + window.pageYOffset - de.clientTop; pageDiff = pageBottom - pageTop; var pagePadding = winHight - pageDiff; pageStartP = pageTop - (pagePadding-100); var profileBox = featureProfile.getBoundingClientRect(); var profileTop = profileBox.top + window.pageYOffset - de.clientTop; var profileBottom = profileBox.bottom + window.pageYOffset - de.clientTop; profileDiff = profileBottom - profileTop; var profilePadding = winHight - profileDiff; profileStartP = profileTop - (profilePadding); var barOneBox = firstBar.getBoundingClientRect(); var barOneTop = barOneBox.top + window.pageYOffset - de.clientTop; var barOneBottom = barOneBox.bottom + window.pageYOffset - de.clientTop; barOneDiff = barOneBottom - barOneTop; var barOnePadding = winHight - barOneDiff; barOneStartP = barOneTop - (barOnePadding -200); barOneStart2P = barOneTop - (barOnePadding -barOnePadding +100); var barTwoBox = secondBar.getBoundingClientRect(); var barTwoTop = barTwoBox.top + window.pageYOffset - de.clientTop; var barTwoBottom = barTwoBox.bottom + window.pageYOffset - de.clientTop; barTwoDiff = barTwoBottom - barTwoTop; var barTwoPadding = winHight - barTwoDiff;…
type: Question
has answer: http://stackoverflow.com/a/29995127
tagged with: javascript
has title: Refactoring repetitive code -js

http://stackoverflow.com/a/29906402
score: 0
type: Answer
answers question: http://stackoverflow.com/q/29904633
has body: What you have to do is prevent the form submission until you can validate the user response by using the Google reCaptcha verify callback, then, if it passes, allow the form to submit. See this answer: Google ReCAPTCHA how to make required? and also check the documentation: https://developers.google.com/recaptcha/docs/display#example

http://stackoverflow.com/comment/47823765
comment on: http://stackoverflow.com/q/29848908
type: Comment
type: QuestionComment
score: 0
has text: seems you have to use a closure function

http://stackoverflow.com/q/29993440
has comment: http://stackoverflow.com/comment/48106850
favorite count: 0
has body: The code below is meant to compare two arrays and then return the difference, however it only seems to work when the last value of the array gets removed, can someone help ? When it works : array1 : [lol,lol2] array2 : [lol,lol2,lol3] It will return lol3 When it doesnt work : array1 : [lol,lol3] array2 : [lol,lol2,lol3] It returns undefined function getChange(array1,array2){ $.each( array2,function(key,value){ if(($.inArray(value,array1))!==-1){ found="notfound"; } else { no=false; newVAL = value; array1 = array2; return false; } }); if(no==false) { return newVAL; } }
has answer: http://stackoverflow.com/a/29994258
type: UnansweredQuestion
score: -3
has comment: http://stackoverflow.com/comment/48112802
has comment: http://stackoverflow.com/comment/48106200
type: Question
has comment: http://stackoverflow.com/comment/48106453
has comment: http://stackoverflow.com/comment/48107113
tagged with: javascript
tagged with: jquery
has title: jQuery $.each() bug
downvote count: 4
has comment: http://stackoverflow.com/comment/48106655
upvote count: 1
has comment: http://stackoverflow.com/comment/48106326
answer count: 1

http://stackoverflow.com/comment/48004961
type: Comment
type: QuestionComment
has text: Thanks might do that, if interested then I recommend to only focus on the part with openDb and Query, as basically the issue is that I am trying to resolve opening a database and retrieving data. However, for this data to be retrieves, the platform needs to be ready, but the platform is only ready when everything is resolved, so you get a chicken or egg situation.
comment on: http://stackoverflow.com/q/29940364
score: 0

http://stackoverflow.com/comment/47860532
type: QuestionComment
has text: like I said the story.js is not customizable since it get re-written every time a project is edited or changed - what if my user.js is identical to story.js with the small change I need - since it gets loaded after story.js - won't it replace the existing behavior of story.js?
comment on: http://stackoverflow.com/q/29867194
score: 0
type: Comment

http://stackoverflow.com/comment/48123264
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/30001050
has text: Yeah, I think restructuring my code in this way will help the efficiency of looping, I also find @maraca solution very useful, I'll keep that in mind. If you want to check it out [link](http://zoharica.heliohost.org/newGame/ver5/)

http://stackoverflow.com/a/29925682
score: 3
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/47972979
has body: Please check this code function imageEnlarge() { document.getElementById('1').style.height="100%"; document.getElementById('1').style.width="100%"; document.getElementById('1').style.position='absolute'; } function imageReset() { document.getElementById('1').style.height="80%"; document.getElementById('1').style.width="80%"; document.getElementById('1').style.position='absolute'; }
upvote count: 3
accepted answer of: http://stackoverflow.com/q/29925538
answers question: http://stackoverflow.com/q/29925538
downvote count: 0

http://stackoverflow.com/a/49543871
type: Answer
answers question: http://stackoverflow.com/q/29876185
downvote count: 1
score: 3
upvote count: 4
has body: Content property of pseudo element :before accepts images too. In slick-theme.css change: // change $slick-prev-character: "←" !default; // to $slick-prev-character: url('image-prev.png'); // and $slick-next-character: "→" !default; // to $slick-next-character: url('image-next.jpg'); or directly change the content property on slick-prev:before and slick-next:before .slick-prev { left: -25px; [dir="rtl"] &amp; { left: auto; right: -25px; } &amp;:before { content: url('image-prev.jpg'); // &lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt; [dir="rtl"] &amp; { content: url('image-next.jpg'); // &lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt; } } } .slick-next { right: -25px; [dir="rtl"] &amp; { left: -25px; right: auto; } &amp;:before { content: url('image-next.jpg'); // &lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt; [dir="rtl"] &amp; { content: url('image-prev.jpg'); // &lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt; } } }

http://stackoverflow.com/comment/47959649
type: AnswerComment
score: 0
has text: Thanks @Luckyrat I didn't know that, what would be the pre37 way? Is importing global proprety of TextEndoder/TextDecoder also FF37+ or just crypto?
type: Comment
comment on: http://stackoverflow.com/a/29907618

http://stackoverflow.com/comment/47868606
score: 0
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/29871541
has text: The problem with what you have above is that you can't do `User.get().success()` in `UserCtrl` if you didn't return `$http`, the actual promise, in `User.get()`. I think I managed to figure it out though, and it's based on the difference between `success()` and `then()` with promises. If both the factory and controller used `then()`, it seems to work.

http://stackoverflow.com/q/29872680
score: 0
answer count: 1
has body: Looking at the JavaScript they use, it seems that there should not be any issues. It looks as if it is just pushing some simple data up to google. Just wondering if there is anything I should think about when using Google Analytics on User Restricted ASP.NET MVC pages, or any restricted page for that matter. I'm also thinking of tracking regular users vs admin users, most of which use separate pages, but I could load one google analytics script over another depending on the user role.
type: AnsweredQuestion
tagged with: google-analytics
accepted answer: http://stackoverflow.com/a/29872720
type: Question
tagged with: asp.net-mvc-5
has title: Will Google Analytics have any problems if I use it on User Restricted pages
has answer: http://stackoverflow.com/a/29872720
tagged with: javascript

http://stackoverflow.com/comment/48085236
type: QuestionComment
has text: Sorry, I just thought it would be a good to have a live version to play with as to be honest I don't know what code I could of pasted on here... The whole UI library I am using?
score: 0
comment on: http://stackoverflow.com/q/29964773
type: Comment

http://stackoverflow.com/a/29883134
score: 1
answers question: http://stackoverflow.com/q/29882805
upvote count: 1
type: AcceptedAnswer
has body: You need to allow cross origin requests from the server. In PHP, this does the trick header('Access-Control-Allow-Origin: *'); From looking at your python code I suppose this should help (.. I suppose) class postexamhandeler(webapp2.RequestHandler): def post(self): owner = self.request.get('owner') name = self.request.get('ename') date = self.request.get('edate') leangth = self.request.get('eleangth') pencil = self.request.get('epencil') pen = self.request.get('epen') calculator = self.request.get('ecalculator') ruller = self.request.get('eruller') type = self.request.get('etype') self.response.headers["Content-Type"] = "application/json" self.response.headers["Access-Control-Allow-Origin"] = "*" self.response.headers['charset'] = "utf-8" if len(name) &gt; 0 and len(type) &gt; 0: self.response.out.write('{ "response": "OK"}') else: self.response.out.write('{ "response": "ERROR"}') exm = makeexam(id= owner) exm.ename = name exm.edate = date exm.eleangth = leangth exm.epencil = pencil exm.epen = pen exm.ecalculator = calculator exm.eruller = ruller exm.etype = type exm.put() self.response.out.write('{ "response": "OK"}') This should add the cors response header self.response.headers["Access-Control-Allow-Origin"] = "*"
has comment: http://stackoverflow.com/comment/47890566
type: Answer
accepted answer of: http://stackoverflow.com/q/29882805
downvote count: 0

http://stackoverflow.com/comment/47972666
type: AnswerComment
score: 0
type: Comment
has text: thank you , I think that doesn't change much comparing to merging the two functions . Moreover when the result.data is true I want to do an instruction using `$scope.list[i]` but when testing `console.log($scope.list[i]);` inside `.success` I get undefined
comment on: http://stackoverflow.com/a/29924694

http://stackoverflow.com/a/29940721
score: 0
type: Answer
has body: I found my answer in below post Disable Text Entry in Modified for max length $(document).on('keyup','#divid table tbody tr td input', function () { // Remove invalid characters var sanitized = $(this).val().replace(/[^-.0-9]/g, ''); // Remove non-leading minus signs sanitized = sanitized.replace(/(.)-+/g, '$1'); // Remove the first point if there is more than one sanitized = sanitized.replace(/\.(?=.*\.)/g, ''); // Update value $(this).val(sanitized); if(sanitized.indexOf(".")!= -1 && sanitized.indexOf("-")!= -1) { $(this).attr("maxlength","13"); } else if(sanitized.indexOf(".")!= -1) { $(this).attr("maxlength","12"); } else if(sanitized.indexOf("-")!= -1) { $(this).attr("maxlength","12"); } else { $(this).attr("maxlength","11"); } });
answers question: http://stackoverflow.com/q/29938302

http://stackoverflow.com/q/29971322
has comment: http://stackoverflow.com/comment/48066780
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/48062497
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29973517
has comment: http://stackoverflow.com/comment/48062543
has comment: http://stackoverflow.com/comment/48066087
has comment: http://stackoverflow.com/comment/48062447
has comment: http://stackoverflow.com/comment/48062595
type: Question
has comment: http://stackoverflow.com/comment/48066097
tagged with: javascript
score: 4
has comment: http://stackoverflow.com/comment/48066805
has title: Applying CSS on ready doesn't render properly until window is resized
upvote count: 4
accepted answer: http://stackoverflow.com/a/29973517
has comment: http://stackoverflow.com/comment/48065745
has comment: http://stackoverflow.com/comment/48066496
has body: I have two JavaScript functions. A function called Init(), which checks information rendered on the page, is fired on $(document).ready() and, at the end of this function, it calls a function called Size() after it is done checking everything. Size() has to be performed each time the browser is resized too, so it can balance out some CSS. For some reason though, Size() doesn't work properly during Init() and doesn't actually do what it should until it is called when the browser window is resized. Are these functions being used properly? Is Size() missing something on init? var h = $(window).height(), w = $(window).width(), m = 30; // global margin var fitTop, fitBot; function fitInit() { fitTop = $(".fit-compare-top").length; fitBot = $(".fit-compare-bottom").length; fitSize(); } function fitSize() { if (w &lt; 1024) { $(".fit-compare-item").width(w*0.7); if (w &gt; 767) { mm = 220; } else { mm = m } $(".fit-compare-tops").width(Math.min(400 + m + 5,(w * 0.7 + m + 5)) * fitTop + mm); $(".fit-compare-bottoms").width(Math.min(400 + m + 5,(w * 0.7 + m + 5)) * fitBot + mm); } else { // this where I'm having the problem // the height of the follow object remains // unchanged until $(window).resize() $('.fit-hero-text').height(h-h/5).css({ "padding-top": h*0.3 }); $(".pillars-section").height( (Math.min(1280,w)*0.4)*1.5 ); } } $(document).ready(function() { fitInit(); }); $(window).resize(function() { fitSize(); }); I have tried removing the Size() from Init() and putting it in $(document).ready() but that has the same effect. And I obviously require this function to occur after the page is loaded, because I can't depend on a user to resize their browser. UPDATE: If I removed the padding-top CSS rule from $('.fit-hero-text') then there is no jump on resize and height is calculated and rendered properly. Why could this be?
answer count: 1
downvote count: 0
tagged with: jquery
has comment: http://stackoverflow.com/comment/48066004
favorite count: 0

http://stackoverflow.com/comment/48101780
type: QuestionComment
type: Comment
has text: I was thinking you could have a common js function and on page load of every page, call this common function by passing the url of the current page, and do your redirect in that common function. And on redirect, pass the redirected page's url as a querystring and ready it in he index.html
comment on: http://stackoverflow.com/q/29990911
score: 0

http://stackoverflow.com/comment/48108441
has text: Event bubbles up from the `li`, you can set an click event handler on the `ul` to capture it.
comment on: http://stackoverflow.com/q/29994415
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/a/29974846
type: Answer
accepted answer of: http://stackoverflow.com/q/29949879
has body: It sounds like you are not setting the id field on your data objects. Without this field, Select2 cannot know what to set the value of your &lt;select&gt; to, so it doesn't allow it to be selected. Additionally, the text field is required for searching and (by default) displaying the data in the results list.
upvote count: 17
has comment: http://stackoverflow.com/comment/129264981
score: 17
has comment: http://stackoverflow.com/comment/65993381
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/29949879

http://stackoverflow.com/comment/48065326
comment on: http://stackoverflow.com/q/29972419
type: Comment
type: QuestionComment
has text: simple to add an argument or arguments to the `getData()` method and resolve the url inside the service based on some sort of action descriptions passed in
score: 0

http://stackoverflow.com/q/29891586
has title: how to save serialize array of javascript value store in PHP on SUBMIT
tagged with: php
has answer: http://stackoverflow.com/a/29891831
has answer: http://stackoverflow.com/a/29891752
type: Question
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47906846
has comment: http://stackoverflow.com/comment/47906861
score: 0
answer count: 2
tagged with: serializearray
has comment: http://stackoverflow.com/comment/47906772
has body: I m using jquery datatables first time, so now i done table like this everything works perfectly. now i m using this below javascript code $(document).ready(function() { $('#example').dataTable( { "pageLength": 50, 'sDom': 'l' , } ); $('#example tfoot th').each( function () { var title = $('#example thead th').eq( $(this).index() ).text(); $(this).html( '&lt;input type="text" style="width:100%;" id="munna_'+title+'" placeholder="Search '+title+'" /&gt;' ); }); var table = $('#example').DataTable(); table.columns().every( function () { var that = this; $( 'input', this.footer() ).on( 'keyup change', function () { that .search( this.value ) .draw(); }); }); $('#munna_button').click( function() { var data = table.$('input, select').serialize(); alert(JSON.stringify(data)) return false; }); }); now this code returns value like this in rate_14=67&amp;rate_15=87&amp;rate_67=88 etc.., now i dont have idea how to store this on SUBMIT. normally on submit i get $_POST['name'] like this, now please some one hlep me from this.
type: UnansweredQuestion

http://stackoverflow.com/a/70648276
has body: Not sure why the other answers are so complicated, this can easily be achieved by looping through the array and flattening each entry until it's no longer an array. const flatten = (arr) =&gt; { for (let i = 0; i &lt; arr.length; i++) { while (Array.isArray(arr[i])) { arr.splice(i, 1, ...arr[i]); } } return arr; }
score: 0
answers question: http://stackoverflow.com/q/29991016
type: Answer

http://stackoverflow.com/q/29887626
has title: combin password regex with identical characters consecutively
has comment: http://stackoverflow.com/comment/47899042
type: AnsweredQuestion
score: 1
tagged with: java
type: Question
has body: I have a password regex as this ^((?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%&amp;*])).{0,100}$ I wanted to add the regex which will validate this and also exclude insertion of four identical characters consecutively I found this pattern which will give match the 4 identical characters but how do I combine them and this pattern should check there is 4 identical characters password should not be valid. (.)\1{3}
downvote count: 0
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/47899097
has answer: http://stackoverflow.com/a/29888347
favorite count: 0
tagged with: regex
has comment: http://stackoverflow.com/comment/47900270
accepted answer: http://stackoverflow.com/a/29888347
upvote count: 1

http://stackoverflow.com/q/29849843
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47826014
has comment: http://stackoverflow.com/comment/47827235
has answer: http://stackoverflow.com/a/29852138
has title: Google Maps API: Multiple GeoJson layers with MarkerClusterer + toggle
tagged with: markerclusterer
tagged with: toggle
tagged with: geojson
type: Question
has comment: http://stackoverflow.com/comment/47829593
tagged with: javascript
has body: I have a problem with my GeoJson layers which I want to cluster (with MarkerClusterer) and then be able to show and hide them via checkboxes or similar. Therefore I tried something like the code below: function initialize() { var mapOptions = { center: new google.maps.LatLng(52.515696, 13.392624), zoom: 11, mapTypeId: google.maps.MapTypeId.ROADMAP }; var map = new google.maps.Map(document.getElementById("map"), mapOptions); var bounds = new google.maps.LatLngBounds(); var barLayer = new google.maps.Data(); var cafeLayer = new google.maps.Data(); barLayer.loadGeoJson('json/eat_drink/bar.geojson'); cafeLayer.loadGeoJson('json/eat_drink/cafe.geojson'); var markerClusterer = new MarkerClusterer(map); var infowindow = new google.maps.InfoWindow(); markerClusterer.setMap(map); function displayMarkers(layer) { var layer = layer; google.maps.event.addListener(layer, 'addfeature', function (e) { if (e.feature.getGeometry().getType() === 'Point') { var marker = new google.maps.Marker({ position: e.feature.getGeometry().get(), title: e.feature.getProperty('name'), map: map }); // open the infoWindow when the marker is clicked google.maps.event.addListener(marker, 'click', function (marker, e) { return function () { var myHTML = e.feature.getProperty('name'); infowindow.setContent("&lt;div style='width:150px; text-align: center;'&gt;"+myHTML+"&lt;/div&gt;"); infowindow.setPosition(e.feature.getGeometry().get()); infowindow.setOptions({pixelOffset: new google.maps.Size(0,-30)}); infowindow.open(map, marker); }; }(marker, e)); markerClusterer.addMarker(marker); bounds.extend(e.feature.getGeometry().get()); map.fitBounds(bounds); map.setCenter(e.feature.getGeometry().get()); } }); layer.setMap(null); google.maps.event.addListener(map, "click", function () { infowindow.close(); }); }; document.getElementById('bar').onclick = function(){ // enable and disable markers if(document.getElementById('bar').checked == true){ displayMarkers(barLayer); }else{ return null; } }; } Unfortunatle…
score: 0
tagged with: google-maps
upvote count: 1
answer count: 1
downvote count: 1
favorite count: 0

http://stackoverflow.com/a/58903498
has body: Here's an alternative solution using javascipt: document.querySelector('.slick-prev').innerHTML = '&lt;img src="path/to/chevron-left-image.svg"&gt;'&gt;; document.querySelector('.slick-next').innerHTML = '&lt;img src="path/to/chevron-right-image.svg"&gt;'&gt;; Change the img to text or what ever you require.
type: Answer
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/116520048
answers question: http://stackoverflow.com/q/29876185
upvote count: 1

http://stackoverflow.com/q/29883236
answer count: 1
tagged with: bem
has comment: http://stackoverflow.com/comment/47934043
tagged with: javascript
type: UnansweredQuestion
score: 2
has title: How to organize the architecture of javascript form generator using a templates and BEM methodology?
downvote count: 0
favorite count: 0
type: Question
has answer: http://stackoverflow.com/a/29905950
tagged with: architecture
has body: How to organize the architecture javascript-generator forms using a template and BEM methodology? Good day! The essence of the problem is as follows: It is necessary to organize the generator forms based on json file with the description of control, like: "Order": ["input1", "input2", "cb3"], "Input1": { "Type": "input", "Title": "The first INPUT" "Path": "root.input", "Visible": true, "Editable": true } "Input2": {...} Types available for processing controls should be easily extensible. The data in the control must be extracted from the data source (they are available in the lines, paths in the property path, described in the control). The data source must be placed in a separate module, and shall provide public methods to retrieve data from it in the ways. Working with the DOM should occur through the jQuery library, or (preferably) i-bem. It is necessary to describe the controls and components of the page in the ideology of BEM. As the template syntax to use syntax mustache. Using jquery + mustache. Deliberate over whether to use the organization to require js mvc application structure. Can you please tell how to better organize the application architecture using a template mustache? (Because before they were not encountered, just beginning to learn) How can I apply the BEM-approach without using BEM technology stack? PS. Sorry for my English.
tagged with: mustache
upvote count: 2

http://stackoverflow.com/a/29907393
score: 2
answers question: http://stackoverflow.com/q/29907315
has comment: http://stackoverflow.com/comment/47937527
has comment: http://stackoverflow.com/comment/47937367
has body: Your regular expression works. The problem you are experiencing is that .replace() does not mutate the string. It returns a new string. If you want it to mutate the string, you need to assign the return value. str1 = str1.replace(/&lt;!-- COMPONENTS_LIST_START --&gt;(\s|.)*&lt;!-- COMPONENTS_LIST_END --&gt;/, str2);
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/47937344
upvote count: 2
has comment: http://stackoverflow.com/comment/47937397

http://stackoverflow.com/a/30201038
answers question: http://stackoverflow.com/q/29954361
has body: This is not something related to developing issue , this is something related to user specific environement. The Issue : Using IDM ,any URL that ends with a media extension (e.g *.JPG , *.PNG , *.MP4 , *.WMV , *.PDF ..etc ) will be downloaded automatically , However on the other hand if the user doesnt have IDM installed , the file will be viewed immediately in browser window. Possible Solutions : Remove PDF extension Handler from IDM , to prevent auto download, and i think the image explains it very well. Modify response header for your PDF link to force your browser to view pdf inside its view , please consider that each browser may handle the response differently , more details about this method can be found here. Final Note: As a developer you shouldnt handle each user specific environment , we suppose that when user installs a specific app to handle generic files , then it is his/her role to handle that application , and not the developer role , cause if you follow this algorithm you jump inside infinite loop handling different users specific setup.
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 26
accepted answer of: http://stackoverflow.com/q/29954361
upvote count: 26

http://stackoverflow.com/a/29995881
accepted answer of: http://stackoverflow.com/q/29995832
has body: Inject all the required dependency in your app module. That what you were injecting new module while declaring factory. Code var webapp = angular.module('myAppName',['angular-jwt']); webapp.factory('Auth',['$http', 'API_URL', '$window', '$location', 'jwtHelper', function($http, API_URL, $window, $location, jwtHelper ) { //your c0de here }]);
score: 2
answers question: http://stackoverflow.com/q/29995832
upvote count: 2
has comment: http://stackoverflow.com/comment/48111367
has comment: http://stackoverflow.com/comment/48111868
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/48111441
type: Answer
has comment: http://stackoverflow.com/comment/48111921

http://stackoverflow.com/a/29991701
has body: I'm unable to reproduce your problem. I've included a working code snippet that duplicates your setup at the bottom. Can you compare it to yours to see if I did something significant differently? Check my noty and q versions. It would help if you provided the exact error message and line number. Also, in your notifier module definition you have: define(['noty', '$q'], function (noty, $q) { var notifier = (function notifier() { var MESSAGE_TIMEOUT = 3000; function notifier(){ } //... return notifier; })(noty, $q); return notifier; }); That's really confusing way of doing it. You have three things named notifier and I don't see the need for wrapping the module in an IIFE. You could just have: define(['noty', '$q'], function (noty, $q) { var MESSAGE_TIMEOUT = 3000; function notifier(){} //... return notifier; }); And here's the working snippet: require.config({ paths: { "jquery": "http://code.jquery.com/jquery-2.1.1.min", "noty": "https://rawgit.com/needim/noty/v2.3.5/js/noty/packaged/jquery.noty.packaged.min", "$q": "https://rawgit.com/kriskowal/q/v1.3.0/q" //"notifier": "/content/js/notifier" // note, defined as a named module below } }); define('notifier', ['noty', '$q'], function(noty, $q) { var notifier = (function notifier() { var MESSAGE_TIMEOUT = 3000; function notifier() {} notifier.prototype.showErrorMessage = function(msg) { var deferred = $q.defer(); noty({ text: msg, type: 'error', layout: 'topCenter', timeout: MESSAGE_TIMEOUT }); setTimeout(function() { deferred.resolve(); }, MESSAGE_TIMEOUT); return deferred.promise; }; notifier.prototype.showSuccessMessage = function(msg) { var deferred = $q.defer(); noty({ text: msg, type: 'success', layout: 'topCenter', timeout: MESSAGE_TIMEOUT }); setTimeout(function() { deferred.resolve(); }, MESSAGE_TIMEOUT); return deferred.promise; }; notifier.prototype.showConfirmMessage = function(confirmMessage) { var deferred = $q.defer(); noty({ text: confirmMessage, type: 'confirm', layout: 'topCenter', buttons: [{ text: "Y…
type: Answer
score: 0
answers question: http://stackoverflow.com/q/29984906

http://stackoverflow.com/comment/48029584
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29954373
has text: Your `getInfo()` function should return `false` to stop the page reloading.

http://stackoverflow.com/a/29908749
downvote count: 0
has comment: http://stackoverflow.com/comment/47940045
type: Answer
upvote count: 2
answers question: http://stackoverflow.com/q/29908551
score: 2
has body: Not required. When input occurs, the browser will call the JavaScript functions that you have attached to those events. Simply put, the browser has its own main loop that calls your code on a standardized set of conditions. Let's say someone presses something on the keyboard. The browser will fire keydown and keyup events as the button is pressed and released. Also, if you use the statement window.requestAnimationFrame(yourFunction);, then yourFunction() will be called as early as possible in the next frame. If yourFunction() also calls window.requestAnimationFrame(yourFunction);, then yourFunction() will be your main loop. In your case, most of your heavy code will be attached to the mousedown, mouseup, or click events. You should not need a main loop. function yourClickHandler() { //Whatever happens when your gamepiece is clicked. } /* * This attaches the click event to some element that you use as your gamepiece. * If you're using Canvas, you will attach it to the canvas (instead of #GamePiece * and then need to figure out what is in the pixel that you clicked on in it. */ document.getElementById("#GamePiece").addEventListener("click", yourClickHandler, false); Your game can just sleep between user clicks, unless you need complex animations and stuff that cannot be done with CSS transitions and so forth. If it's, say, a turn-based strategy, then you can just make the piece look clicked, then sleep, then give it a destination, then sleep, then select something else, then sleep. Etc. If you do need complex animations and stuff... Then it is best to have yourClickHandler() do as little as possible. Try to do nothing more than set a variable and return. Your requestAnimationFrame()-based draw/update functions should use those variables to perform the intense calculations then. For instance, if you are making a character walk, let all the walking / falling / etc. happen once per frame. Just keep track of whether the button is pressed or not (or how far a joystick is t…

http://stackoverflow.com/comment/48080982
comment on: http://stackoverflow.com/q/29980701
type: Comment
has text: @charlietfl sorry about that, I'll update the code with it.
type: QuestionComment
score: 0

http://stackoverflow.com/comment/47902759
type: AnswerComment
has text: just tried. it fires too early :/ (before the css changes apply)
type: Comment
comment on: http://stackoverflow.com/a/29889486
score: 0

http://stackoverflow.com/q/29927352
tagged with: mobile
has comment: http://stackoverflow.com/comment/47976821
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/47976857
has title: Mobile Css not being called correctly in JS
answer count: 0
type: Question
has body: My issue is with the site http://navtant.com/ does not pass googles mobile friendly test. (my mobile css fixes all of these issues) here is my issue, the page should be calling "style-mobile.css" but it calls style-100px.css and style-desktop.css along with style.css. the page should resemble its sister site: https://equipmenttrackingsolutions.com/ both pages have the same css folder except the path for NavTant is different and I have already checked the path in the JS that determines the browser multiple times. NavTant: breakpoints: { 'global': { range: '*', href: 'assets/css/style.css' }, 'desktop': { range: '737-', href: 'assets/css/style-desktop.css', containers: 1200, grid: { gutters: 50 } }, '1000px': { range: '737-1200', href: 'assets/css/style-1000px.css', containers: 1000, grid: { gutters: 35 }, viewport: { width: 1080 } }, 'mobile': { range: '-736', href: 'assets/css/style-mobile.css', containers: '100%!', grid: { collapse: true, gutters: 20 }, viewport: { scalable: false } } }, ETS: breakpoints: { 'global': { range: '*', href: 'css/style.css' }, 'desktop': { range: '737-', href: 'css/style-desktop.css', containers: 1200, grid: { gutters: 50 } }, '1000px': { range: '737-1200', href: 'css/style-1000px.css', containers: 1000, grid: { gutters: 35 }, viewport: { width: 1080 } }, 'mobile': { range: '-736', href: 'css/style-mobile.css', containers: '100%!', grid: { collapse: true, gutters: 20 }, viewport: { scalable: false } } }, I have had my senior web designer take a look and he directed me here because he cannot figure out the issue either. I appreciate all help
tagged with: javascript
score: 0

http://stackoverflow.com/q/29857143
has comment: http://stackoverflow.com/comment/47840435
type: Question
has comment: http://stackoverflow.com/comment/47840227
has comment: http://stackoverflow.com/comment/47840368
accepted answer: http://stackoverflow.com/a/29857403
has comment: http://stackoverflow.com/comment/47840491
tagged with: javascript
tagged with: data-structures
has title: Correct JavaScript 6 type to use for c# equivalent of struct
has comment: http://stackoverflow.com/comment/47840245
has comment: http://stackoverflow.com/comment/47840318
answer count: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/47840323
has comment: http://stackoverflow.com/comment/47840426
favorite count: 0
has comment: http://stackoverflow.com/comment/47840361
has comment: http://stackoverflow.com/comment/47840521
has comment: http://stackoverflow.com/comment/47840353
has body: I'm still getting used to working with JavaScript after many years of working mostly in C#. I have an object that I'd like to instantiate. The object always has the same 7 fields in it. It's used to easily pass a set of 7 numbers around to various functions. var myObj = { 4: 0, 6: 0, 8: 0, 10: 0, 12: 0, 20: 0, 100: 0 }; In EMCAScript 6, classes have been defined, but from what I've found on the web, classes seem mostly used for defining functions on a class, similar to the prototype of an EMCAScript 5 function, and not for defining fields. What's the proper way to do this? My thinking right now is it's something like: var myObj = function () { this[4] = 0; this[6] = 0; this[8] = 0; this[10] = 0; this[12] = 0; this[20] = 0; this[100] = 0; }; var obj = new myObj(); I don't believe this is a matter of opinion. In most languages, there is a right way to do this. The way you would do this in C# is struct MyObj { public int Fours { get; set; } public int Sixes { get; set; } public int Eights { get; set; } public int Tens { get; set; } public int Twelves { get; set; } public int Twenties { get; set; } public int Hundreds { get; set; } }
tagged with: design-patterns
has comment: http://stackoverflow.com/comment/47840431
has comment: http://stackoverflow.com/comment/47840412
type: AnsweredQuestion
score: 3
has comment: http://stackoverflow.com/comment/47840316
has comment: http://stackoverflow.com/comment/47840530
upvote count: 3
has comment: http://stackoverflow.com/comment/47840498
possible better answer: http://stackoverflow.com/a/29857427
has answer: http://stackoverflow.com/a/29857403
has answer: http://stackoverflow.com/a/29857427

http://stackoverflow.com/a/29867037
has comment: http://stackoverflow.com/comment/48114138
has comment: http://stackoverflow.com/comment/48164419
has comment: http://stackoverflow.com/comment/48075531
has comment: http://stackoverflow.com/comment/48217296
type: AcceptedAnswer
downvote count: 0
has body: WHAT is the use of this line? I'm assuming you meant the first line of code in your question. It basically defines bsTransitionEnd as an alias for the transition end event (the transition end event may vary from browser to browser - that is what the function transitionEnd() does : determine the proper transition end event for the browser. I've used webkitTransitionEnd here on, but it could be something else depending on the browser) Why use an alias? It insulates any handlers that Bootstrap attaches using this alias (e.g. $('myBootstrapDialog').on('bsTransitionEnd', Bootstrap's handler) from any $('myBootstrapDialog').off('webkitTransitionEnd') that other code (say, your code or maybe another library) does - so the Bootstrap transition end animations would still work! Why would you or another library do that? The webkitTransitionEnd is a standard event, so let's say you decide to add a transition end animation to a bootstrap dialog - you'd probably do $('myBootstrapDialog').on('webkitTransitionEnd', your handler) and later on you decide to remove the handler you should be going $('myBootstrapDialog').off('webkitTransitionEnd', your handler), but you miscode it as $('myBootstrapDialog').off('webkitTransitionEnd') - this removes all transition end events :-(. But since Bootstrap attached it's handlers using 'bsTransitionEnd', the only way you could mess up bootstrap would be to do $('myBootstrapDialog').off('bsTransitionEnd') - not something you would do accidentally :-). So voila! Gone be the bugs where Bootstrap inexplicably stops working because of some small miscoding on your part. The bindType and delegateType basically state that bsTransitionEnd is an alias for transition events attached directly, and ones that are delegated (bubbles). The handle is basically a filter function - all the triggered events basically go through this before the attached Bootstrap event handlers are called (if at all they are) what is $.event.special? I'm sure you'd know most of it al…
has comment: http://stackoverflow.com/comment/47859003
type: Answer
has comment: http://stackoverflow.com/comment/48217774
score: 14
accepted answer of: http://stackoverflow.com/q/29861597
upvote count: 14
answers question: http://stackoverflow.com/q/29861597

http://stackoverflow.com/a/68147623
upvote count: 9
downvote count: 0
has comment: http://stackoverflow.com/comment/126988756
score: 9
has body: The most comprehensive answer I've found (with explicit column names for INSERT, and custom values in the SELECT-statement) is here: https://github.com/knex/knex/issues/1056#issuecomment-156535234 by Chris Broome here is a modified copy of that solution: const query = knex // this part generates INSERT-clause of the // query (with column-names): INSERT "tablename" ("field1", "field2" ..) .into(knex.raw('?? (??, ??)', ['tableOrders', 'field_user_id', 'email_field'])) // and this part generates the "SELECT"-clause (even though it starts with `.insert`) .insert(function() { this .select( 'user_id', // select from column without alias knex.raw('? AS ??', ['jdoe@gmail.com', 'email']), // select static value with alias ) .from('users AS u') .where('u.username', 'jdoe') }); console.log(query.toString()); and the SQL-output: insert into "orders" ("user_id", "email") select "user_id", 'jdoe@gmail.com' AS "email" from "users" as "u" where "u"."username" = 'jdoe' using this approach one can for example fill a "profile"-table from pre-defined "templates"-table (select from template), and at the same time merge the template data with user preferences/other values (like NOW()). another one approach (by Knex developer): https://github.com/knex/knex/commit/e74f43cfe57ab27b02250948f8706d16c5d821b8#diff-cb48f4af7c014ca6a7a2008c9d280573R608 - also with knex.raw
type: Answer
answers question: http://stackoverflow.com/q/29870713

http://stackoverflow.com/comment/47875605
comment on: http://stackoverflow.com/a/29875263
has text: The page... I was speaking about the whole page not the modal.
score: 0
type: Comment
type: AnswerComment

http://stackoverflow.com/comment/47987799
score: 0
type: Comment
has text: @AustinHansen: Welcome to Stack Overflow. If this answer was helpful, please click the check mark to the left. Have a look at [How does accepting an answer work?](http://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work) for more information.
comment on: http://stackoverflow.com/a/29932606
type: AnswerComment

http://stackoverflow.com/comment/48037872
score: 0
comment on: http://stackoverflow.com/q/29958611
type: Comment
type: QuestionComment
has text: Wrap your jquery in $(function(){ [script here] }); - this will wait until ondocumentready so you know jquery can access the dom

http://stackoverflow.com/comment/48045193
type: AnswerComment
type: Comment
score: 0
has text: Please correct your question, because in the title you also asked how to hide.
comment on: http://stackoverflow.com/a/29961585

http://stackoverflow.com/comment/47928872
type: Comment
has text: @ledia - I had temporarily deleted my comment because I made a slight modification to the jsfiddle. You might want to look at the jsfiddle again. It also occurred to me that you might want to be able to get the final time when the timer is stopped, here is a [jsfiddle](http://jsfiddle.net/zo9kv36s/6/) that shows how to do that.
comment on: http://stackoverflow.com/a/29871586
type: AnswerComment
score: 0

http://stackoverflow.com/comment/47959661
type: AnswerComment
comment on: http://stackoverflow.com/a/29919286
has text: @RGraham Thnx, you where faster than I was ;)
type: Comment
score: 0

http://stackoverflow.com/comment/48084895
has text: alright, posted as an answer
comment on: http://stackoverflow.com/q/29980765
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/a/29882914
has comment: http://stackoverflow.com/comment/47890103
has body: change if (navigator.onLine) { } else { window.open("http://www.lifeofaris.se/loginjs.php"); } to: if (!navigator.onLine) { window.location ='http://www.lifeofaris.se/loginjs.php'; //edit, should be '=', not a func } and in the second page (offline page), remove the javascript: if (navigator.onLine) { } else { window.open("http://www.lifeofaris.se/loginjs.php"); } No guarantees, but it should work. Edit: In the second page (offline page), you're missing a &gt;: &lt;script src="/js/login.js"&lt;/script&gt; &emsp;&emsp;Should be: &lt;script src="/js/login.js"&gt;&lt;/script&gt; Edit (2): The reason for the original 'Spamming' of pages was caused by the repeat of the following snippet: if (navigator.onLine) { } else { window.open("http://www.lifeofaris.se/loginjs.php"); } In the second page (offline page). This is because when you are redirected to the offline page, the online page's JS has worked out that you are offline and opened a new page. Now you have this offline page opened, you still have the code to check if you are offline, and since you are it will open a new offline page. Each of these new offline pages contains the same code that checks if you are offline, and since you are looking at the offline page, you are obviously offline, and so will keep on opening new pages, that is why I said to remove the snippet from the 'offline' page.
accepted answer of: http://stackoverflow.com/q/29882731
upvote count: 2
has comment: http://stackoverflow.com/comment/47891340
answers question: http://stackoverflow.com/q/29882731
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/47891509
type: Answer
score: 2

http://stackoverflow.com/a/29867847
has comment: http://stackoverflow.com/comment/47860825
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29867790
answers question: http://stackoverflow.com/q/29867790
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/47860694
has body: You have a CSS typo, instead of #sticky .stick use #sticky.stick (same thing but without a space).
has comment: http://stackoverflow.com/comment/47860749

http://stackoverflow.com/comment/48057967
comment on: http://stackoverflow.com/a/29969129
type: Comment
score: 0
type: AnswerComment
has text: I agree, which is why i said just ditch 'items'. Based on the code in the OP, items "seems" unnecessary.

http://stackoverflow.com/comment/47990334
type: AnswerComment
comment on: http://stackoverflow.com/a/29933902
has text: Thank you for the long response. I appreciate it. If there is more than one state that needs that resolve, I'd rather not repeat the function over and over gain. My issue is more or less how to not have to repeat myself and how to deny a promise
type: Comment
score: 0

http://stackoverflow.com/q/29966086
answer count: 0
has body: I've created a Android App where I've some .swf files inside my asset folder. I'm loading these files in a WebView. For that I've created a HTML page "myHTML.html" which loads the .swf file. Here is my HTML Page: Following is my Java class public class MainAct extends Activity implements OnClickListener { private WebView webView; private Button btn; private JsHandler _jsHandler; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.act_main); WebView webView = (WebView) findViewById(R.id.webView1); loadGame(webView); } @SuppressLint("SetJavaScriptEnabled") public void loadGame(WebView webViewID) { webViewID.getSettings().setJavaScriptEnabled(true); webViewID.setBackgroundColor(Color.parseColor("#808080")); webViewID.getSettings().setDomStorageEnabled(true); webViewID.getSettings().setBuiltInZoomControls(false); webViewID.getSettings().setAppCacheMaxSize(1024 * 8); webViewID.getSettings().setAppCacheEnabled(true); webViewID.getSettings().setAllowFileAccess(true); webViewID.getSettings().setPluginState(PluginState.ON); webViewID.getSettings().setUseWideViewPort(false); webViewID.getSettings().setRenderPriority(RenderPriority.HIGH); webViewID.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE); webViewID.setWebChromeClient(new WebChromeClient()); webViewID.setWebViewClient(new WebViewClient()); webViewID.requestFocus(View.FOCUS_DOWN); String url = "file:///android_asset/myHTML.html"; webViewID.loadUrl(url); } } JS Bridge Class public class JsHandler { Activity activity; String TAG = "JsHandler"; WebView webView; public JsHandler(Activity _contxt,WebView _webView) { activity = _contxt; webView = _webView; } /** * This function handles call from JS */ public void callToJavaFunction(String Score) { } /** * This function handles call from Android-Java */ public void javaFnCall(String jsString) { final String webUrl = "javascript:diplayJavaMsg('"+jsString+"')"; // Add this to avoid android.view.windowman…
type: UnansweredQuestion
tagged with: android
tagged with: webview
has comment: http://stackoverflow.com/comment/48070642
type: Question
has title: Unable to call Javascript method from .swf which is loaded in the HTML page in Android WebView- Throws: security error: error #2060
tagged with: flash
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/48084506
tagged with: actionscript-3

http://stackoverflow.com/q/29867370
has answer: http://stackoverflow.com/a/29867498
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/47859588
has title: node.js readFile txt add question mark at top of content
has body: i am getting some datas from .txt with fs.readFile() function but top of the content is like "?Alex libman" My whole code ; fs.readFile(__dirname+"/txts/generate/titles0.txt", "utf-8", function (ex, titles) { var titlesArr = titles.split("\r\n"); console.log(titlesArr); }); Result; ["?Alex libman","Kroya Barzo","Deliah Krbo"] Always , there is question mark at top of content Note:my titles0.txt is line by line data
accepted answer: http://stackoverflow.com/a/29867498
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/47859652
favorite count: 0
score: 6
has comment: http://stackoverflow.com/comment/47859697
upvote count: 6
tagged with: node.js
type: AnsweredQuestion

http://stackoverflow.com/comment/48010350
type: QuestionComment
comment on: http://stackoverflow.com/q/29944248
has text: Closure compiler removes dead code. You can use goog.provide to export this class and goog.require to use it. But if you don't use it in any code it won't show in the compiled code
score: 0
type: Comment

http://stackoverflow.com/q/29848011
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/47823602
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/47824622
has comment: http://stackoverflow.com/comment/47823443
upvote count: 2
type: Question
has body: I have created a fixed menu for my website. Everything is working quite fine, the problem is; When I scroll down, as soon as the fixed menu starts animating, if I scroll down faster it stops, and when I stop scrolling down, the animation continues until it gets fixed. The JS is below; function init() { window.addEventListener("scroll", function() { var topbar = $("#topbar"), header = $("#header-main"), hdr_img = $("#header-main .inner img"), hdr_inner = $("#header-main .inner"), search = $("#search"), cart = $("#cart"); $(window).width() &gt; 1200 &amp;&amp; ($(this).scrollTop() &gt; 235 ? (header.addClass("sabit"), hdr_inner.addClass("sabit"), search.addClass("sabit"), cart.addClass("sabit"), hdr_img.addClass("sabit"), topbar.addClass("sabit"), header.stop().animate({ top: "-44px", opacity: 1 }, 800), topbar.stop().animate({ top: "-44px", opacity: 0 }, 900)) : $(this).scrollTop() &lt; 1 &amp;&amp; (header.stop().animate({ top: "0px", opacity: 1 }, 800), topbar.stop().animate({ top: "0", opacity: 1 }, 1300), header.removeClass("sabit"), hdr_inner.removeClass("sabit"), search.removeClass("sabit"), cart.removeClass("sabit"), hdr_img.removeClass("sabit"), topbar.removeClass("sabit"))) }) } window.onload = init(); Also CSS codes are below; #topbar { color: #7BBD42; background: #2e3a47; background-image: url("//images....com./sprites/kullanicimenupat.png"); padding: 5px 0; min-height: 30px; border-bottom: 1px solid #7bbd42; border-width: 3px; } #topbar.sabit { position: fixed; width: 100%; z-index: 99; top: 0; } #header-main { background-color: #ffffff; min-height: 107px; color: #8c8c8c; } #header-main.sabit{ position : fixed; width: 100%; z-index: 1010; padding-top: 35px; border-bottom: 1px solid #AFC999; min-height: 100px; min-height: 99px; background: rgba(255,255,255,1); background: -moz-linear-gradient(top, rgba(255,255,255,1) 0%, rgba(245,245,245,1) 47%, rgba(237,237,237,1) 93%, rgba(237,237,237,1) 99%); background: -webkit-gradient(left top, left bottom, color-sto…
has answer: http://stackoverflow.com/a/29850751
tagged with: javascript
has comment: http://stackoverflow.com/comment/47822447
has answer: http://stackoverflow.com/a/29849001
answer count: 2
has comment: http://stackoverflow.com/comment/47823211
has title: Fixed Header - Stops Animating When Scrolling Down, continues when stop scrolling
score: 2
downvote count: 0

http://stackoverflow.com/q/29896474
has answer: http://stackoverflow.com/a/30191087
tagged with: node.js
downvote count: 0
has title: Detach node child process after receiving a first message
type: Question
type: AnsweredQuestion
score: 3
tagged with: javascript
accepted answer: http://stackoverflow.com/a/30191087
answer count: 1
has body: I'm building a system with node.js where the user is able to spawn worker processes from a web interface, and I'm having trouble combining these two criteria for the system: The web server process and the worker process should run independently, so that if the web server crashes, the worker process isn't affected. The mother process should be able to receive at least one initial message from the worker process. After that message, I want to log the output from the worker process to a file. I've been able to accomplish both criteria by themselves, but not together. Here's what the relevant parts of my code currently looks like: function spawnWorker (id, callback) { var worker = spawn("node", [require.resolve("worker"), id], { detached: true, stdio: ["ignore", "pipe", "pipe"] }); worker.unref(); var logfile = fs.createWriteStream("foo.log"); worker.stdout.once("data", function (data) { worker.stdout.pipe(logfile); worker.stderr.pipe(logfile); callback(undefined, data.toString()); }); } This meets criteria 2 (ie. it receives the first message from the worker and redirects all following output to a file), but if I kill the mother process, the worker process is killed as well, even though the output has been redirected. My guess is that this is because the worker's stdout and stderr are piped to the mother process before they're sent to the file stream. If I were to pass in a stream when spawning the process, according to the docs, node would instead duplicate that stream in the worker process: The stream's underlying file descriptor is duplicated in the child process[...] Is there a way I can remove the connection between the mother process and the worker process after having received the first message? Or should I use some type of RPC to accomplish this, and if so, what would be a good choice for this one message once communication?
favorite count: 0
upvote count: 3

http://stackoverflow.com/comment/47922228
comment on: http://stackoverflow.com/q/29850802
type: Comment
type: QuestionComment
score: 0
has text: I actually did that here https://github.com/optimizely/marketing-website/blob/3b71dac02d7e511903f16dab002a341705ff1884/grunt/webpack/make-webpack-config.js#L5 used `require.resolve` to get the full path to the loader `var injectFilenamePath = require.resolve(path.join(__dirname, 'loaders/inject-filename')).replace('.js', '');` still had the same issue :-(

http://stackoverflow.com/comment/47916428
comment on: http://stackoverflow.com/q/29896848
score: 0
has text: you can assign value to new variable and observe that new variable is set or not..? this may work.......
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/47855673
type: QuestionComment
comment on: http://stackoverflow.com/q/29865271
has text: returning it to form a closures sounds like a viable way. What don't you like about it? Please show us the whole code of that attempt.
score: 0
type: Comment

http://stackoverflow.com/a/33640728
upvote count: 1
type: Answer
downvote count: 0
has body: Just started playing with speechSynthesis so did not spend so much time on it. I stumbled on your question and I believe the answer is that the voice you select does not support the language you give it and you get a fallback. If you read the docs and check how you select a voice it works (at least at my pc) https://developers.google.com/web/updates/2014/01/Web-apps-that-talk-Introduction-to-the-Speech-Synthesis-API?hl=en var msg = new SpeechSynthesisUtterance('Awesome!'); msg.voice = speechSynthesis.getVoices().filter(function(voice) { return voice.name == 'Google UK English Male'; })[0]; // now say it like you mean it: speechSynthesis.speak(msg); Hope this helps you or others searching for it.
score: 1
answers question: http://stackoverflow.com/q/29920285

http://stackoverflow.com/a/29998132
answers question: http://stackoverflow.com/q/29992687
has body: require is there to access another directive's controller (and thus "API"), and so you need to specify explicitly which directive you want. Otherwise, how would Angular know - there could be N number of "parent" directives. For example: &lt;parent ng-switch="abc" foo="123" bar&gt; &lt;child&gt;&lt;/child&gt; &lt;/parent&gt; Which of the directives parent, ngSwitch, foo, bar you would expect Angular to return? It is a very rare case that you need to determine dynamically what the hosting directive is, even if you know that the controllers have the same "API". And, clearly, require was not designed for that. If you have a well-defined set of potential parent directives, then I second @pankajparkar's approach with optionally require-ing them all: require: ["?^^parent1", "?^^parent2", ], link: function(scope, element, attrs, ctrls){ var parentCtrl = ctrls[0] || ctrls[1]; // etc... } If not, you could get the parent, but you would have to do some manual work. Suppose you know that a parent will always be the immediate containing element and the element tag (rather than an attribute) is the directive. Then, you could get that directive's controller like so: link: function(scope, element){ var parentCtrlName = element.parent().prop("tagName").toLowerCase(); var parentCtrl = element.parent().controller(parentCtrlName); if (parentCtrl){ // } }
downvote count: 0
type: Answer
score: 2
upvote count: 2

http://stackoverflow.com/a/29949796
score: 2
accepted answer of: http://stackoverflow.com/q/29949732
answers question: http://stackoverflow.com/q/29949732
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: change $('#nav a:nth-child(1)').click(function() { $('#hidden').animate({ top: +=500px }, 1000); }); with $('#nav a:nth-child(1)').click(function() { $('#hidden').animate({ top: '+=500px' }, 1000); });
upvote count: 2

http://stackoverflow.com/q/29850690
answer count: 1
has body: I have a date picker called leave_start, I would like the ability to set a min date that isn't static so a person could choose dates after the day they selected. How could I go about doing something like this and for some reason when I click on the future select box it doesn't reload date picker how could I fix that as well? So when they select either yes or no for future select box. It will reformat the date picker accordingly. So this is my view where the sick_day input would be the sick day text field would be the min date they would set. =simple_form_for @entry, :url =&gt; url_for(:controller =&gt; 'entry', :action %td.lt= f.error :range_days, :class =&gt; 'er' %table.table.table-bordered.table-striped{:style =&gt; 'table-layout:fixed; width:100% !important;'} %td.lt= f.text_field :sick_day, :id =&gt; 'sick_day', :placeholder =&gt; 'Optional Comment', :input_html =&gt; {:value =&gt; ''} %td.lt= f.error :indirect_id, :class =&gt; 'er' %table.table.table-bordered.table-striped{:style =&gt; 'table-layout:fixed; width:100% !important;'} %th.lt %td.lt= f.input_field :future, :as =&gt; :select, :id =&gt; 'future', :label =&gt; false, :collection =&gt; ["YES", "NO"] %td.lt= f.error :future, :class =&gt; 'er' %table.table.table-bordered.table-striped{:style =&gt; 'table-layout:fixed; width:100% !important;'} %th.lt Leave Start: %td.lt= f.text_field :leave_start, :label =&gt; false, :id =&gt; 'leave_start', :input_html =&gt; {:value =&gt; ''} %td.lt= f.error :leave_start, :class =&gt; 'er' %table.table.table-bordered.table-striped{:style =&gt; 'table-layout:fixed; width:100% !important;'} = f.button :submit, "Submit", :class =&gt; 'customSub' And here is my JavaScript $(document).ready(function(){ $('#future').click(function() { var selected = $(this).val(); var new_day = $('#sick_day').val(); if (selected == 'YES') { $('#leave_start').datepicker({minDate: new_day }); } if (selected == 'NO') { $('#leave_start').datepicker({minDate: 0, beforeShowDay: $.datepicker.noWeeken…
has comment: http://stackoverflow.com/comment/47827495
has answer: http://stackoverflow.com/a/29851589
tagged with: datepicker
linked to: http://stackoverflow.com/q/14897271
has comment: http://stackoverflow.com/comment/47827488
type: AnsweredQuestion
has title: I want to be able to set a random date for my datepicker
type: Question
tagged with: javascript
tagged with: jquery
tagged with: date
has comment: http://stackoverflow.com/comment/47827764
score: 0
accepted answer: http://stackoverflow.com/a/29851589
has comment: http://stackoverflow.com/comment/47827657

http://stackoverflow.com/a/29926374
score: 3
upvote count: 3
has comment: http://stackoverflow.com/comment/47977550
answers question: http://stackoverflow.com/q/29926308
has comment: http://stackoverflow.com/comment/47976272
accepted answer of: http://stackoverflow.com/q/29926308
type: AcceptedAnswer
downvote count: 0
has body: Just take the first five elements from the array, with .slice: [].map.call( main.children, Object ).sort(...).slice(0, 5).forEach(...)
has comment: http://stackoverflow.com/comment/47977374
type: Answer

http://stackoverflow.com/q/29846034
has answer: http://stackoverflow.com/a/29846210
has comment: http://stackoverflow.com/comment/47818321
has comment: http://stackoverflow.com/comment/47817788
score: 3
downvote count: 0
has answer: http://stackoverflow.com/a/29846074
has answer: http://stackoverflow.com/a/29846431
favorite count: 0
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/2490825
upvote count: 3
has answer: http://stackoverflow.com/a/29846088
linked to: http://stackoverflow.com/q/4571497
has answer: http://stackoverflow.com/a/29846148
type: Question
has body: I have the following elements: &lt;input type="submit" name="add" value="add item" class="btn btn-add" onclick="addItem('add');return false;"&gt; I want to write a Javascript to simulate a click of a mouse to add item to my shopping basket I know you can use document.getElementById('add').click() but there's no Id here I am very new to this and any help would be much appreciated
has answer: http://stackoverflow.com/a/29846112
has title: How to simulate a mouse click in Javascript
tagged with: javascript
answer count: 6

http://stackoverflow.com/comment/47887820
has text: That's my mistake. Let's pretend they are `.container`'s instead of `#container`'s.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29881782

http://stackoverflow.com/q/29905139
has comment: http://stackoverflow.com/comment/47933348
has body: I have written a small javascript code to get screen dimensions of the user browser. At first, the src attribute of an img element is set to a static image url. When the page is fully loaded, the following code, calculate screen dimensions and send them to the server by changing the src of the img that now contains the dimensions as uri parameters (Later, at server side, these parameters will be processed): &lt;img id="screenres" src="http://static.example.com/image.jpg" alt="" width="20" height="20" /&gt; &lt;script&gt; window.onload=function(){ var w =Math.round(screen.width); var h =Math.round(screen.height); document.getElementById("screenres").src= "http://www.example.com/screen/"+w+"/"+h; } &lt;/script&gt; This approach works perfectly in desktop browsers, but for mobile users it fails. Could you please tell me what is wrong in this approach? Thank you beforehand for your suggestions to overcome this problem.
has title: Changing src of Image by javascript, does not take effect in mobile devices
has comment: http://stackoverflow.com/comment/47933149
has comment: http://stackoverflow.com/comment/47933696
has comment: http://stackoverflow.com/comment/47933435
has comment: http://stackoverflow.com/comment/47933151
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/47933167
has comment: http://stackoverflow.com/comment/47939243
score: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47933312
has comment: http://stackoverflow.com/comment/47933373
linked to: http://stackoverflow.com/q/3437786
has comment: http://stackoverflow.com/comment/47933128
type: UnansweredQuestion
tagged with: mobile-browser
has comment: http://stackoverflow.com/comment/47933096
type: Question
has comment: http://stackoverflow.com/comment/47933177
has comment: http://stackoverflow.com/comment/47933126
has answer: http://stackoverflow.com/a/29905241

http://stackoverflow.com/comment/47891829
type: Comment
score: 0
has text: could you explain using C++ then? Thanks!
comment on: http://stackoverflow.com/a/29883604
type: AnswerComment

http://stackoverflow.com/comment/48105809
type: Comment
type: QuestionComment
score: 0
has text: Could you detail a little more about *why* you need the focus on canvas? Is it to catch mouse moves, keys?
comment on: http://stackoverflow.com/q/29992688

http://stackoverflow.com/comment/48117570
has text: I've edited. The new edit will return true if the array is sorted or if one swapping sorted the array. Otherwise it will return false.
type: Comment
comment on: http://stackoverflow.com/a/29999150
type: AnswerComment
score: 0

http://stackoverflow.com/q/29871808
accepted answer: http://stackoverflow.com/a/29873251
downvote count: 7
has comment: http://stackoverflow.com/comment/47868658
has comment: http://stackoverflow.com/comment/47869175
has title: Javascript functions and IE error addEventListener JQuery
has comment: http://stackoverflow.com/comment/47868650
upvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47868700
has body: Internet Explorer Last version show a very ugly alert about addEventListener, I was reading some fixes here but in my case I believe the solution is to delete the part of the javascript code giving me problems BUT I am a zero to the left with Javascript. Here is the code and I am sure this code has 2 or more funtions. The first one is for my drop down menu using also JQuery. But it seems like the last part where addEventListener is maybe is not necessary to make my drop down menu works. I got this drop down menu from a website I buyed pre-made with lots of funtions LMenu=$(".menu&gt;ul&gt;li");LMenu.find("ul").siblings().addClass("hasUl").append('&lt;span class="hasDrop iconoflecha icono-flecha"&gt;&lt;/span&gt;');LMenuLink=LMenu.find("a").not(".submenu a");LMenuLinkAll=LMenu.find("a");LMenuSubLink=LMenu.find(".submenu a").not(".submenu li");LMenuCurrent=LMenu.find("a.current");if(LMenuLink.hasClass("hasUl")){$(this).closest("li").addClass("hasSub")}LMenuLink.click(function(a){$this=$(this);if($this.hasClass("hasUl")){a.preventDefault();if($this.hasClass("drop")){$(this).siblings("ul.submenu").slideUp(250).siblings().toggleClass("drop")}else{$(this).siblings("ul.submenu").slideDown(250).siblings().toggleClass("drop")}}});LMenuSubLink.click(function(a){$this=$(this);if($this.hasClass("hasUl")){a.preventDefault();if($this.hasClass("drop")){$(this).siblings("ul.submenu").slideUp(250).siblings().toggleClass("drop")}else{$(this).siblings("ul.submenu").slideDown(250).siblings().toggleClass("drop")}}});if(!("boxShadow" in document.body.style)){document.body.setAttribute("class","noBoxShadow")}document.body.addEventListener("click",function(b){var a=b.target;if(a.tagName==="INPUT"&amp;&amp;a.getAttribute("class").indexOf("liga")===-1){a.select()}});(function(){var e=document.getElementById("fontSize"),d=document.getElementById("testDrive"),c=document.getElementById("testText");function b(){d.innerHTML=c.value||String.fromCharCode(160);if(window.icomoonLiga){window.icomoonLi…
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47868599
favorite count: 0
type: Question
answer count: 1
tagged with: css
has answer: http://stackoverflow.com/a/29873251
score: -7

http://stackoverflow.com/q/29860338
tagged with: bower
score: 1
has comment: http://stackoverflow.com/comment/47884099
type: Question
has answer: http://stackoverflow.com/a/30621850
downvote count: 0
tagged with: javascript
has title: Bower: How to skip (ignore) some files in downloaded packages
answer count: 1
has body: Is it possible to config bower in a way that it does not download some specific files or folders? For example I minify .js files myself so I don't need .min.js files. Such files make my IDE (PHPStorm) confused in finding the source code of functions and also make code indexing process inefficient. bower-installer seems to be a solution, however, I prefer to use bower itself.
has comment: http://stackoverflow.com/comment/47895444
favorite count: 0
type: UnansweredQuestion
upvote count: 1

http://stackoverflow.com/comment/47963256
type: Comment
type: QuestionComment
has text: @john G:please note (from comments), that any jQuery solution should either be placed after the elements it references (e.g. end of `body`), or inside a DOM ready handler.
comment on: http://stackoverflow.com/q/29920326
score: 0

http://stackoverflow.com/a/29867498
answers question: http://stackoverflow.com/q/29867370
accepted answer of: http://stackoverflow.com/q/29867370
type: AcceptedAnswer
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/47859844
has body: You need to convert your file to UTF-8 without BOM. You can do that by using this command in your terminal: tail --bytes=+4 utf8_with_bom.txt &gt; utf8_without_bom.txt Or you may remove BOM with the help of text editors like Sublime Text (File -&gt; Save with Encoding -&gt; UTF-8) or Notepad++ (Encoding -&gt; Convert to UTF-8 without BOM).
upvote count: 7
score: 7

http://stackoverflow.com/q/29950649
tagged with: javascript
has answer: http://stackoverflow.com/a/30264914
tagged with: asp.net
score: 0
type: UnansweredQuestion
has title: Detect when tracking pixel is returned from server
has body: Customers use a service where they install a script (javascript) from my server. I have a tracking pixel inserted onto the page via the script that picks up click info. When the asp.net server intercepts pixel.aspx it inserts the login information from the fake image's querystring into the database and returns pixel.gif...all this works perfectly (see below). Imports Microsoft.VisualBasic Imports System.Web Public Class HelloWorldModule Implements IHttpModule Private pattern As String = "/images/(?&lt;key&gt;.*)\.aspx" Private logoFile As String = "~/images/pixel.gif" Public Sub New() End Sub Public ReadOnly Property ModuleName() As String Get Return "HelloWorldModule" End Get End Property ' In the Init function, register for HttpApplication ' events by adding your handlers. Public Sub Init(ByVal application As HttpApplication) Implements IHttpModule.Init AddHandler application.BeginRequest, AddressOf GetImage_BeginRequest End Sub Public Sub GetImage_BeginRequest(ByVal sender As Object, ByVal args As System.EventArgs) 'cast the sender to a HttpApplication object Dim application As System.Web.HttpApplication = CType(sender, System.Web.HttpApplication) Dim url As String = application.Request.Path 'get the url path 'create the regex to match for becon images Dim r As New Regex(pattern, RegexOptions.Compiled Or RegexOptions.IgnoreCase) If r.IsMatch(url) Then Dim mc As MatchCollection = r.Matches(url) If Not (mc Is Nothing) And mc.Count &gt; 0 Then Dim key As String = mc(0).Groups("key").Value 'SaveToDB(key) End If 'now send the image to the client application.Response.ContentType = "image/gif" application.Response.WriteFile(application.Request.MapPath(logoFile)) application.Response.End() End If End Sub 'GetImage_BeginRequest If a client that is running this script has an expired account I want to return an error.gif in the response (instead of pixel.gif) and then I need to detect the error.gif src so I can notifiy the client that the service has expired. I have tried t…
type: Question
answer count: 1

http://stackoverflow.com/a/29950162
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/29950010
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/48021468
has body: Two dimensional arrays are supported trough almost all program languages out there including JavaScript and PHP. The only difference between the languages is the user input and output interface and the speed of the calculations. So to answer your exact question - it is possible with both JavaScript and PHP. Here is a tutorial how to work with 2d arrays in JavasScript.
answers question: http://stackoverflow.com/q/29950010
type: AcceptedAnswer

http://stackoverflow.com/comment/48114377
type: AnswerComment
comment on: http://stackoverflow.com/a/29997273
score: 0
has text: This is being run locally. Same problem persists when its live though as well.
type: Comment

http://stackoverflow.com/comment/48047386
comment on: http://stackoverflow.com/q/29963402
score: 0
type: Comment
has text: I didn't know you could do div's in design mode. I'm new to JavaScript.
type: QuestionComment

http://stackoverflow.com/q/29863581
tagged with: javascript
favorite count: 0
tagged with: ajax
has title: How to pass the table cell value via ajax to php
has comment: http://stackoverflow.com/comment/47852411
tagged with: http://stackoverflow.com/tag/html
has body: I want to when i click table that cell value pass to php via ajax show that value in alert box. I wrote code but its show alert box value like [object HTMLTableCellElement].. Anyone help, Here my code: function found(row) { var table=document.getElementById("table"); var rows = table.getElementsByTagName("tr"); for (var i = 0; i &lt; rows.length; i++) { rows[i].onclick = (function() { return function() { var result = this.cells[1]; var plate = this.cells[6]; var km = this.cells[7]; var dataString = 'plate=' + plate + '&amp;km='+km; $.ajax({ type: 'POST', url: 'km.php', async: true, data: dataString, cache: false, global: false, success: function(result) { alert("succ : " + result); } }); } })(i); } } My php: &lt;?php $plate = $_POST['plate']; $km = $_POST['km']; echo $plate; echo $km; ?&gt;
tagged with: php
type: UnansweredQuestion
upvote count: 1
type: Question
score: 1
linked to: http://stackoverflow.com/q/3072233
has answer: http://stackoverflow.com/a/29863619
answer count: 1
downvote count: 0

http://stackoverflow.com/comment/47825496
score: 1
has text: Then use event delegation
type: QuestionComment
comment on: http://stackoverflow.com/q/29849579
type: Comment

http://stackoverflow.com/comment/48618498
type: AnswerComment
has text: Implementation of isArrayLike n 1.2.x and 1.3.x is identical besides using global variable. I see you mentioned webkit issue for phantom object.length property - Do you have a hint how this could be patched/workaround in 1.2.x?
type: Comment
comment on: http://stackoverflow.com/a/30248522
score: 1

http://stackoverflow.com/comment/70587501
type: Comment
has text: Keep in mind that your **variable should hold the component** itself and **not** just the name of the component as **a string**.
score: 52
type: AnswerComment
comment on: http://stackoverflow.com/a/29876284

http://stackoverflow.com/comment/116521150
has text: If you found my answer useful, then please mark it as answer.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/65185871

http://stackoverflow.com/comment/48504798
score: 0
type: AnswerComment
has text: Hey man. So I've gotten my code to output the array of arrays. This is my first time working with a multidimensional array and also my first time working with the .map method. I've been messing around with this for days trying to figure this out before I came back to you. I don't want to copy and paste any code, but if you could give me further guidance on how to use the .map method to turn [ [1, 4], [6, 9], [11, 14], [16, 19] ] into "1-4,6-9,11-14,16-20", I would greatly appreciate it. I believe I understand what the .join method does and why it will be used in this situation.
comment on: http://stackoverflow.com/a/29976735
type: Comment

http://stackoverflow.com/comment/47876829
type: QuestionComment
has text: @EdwardKnowles, yes,he is running windows
comment on: http://stackoverflow.com/q/29876023
score: 0
type: Comment

http://stackoverflow.com/comment/47867241
type: AnswerComment
has text: But now it can't handle falsy values like 0.
comment on: http://stackoverflow.com/a/29871122
score: 0
type: Comment

http://stackoverflow.com/q/29908105
has title: Find next input element in DIV using JQuery
answer count: 1
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29908124
type: AnsweredQuestion
has body: The API method I am using takes a list of parameters in the form of Dictionary&lt;string,string&gt;. I am building the inputs for this dynamically with JavaScript, where I have a DIV row and then two inner DIV cells, one for the parameter name and one for the parameter value input. I can use .each() to loop through each of the parameter name DIVs but need to figure out how to get the value of the input which is displayed directly after it. With the following pseudo code to show the idea, what would be the best approach where I could get the parameter values together? CSS Table: consumedValues.innerHTML += "&lt;div class='valuesRow'&gt;"; consumedValues.innerHTML += "&lt;div class='valuesCellName'&gt;" + consumesItem + "&lt;/div&gt;&lt;div class='valuesCellValue'&gt;&lt;input type='text'&gt;&lt;/div&gt;"; consumedValues.innerHTML += "&lt;/div&gt;"; Parameter Dictionary: var parameters = {}; $('.valuesCellName').each(function(index) { parameters[$(this).html()] = "INPUT_VALUE_HERE"; });
accepted answer: http://stackoverflow.com/a/29908124
type: Question
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/47940155

http://stackoverflow.com/comment/48084521
has text: possible duplicate of [session variable increments only once](http://stackoverflow.com/questions/16153396/session-variable-increments-only-once)
score: 0
comment on: http://stackoverflow.com/q/29982565
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47927822
score: 0
has text: You cannot pass no connection: `: mysqli_escape_string($theValue);` in your If statement.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29902262

http://stackoverflow.com/q/29881052
tagged with: youtube-api
type: Question
has answer: http://stackoverflow.com/a/29881866
has answer: http://stackoverflow.com/a/29881347
tagged with: javascript
possible better answer: http://stackoverflow.com/a/29881866
has answer: http://stackoverflow.com/a/30622065
upvote count: 3
linked to: http://stackoverflow.com/q/2068344
favorite count: 0
linked to: http://stackoverflow.com/q/25775656
tagged with: angularjs
has answer: http://stackoverflow.com/a/54020557
answer count: 5
tagged with: youtube
type: AnsweredQuestion
score: 3
accepted answer: http://stackoverflow.com/a/29881347
downvote count: 0
tagged with: angularjs-controller
has answer: http://stackoverflow.com/a/58518772
has body: I just start to using angularjs and I want to display youtube thumbnail image from the youtube video url ... is there a way to display video thumbnail when people insert url in input and then click the button, PLUNKER http://plnkr.co/edit/9SBbTaDONuNXvOQ7lkWe?p=preview
has title: how to display youtube thumbnail image from url with Angularjs

http://stackoverflow.com/a/29979762
accepted answer of: http://stackoverflow.com/q/29884621
type: Answer
has body: The problem is your canvas is way too big and chrome can't handle the memory required for it. You really never want the canvas to be bigger than what can fit on the screen. (Typically going to be around 1080x1920). Combining that with @ScottMichaud 's answer we get HTML &lt;div id="container"&gt; &lt;canvas width="1638" height="900" id="MapEditor"&gt;&lt;/canvas&gt; &lt;/div&gt; JS var canvas = document.getElementById("MapEditor"); var ctx = canvas.getContext("2d"); var MousePos = {x:0, y:0}; function updateCanvas() { container = document.getElementById("container"); if (container.width != window.innerWidth) { container.style.width = window.innerWidth - 250; } if (container.height != window.innerHeight) { container.style.height = window.innerHeight; } } //Destroy mouse on canvas exit. canvas.addEventListener('mouseout', function() { document.body.style.cursor = 'auto'; }); function Update(){ window.requestAnimationFrame(Update); var mousex = Math.round(MousePos.x / 32) * 32; var mousey = Math.round(MousePos.y / 32) * 32; ctx.fillRect(0,0,canvas.width,canvas.height); makeTileCover(ctx, mousex, mousey); } function getMousePos(canvas, evt) { var rect = canvas.getBoundingClientRect(); return { x: evt.clientX - rect.left, y: evt.clientY - rect.top }; } canvas.addEventListener('mousemove', function(evt) { MousePos = getMousePos(canvas, evt); // var cursor = document.createElement('canvas'), // cursorctx = cursor.getContext('2d'); // cursor.width = 32; // cursor.height = 32; // makeTileCover(mousex, mousey); // document.body.style.cursor = 'url(' + cursor.toDataURL() + '), auto'; // document.getElementById('mousePosLocation').innerHTML = "Mouse location:" + "&lt;b id='mousex'&gt;" + mousex + "&lt;/b&gt;" + "," + "&lt;b id='mousey'&gt;" + mousey + "&lt;/b&gt;"; }, false); function makeTileCover(ctx, mousex, mousey) { ctx.strokeStyle = "green"; ctx.strokeRect(mousex, mousey, 32, 32); ctx.stroke(); } Update(); I also changed the canvas so every frame it refills the canvas to …
score: 0
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29884621

http://stackoverflow.com/q/29892285
type: Question
has answer: http://stackoverflow.com/a/29892552
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29892967
has body: I am trying to create a table of products where a user can add and delete items to their basket. I am writing the basket content to a 'temp' table in my DB. I originally just had this executing via PHP but didn't like the redirecting so I toyed with using jQuery and a separate PHP file to make things act a lot cleaner and smoother. Now when I tried this with a single product row it worked fine. So I then tried it with two and three rows. When I do this the it works correctly for the first row however, when I try it with the second or third rows it redirects to the action page and I don't understand why. It does write to the database perfectly fine. Here is the code for the products page This is then actioned by the following Javascript: $("#add").click( function() { $.post( $("#addItem").attr("action"), $("#addItem :input").serializeArray(), function(info){ $("#result").html(info); }); }); $("#addItem").submit( function() { return false; }); $("#rem").click( function() { $.post( $("#remItem").attr("action"), $("#remItem :input").serializeArray(), function(info){ $("#result").html(info); }); }); $("#remItem").submit( function() { return false; }); $("#all").click( function() { $.post( $("#remAll").attr("action"), $("#remAll :input").serializeArray(), function(info){ $("#result").html(info); }); }); $("#remAll").submit( function() { return false; }); And I would post all three addBasket.php, remBasket.php, allBasket.php but you'll get the jist from just the addBasket file, if I need to post all three please let me know: require_once 'core/init.php'; $token = Session::get('user_session'); $product = $_POST['product']; $exists = DB::getInstance()->query("SELECT * FROM temp WHERE token='$token' AND product='$product'"); if($exists->count()){ $qty = $exists->first()->qty + 1; DB::getInstance()->query("UPDATE temp SET qty='$qty' WHERE token='$token' AND product='$product'"); }else{ DB::getInstance()->insert('temp', array( 'token' => $token, 'product' => $product, 'qty' => …
answer count: 3
has comment: http://stackoverflow.com/comment/47907993
possible better answer: http://stackoverflow.com/a/29892553
accepted answer: http://stackoverflow.com/a/29892552
has answer: http://stackoverflow.com/a/29892553
has title: jQuery AJAX request just sends the first form, ignores the others
tagged with: php
type: AnsweredQuestion
score: 0
tagged with: mysql

http://stackoverflow.com/a/29924708
upvote count: 4
has comment: http://stackoverflow.com/comment/60037326
downvote count: 0
answers question: http://stackoverflow.com/q/29923879
has body: I believe you can use es6 module loaders. http://babeljs.io/docs/learn-es6/ System.import("lib/math").then(function(m) { m(youroptionshere); });
score: 4
has comment: http://stackoverflow.com/comment/64383891
type: Answer

http://stackoverflow.com/comment/48093413
type: AnswerComment
comment on: http://stackoverflow.com/a/29987073
type: Comment
score: 1
has text: Indeed, I probably have tried all possibilities except this one... (I thought I have tested this as well though) Thanks for the quick answer!

http://stackoverflow.com/comment/59174505
type: Comment
comment on: http://stackoverflow.com/a/29972322
has text: @M.Hassaan: I've added a sentence, but I'm not really sure what you are looking for. The code uses quite descriptive names and is extensively commented already. Does any particular part need further clarification?
score: 0
type: AnswerComment

http://stackoverflow.com/q/29876326
has answer: http://stackoverflow.com/a/29878479
has comment: http://stackoverflow.com/comment/47877426
tagged with: google-chrome
has body: This code works in Mozilla Firefox, but not in Chrome. You need Javascript enabled for this to work Your Name What can we use in the place of onclick to trigger the two actions?
type: Question
has comment: http://stackoverflow.com/comment/47877620
has comment: http://stackoverflow.com/comment/47876935
tagged with: javascript
answer count: 2
accepted answer: http://stackoverflow.com/a/29878479
has comment: http://stackoverflow.com/comment/47878060
downvote count: 0
has comment: http://stackoverflow.com/comment/47877174
favorite count: 0
has comment: http://stackoverflow.com/comment/47877118
has comment: http://stackoverflow.com/comment/47876877
has answer: http://stackoverflow.com/a/29876401
score: 2
type: AnsweredQuestion
upvote count: 2
possible better answer: http://stackoverflow.com/a/29876401
has title: onclick method doesn't work in Chrome

http://stackoverflow.com/comment/47839588
type: Comment
comment on: http://stackoverflow.com/q/29856618
has text: since using JS in cordova and having JS background mostly people prefer to use it as they have already used it, @sanfor thats my view so i haven't added as an answer as i am not sure about other opinions :)
score: 0
type: QuestionComment

http://stackoverflow.com/comment/48107542
type: QuestionComment
has text: Not certain interpret second sort correctly ? Add items to array based on `data-order` , though sorted `data-order="3"` , `data-order="1"`, `data-order="2"` ?
comment on: http://stackoverflow.com/q/29993835
score: 0
type: Comment

http://stackoverflow.com/q/29856068
favorite count: 0
type: Question
has comment: http://stackoverflow.com/comment/47839088
tagged with: http://stackoverflow.com/tag/html
tagged with: php
has comment: http://stackoverflow.com/comment/47838730
tagged with: gps
has body: I have a problem with a PHP/JavaScript I have downloaded in an example for a hardware project off the internet. Below is the script, and I have a file server side with GPS co-ordinates called "gps.txt". By placing the 'old' "i'm here" text commands I was able to figure out that the script does not appear to be opening the "gps.txt" files hence that is why Google maps is not being updated with markers. Really appreciate any suggestions you guys have. SIM908 GPS position DEMO Time Satellites Speed OTG Course 2015 Apr 24 - 15:04
has comment: http://stackoverflow.com/comment/47838576
has answer: http://stackoverflow.com/a/29870300
upvote count: 1
answer count: 1
has title: PHP/JavaScript not reading text file
has comment: http://stackoverflow.com/comment/47838252
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47838831
has comment: http://stackoverflow.com/comment/47838604
has comment: http://stackoverflow.com/comment/47864607
has comment: http://stackoverflow.com/comment/47838260
has comment: http://stackoverflow.com/comment/47839149
has comment: http://stackoverflow.com/comment/47839600
downvote count: 0
score: 1

http://stackoverflow.com/comment/48041969
comment on: http://stackoverflow.com/a/29960619
score: 0
type: Comment
has text: Working perfectly bro! But I do want to keep the W3C Markup Validation that is why I never use custom tags :-) https://validator.w3.org/
type: AnswerComment

http://stackoverflow.com/a/29931796
has comment: http://stackoverflow.com/comment/47985982
answers question: http://stackoverflow.com/q/29931746
has body: Don't do this. There is no reason for 700 audio players. You can't play more than 30 or so at a time without breaking most clients. Only create the audio element when you need it. I recommend using something like jPlayer which gives you HTML5 audio with a Flash fallback for clients that need it.
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/47986014
score: 1
upvote count: 1

http://stackoverflow.com/q/29984341
score: 0
has title: How to get just one parameter in 'clip' CSS property using JQuery?
answer count: 1
tagged with: jquery
has body: this is a really short question, but needed: I need to get just one parameter of this 'clip' CSS property clip:rect(260px, 160px, 260px, 0px); in this case I'd need to get the '260px' parameter only and set it equal to a variable 'x', how do I get that one only? Remember I'm using Jquery :)
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/29984431
tagged with: css
type: AnsweredQuestion
duplicate of: http://stackoverflow.com/q/29983833
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/29984431

http://stackoverflow.com/a/29920842
has comment: http://stackoverflow.com/comment/47968661
answers question: http://stackoverflow.com/q/29920326
has comment: http://stackoverflow.com/comment/47964413
upvote count: 2
has comment: http://stackoverflow.com/comment/47964159
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47963825
type: Answer
has comment: http://stackoverflow.com/comment/47963243
has comment: http://stackoverflow.com/comment/47963865
score: 2
has comment: http://stackoverflow.com/comment/47970643
downvote count: 0
has comment: http://stackoverflow.com/comment/47970691
has body: When in doubt, filter is your friend: JSFiddle: http://jsfiddle.net/TrueBlueAussie/jjzx6mge/4/ $('#formTbl tr').filter(function () { return !$(".ms-standardheader", this).text().match(/Name|Title/i); }).remove(); The result returned of a function passed to filter is a boolean value telling which items to retain (truthy), or which to exclude (falsey). This one targets only rows that have the requested text in the ms-standardheader classed element. It also only targets a specific inner table to avoid the case of deep searching from the top level table and wiping out entire tables within it. While you can do this with plain old JS, significantly more code is required.As you already have a version of jQuery installed, it makes sense to use it.
accepted answer of: http://stackoverflow.com/q/29920326
has comment: http://stackoverflow.com/comment/47968716
has comment: http://stackoverflow.com/comment/47964103
has comment: http://stackoverflow.com/comment/47963446

ionic-framework
tags question: http://stackoverflow.com/q/29913655
tags question: http://stackoverflow.com/q/29924975
tags question: http://stackoverflow.com/q/29872404
tags question: http://stackoverflow.com/q/29941996
tags question: http://stackoverflow.com/q/29918892
tags question: http://stackoverflow.com/q/29850241
type: Tag
tags question: http://stackoverflow.com/q/29855614
tags question: http://stackoverflow.com/q/29880280
tags question: http://stackoverflow.com/q/29965608
tags question: http://stackoverflow.com/q/29913887
tags question: http://stackoverflow.com/q/29864515
tags question: http://stackoverflow.com/q/29940742
tags question: http://stackoverflow.com/q/29857530
tags question: http://stackoverflow.com/q/29943918
tags question: http://stackoverflow.com/q/29930066
tags question: http://stackoverflow.com/q/29906043
tags question: http://stackoverflow.com/q/29940364
tags question: http://stackoverflow.com/q/29978309
tags question: http://stackoverflow.com/q/29931887
tags question: http://stackoverflow.com/q/29912773
tags question: http://stackoverflow.com/q/30000766
tags question: http://stackoverflow.com/q/29889798
tags question: http://stackoverflow.com/q/29861053
tags question: http://stackoverflow.com/q/29893538
tags question: http://stackoverflow.com/q/29954669
tags question: http://stackoverflow.com/q/29848084
tag name: ionic-framework
tags question: http://stackoverflow.com/q/29922621
tags question: http://stackoverflow.com/q/29852184

http://stackoverflow.com/comment/48002738
type: QuestionComment
has text: possible duplicate of [iphone/ipad triggering unexpected resize events](http://stackoverflow.com/questions/8898412/iphone-ipad-triggering-unexpected-resize-events)
score: 0
comment on: http://stackoverflow.com/q/29940691
type: Comment

http://stackoverflow.com/comment/48032932
comment on: http://stackoverflow.com/a/29953823
has text: Thanks for you helping.. How i apply this function in my case?
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/48081801
type: Comment
comment on: http://stackoverflow.com/q/29980922
type: QuestionComment
score: 0
has text: ` ` is not valid syntax in JavaScript, unless that's React's .jsx . Do you mean to be returning a string?

http://stackoverflow.com/q/29914505
type: Question
score: -9
has title: Javascript loop within HTML code
downvote count: 9
tagged with: javascript
has body: I have the following lines (I'm taking a variable from the server, NodeJS using EJS for templating): &lt;% for(var i=0; i &lt; gens.length; i++) { %&gt; &lt;option value=&lt;%= gens[i].gene %&gt;&gt;&lt;%= gens[i].gene %&gt;&lt;/option&gt; &lt;% } %&gt; I'd like to substitute gens for another array from my Javascript code. How could I do it? It is giving me an error Variable not defined. EDIT: Here is where I define the variable: &lt;script&gt; var functionlist = '&lt;%= gens %&gt;'; functionlist = functionlist.split(","); &lt;/script&gt;
has comment: http://stackoverflow.com/comment/58394687
tagged with: ejs
upvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/58395574
has comment: http://stackoverflow.com/comment/47950855
favorite count: 0
type: UnansweredQuestion
tagged with: node.js
has answer: http://stackoverflow.com/a/29914600

http://stackoverflow.com/q/30001141
type: AnsweredQuestion
upvote count: 5
has body: My code is very simple: &lt;video ng-controller="Ctrl" ng-src="scopeSRC" autoplay&gt;&lt;/video&gt; .controller('Ctrl', function ($scope, $timeout) { $scope.scopeSRC = 'a_src_url'; $timeout(function () { $scope.scopeSRC = 'new_src_url'; }, 5000); }); Now when changing the src I see black video. What I would like to do is set the last frame of the previous src video as the thumbnail while the new src is loading. How do you think i can achieve this? Thanks, any help appreciated
has comment: http://stackoverflow.com/comment/48121483
has comment: http://stackoverflow.com/comment/48121532
has comment: http://stackoverflow.com/comment/48121327
tagged with: src
type: Question
tagged with: thumbnails
score: 5
downvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/30004837
has comment: http://stackoverflow.com/comment/48123628
has comment: http://stackoverflow.com/comment/48123716
has title: Angular - capture last frame as video poster/thumb
has comment: http://stackoverflow.com/comment/48121207
has comment: http://stackoverflow.com/comment/48121581
tagged with: angularjs
linked to: http://stackoverflow.com/q/29881052
has comment: http://stackoverflow.com/comment/48123755
accepted answer: http://stackoverflow.com/a/30004837
tagged with: video

http://stackoverflow.com/a/29918360
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/47960282
type: Answer
upvote count: 2
has comment: http://stackoverflow.com/comment/47957899
has body: Looking at the &lt;script&gt; tag documentation, you can see that you can use the async and defer attributes only with external scripts, which might have an effect on scripts that do not use event listeners as entry points. Other than that, inlining renders a browser unable to cache it on its own, so if you use the same script on different pages, the browser cache cannot kick in. So it might have an effect on performance and/or bandwidth usage. And, of course, splitting code up into files is one way of organizing it.
answers question: http://stackoverflow.com/q/29918246

wordpress
tags question: http://stackoverflow.com/q/29951667
tags question: http://stackoverflow.com/q/29909078
tags question: http://stackoverflow.com/q/29986161
tags question: http://stackoverflow.com/q/29987416
tags question: http://stackoverflow.com/q/29957134
tags question: http://stackoverflow.com/q/29997902
tags question: http://stackoverflow.com/q/29915613
tags question: http://stackoverflow.com/q/29991982
tags question: http://stackoverflow.com/q/29995313
tags question: http://stackoverflow.com/q/29966974
tags question: http://stackoverflow.com/q/29957362
tags question: http://stackoverflow.com/q/29924967
tags question: http://stackoverflow.com/q/29944438
tags question: http://stackoverflow.com/q/29924182
tags question: http://stackoverflow.com/q/29929164
tags question: http://stackoverflow.com/q/29875821
tags question: http://stackoverflow.com/q/29931386
tags question: http://stackoverflow.com/q/29931268
tags question: http://stackoverflow.com/q/29985124
tags question: http://stackoverflow.com/q/29880652
tags question: http://stackoverflow.com/q/29888137
tags question: http://stackoverflow.com/q/29922671
tags question: http://stackoverflow.com/q/29970717
tags question: http://stackoverflow.com/q/29988770
tags question: http://stackoverflow.com/q/29961477
tags question: http://stackoverflow.com/q/29917001
tags question: http://stackoverflow.com/q/29984021
tags question: http://stackoverflow.com/q/29952047
tags question: http://stackoverflow.com/q/29864191
tags question: http://stackoverflow.com/q/29941976
tags question: http://stackoverflow.com/q/29885227
tags question: http://stackoverflow.com/q/29991291
tags question: http://stackoverflow.com/q/29929307
tags question: http://stackoverflow.com/q/29993974
tag name: wordpress
tags question: http://stackoverflow.com/q/29861582
tags question: http://stackoverflow.com/q/29867898
tags question: http://stackoverflow.com/q/29952765
tags question: http://stackoverflow.com/q/29856581
tags question: http://stackoverflow.com/q/29923713
tags question: http://stackoverflow.com/q/29892257
tags question: http://stackoverflow.com/q/29990514
tags question: http://stackoverflow.com/q/29859505
tags question: http://stackoverflow.com/q/29991302
tags question: http://stackoverflow.com/q/29976879
tags question: http://stackoverflow.com/q/29983563
type: Tag
tags question: http://stackoverflow.com/q/29928510

http://stackoverflow.com/comment/47966801
type: Comment
comment on: http://stackoverflow.com/a/29922535
has text: Hi thanks for the reply but the div has to above the current div with the same width and height
type: AnswerComment
score: 0

http://stackoverflow.com/comment/51912291
comment on: http://stackoverflow.com/q/29886170
type: Comment
has text: possible duplicate of [Filter table rows with jquery](http://stackoverflow.com/questions/7951014/filter-table-rows-with-jquery)
type: QuestionComment
score: 0

http://stackoverflow.com/comment/47976831
has text: why don't you put them all in one object? it would be a lot easier to work with later, unless you're expecting duplicate keys...
comment on: http://stackoverflow.com/q/29926677
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/48068745
comment on: http://stackoverflow.com/q/29974354
has text: What do you mean paste a php string? $gui_txt returns data from a database table as text
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47816542
score: 0
type: Comment
has text: Can you tell OP why he should use `.prop` instead of `.attr`? http://api.jquery.com/prop/
comment on: http://stackoverflow.com/a/29845333
type: AnswerComment

http://stackoverflow.com/comment/47843351
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29858421
has text: If you keep scrolling after the animation has started, the animation restarts. The animation gets the end value from the current value in the div. Since the animation is currently in progress, the number will be lower. This is why you are seeing it flick between 1 and 0. You restarted the animation shortly after the animation began and had only gotten to 1. Lot's of ways to fix this. How many times do you want the animation to run? Just once? Every time?

http://stackoverflow.com/q/29893629
tagged with: css
has comment: http://stackoverflow.com/comment/47911365
has comment: http://stackoverflow.com/comment/47910232
accepted answer: http://stackoverflow.com/a/29894170
has title: re-size the width of div depending on browser's width
has body: I have a slideshow with pager and some buttons next to pager of slideshow (here is html page) which I am trying to make responsive. The images I am fetching from database. So that are varying in number. The problem is that pager/navigation of slideshow is fine for less number of images but becomes problematic for more images. Pager is overlapping the buttons which are next to it. as shown below: For Desktop screen: For small screen: Below is the div structure button 1 button 2 button 3 I am finding the solution other than media queries if possible. I tried by giving width in % to all div, by putting container div to above structure and giving it 100% width and height, by $(width).width() function. But not getting the solution. jsfiddle Is there any way to dynamically adjust the width of div depending on browser's screen size?
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47911309
tagged with: responsive-design
has comment: http://stackoverflow.com/comment/47910357
possible better answer: http://stackoverflow.com/a/29893787
type: Question
has answer: http://stackoverflow.com/a/29893787
has comment: http://stackoverflow.com/comment/47910860
has answer: http://stackoverflow.com/a/29893893
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29894170
score: 0
answer count: 3
has comment: http://stackoverflow.com/comment/47911810

http://stackoverflow.com/q/29886414
has body: I'm trying to arrange points more-or-less uniformly along the surface of a unit sphere. I'm told that while this problem is difficult, Fibonacci Lattices give a very good solution. I've been trying for a couple of days to follow the very simple method provided in the linked document, but I simply cannot get it to look right. I'm using javascript, and I have an array of objects e, each of which expose a lat and lon parameter. Here is the function I use to arrange the points on the sphere: (assume for now that the number of points is always odd) function arrangeEntries(e) { var p = e.length; var N = (p - 1) / 2; for (var i = -N; i &lt;= N; i++) { e[i + N].lat = Math.asin((2 * i) / (2 * N + 1)); e[i + N].lon = mod(i, 1.618034) * 3.883222; } } with function mod(a, b) { return a - Math.floor(a / b) * b; } Unlike in the document, my lat and lon are in radians, not degrees. This is so I can plot them later using X/Y/Z co-ordinates which I obtain using the javascript Math.sin and Math.cos functions, which accept radians not degrees. The first line for the lat is fairly straight forward. I omit the factor of 180/Pi in the document because I want to keep the result in radians. The second line for the lon takes the modulus of the index using the golden ratio, and instead of multiplying by a factor of 360/Phi to give the answer in degrees, I multiply by (360/Phi) * (Pi/180) to give the answer in radians. Since the trig functions don't care what range the radians take, I don't need to make sure lat and lon are in the range (-pi,pi]. To render the points: function render(e) { var offsetX = Math.floor(canvas.width / 2); var offsetY = Math.floor(canvas.height / 2); var r = Math.min(canvas.width, canvas.height) * 0.4; ctx.clearRect(0, 0, canvas.width, canvas.height); for (var i = 0; i &lt; e.length; i++) { var x = Math.cos(e[i].lat) * Math.sin(e[i].lon); var y = Math.sin(e[i].lat) * Math.sin(e[i].lon); var z = Math.cos(e[i].lon); // Make z go from 0.1 to 1 for scaling: z += 1; z /= …
tagged with: html5-canvas
linked to: http://stackoverflow.com/q/57123194
has comment: http://stackoverflow.com/comment/111765320
linked to: http://stackoverflow.com/q/25012737
downvote count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/30951588
tagged with: fibonacci
linked to: http://stackoverflow.com/q/9600801
tagged with: algorithm
linked to: http://stackoverflow.com/q/24658889
score: 7
favorite count: 0
type: Question
has title: Uniformly arranging points on a sphere using Fibonacci Lattices
upvote count: 7
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/47900941
linked to: http://stackoverflow.com/q/29126226

http://stackoverflow.com/a/30897754
score: 0
type: AcceptedAnswer
has body: I think we might need a little bit more information... in your first code snippet you are showing normal Rails view syntax, you mention your attempt at using JS, but then you say you are using active model serializers. Those are very different use cases and it's hard to answer the question without knowing exactly what you need. Either way, what you are asking is quite easy to do in a serializer. Assuming that you have a CompanySerializer, you might create a custom method in the serializer called company_link, like this.. class CompanySerializer &lt; ActiveModel::Serializer attributes :id, :name, :company_link def company_link object.company_url ? object.company_url : "https://www.google.com/search?q=#{object.company.name}" end end In a serializer you can create as many custom methods as you want and then pass them into the attributes list. So, I used the generic method company_link as an in-between for company_url and your google search for the company name. Inside a serializer you automatically get access to object which is the object that is passed in, in this case, it is a company. I then used a ternary for an if else. If there is a company_url, use that, if not, output the google search link.
type: Answer
accepted answer of: http://stackoverflow.com/q/29901466
answers question: http://stackoverflow.com/q/29901466

http://stackoverflow.com/comment/47871205
type: QuestionComment
has text: At one point you’ve got `filed1` instead of `field1` — it’s a typo. Otherwise it should be working fine. As far as I know this should get flagged, unfortunately…
comment on: http://stackoverflow.com/q/29872980
score: 0
type: Comment

http://stackoverflow.com/q/29983886
possible better answer: http://stackoverflow.com/a/29984233
type: AnsweredQuestion
tagged with: alert
tagged with: onclick
score: 6
has title: Javascript: Functions get called on page load instead of onclick/onsubmit
type: Question
upvote count: 6
tagged with: javascript
has answer: http://stackoverflow.com/a/29984233
answer count: 2
tagged with: function
downvote count: 0
has body: I'm relatively new to JS, but I have programmed in C before, and I'm trying to get my head around the whole event driven nature of it. I'm trying to create a script that will validate form input, however all of my code is being run - everything inside if/else, loops, what have you - regardless of the event happening or not. To test, and to make it easier to post here, I've written a simple program that has this problem too. HTML: Test Javascript: function init(){ document.getElementById("test").onclick = alert("hello"); } window.onload = init; From what I understand, the init function should be called when the page loads (window.onload), and the alert should pop up when the button with the ID "test" is clicked (onclick). What is actually happening is that the alert is popping up as soon as the page loads, and will pop up again if I hit the button. My thinking is that I've made some incorrect assumptions about the order in which JS is executed, but I cant think of what that is. Is anyone able to shed some light on this?
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29983916
accepted answer: http://stackoverflow.com/a/29983916

http://stackoverflow.com/a/29903279
has comment: http://stackoverflow.com/comment/48022721
has comment: http://stackoverflow.com/comment/47929276
has comment: http://stackoverflow.com/comment/48022915
type: Answer
has body: Your angular.forEach are a bit messed up. angular.forEach($scope.data, function (workflow, workflowIndex) { angular.forEach(workflow, function (workflowValue, workflowKey) { angular.forEach(workflowValue, function (value, roleKey) { angular.forEach(value, function (sections, sectionIndx) { angular.forEach(sections, function (section, rowIndx) { angular.forEach(section, function (row, rowIndx) { angular.forEach(row, function (row, rowIndx) { if (rowIndx === 'rows') { angular.forEach(row, function (row, rowIndx) { var row2 = row['2ndCol']; var row3 = row['3rdCol']; console.log(row2, row3); }); } }); }); }); }); }); }); }); I've actually had to create a repo so you can see how it works. Also please don't use that many forEach's in your production! EDIT: https://github.com/eknowles/blank-ng/tree/29902467/nested-json-parsing-in-angular-js
has comment: http://stackoverflow.com/comment/47929238
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/29902467
has comment: http://stackoverflow.com/comment/47930140
has comment: http://stackoverflow.com/comment/47929544
upvote count: 2
has comment: http://stackoverflow.com/comment/47929150

http://stackoverflow.com/q/29874670
tagged with: angularjs
upvote count: 2
has answer: http://stackoverflow.com/a/29928136
downvote count: 1
tagged with: angularjs-directive
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/430237
has comment: http://stackoverflow.com/comment/47874194
score: 1
tagged with: select
has title: How to open select box when pressing tab key?
type: Question
has comment: http://stackoverflow.com/comment/48046963
accepted answer: http://stackoverflow.com/a/29928136
answer count: 1
tagged with: javascript
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has body: When pressing the tab key, the focus changes to another field. What I want is that, when the focus comes to a , the option list is shown. This is working: This is not working: aa bb My plunker code is here.

http://stackoverflow.com/q/29958379
tagged with: parse-platform
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/48037878
has body: I had a really quick and dumb question. Say I have a short form in HTML asking for a username. Then I'm using Parse to store my users and stuff, but it is in javascript where it creates a var and a Parse.User. However I want to use the username input in the HTML form as the username instead of "username". But I have no idea how to do that as you can't make variables in HTML. Heres the JavaScript Parse uses to make a user (which creates a user with just those hardcoded fields). var user = new Parse.User(); user.set("username", "username"); user.set("password", "my pass"); user.set("email", "email@example.com");
has title: HTML and Javascript form
type: Question
has answer: http://stackoverflow.com/a/29958603
tagged with: javascript
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1

http://stackoverflow.com/comment/47929818
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29885532
has text: @MartinStrejc I mean the later using modal window despite ajaxrequesttarget not being available.

http://stackoverflow.com/q/29946774
tagged with: javascript
tagged with: inheritance
favorite count: 0
accepted answer: http://stackoverflow.com/a/29948406
has comment: http://stackoverflow.com/comment/48014808
has title: Is there anything wrong with this approach to calling super() in javascript?
has comment: http://stackoverflow.com/comment/48014774
type: AnsweredQuestion
has body: I'm working on a project and decided that the best way to implement the functionality I wanted was to override a method. At the time I didn't realize that javascript had no notion of just calling super() so I started doing some research. I found an article (http://blog.salsify.com/engineering/super-methods-in-javascript) that describes several methods of calling super methods. I wan't super happy about any ofthose options though and came up with the following. Also available on fiddle at https://jsfiddle.net/fpgm8j9n/. var Food = function( name ){ this.name = name; } Food.prototype.sayName = function(){ console.log( 'I am a ' + this.name ); } var Fruit = function( name, color ){ Food.call( this, name ); this.color = color; this.super = Object.getPrototypeOf( Object.getPrototypeOf( this ) ); } Fruit.prototype = Object.create( Food.prototype ); Fruit.prototype.sayName = function(){ console.log( 'I am a fruit and I am the color ' + this.color ); } var orange = new Fruit( 'apple', 'red' ); // runs the overridden method in orange orange.sayName(); // I am a fruit and I am the color red // runs the super method orange.super.sayName.call( orange ); // I am a apple The following is the first example in article I posted. Are these essentially the same just without having to know your parent prototype? Is there any thing wrong with the implementation that I came up with or anything that can be improved? I'm pretty new to OOP in javascript and feel kind of wobbly with a lot of the concepts. var Child = Parent.extend({ // ... doSomething: function(x, y) { this.doSomethingElse(x); return Parent.prototype.doSomething.call(this, x, y); } });
tagged with: oop
has answer: http://stackoverflow.com/a/29948406
score: 4
type: Question
upvote count: 4
has comment: http://stackoverflow.com/comment/48022780
answer count: 1
downvote count: 0

http://stackoverflow.com/q/29961630
downvote count: 0
score: 1
type: Question
has body: I am new bee. I want to make a ul increasing auto height with animation on page load. Is it possible in css? Please help me. title 1 title 2 title 3 title 4 title 5
has comment: http://stackoverflow.com/comment/48043703
tagged with: javascript
tagged with: jquery
has title: Increasing ul auto height with animation on page load
has answer: http://stackoverflow.com/a/29961810
accepted answer: http://stackoverflow.com/a/29961810
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
tagged with: css
type: AnsweredQuestion

http://stackoverflow.com/q/29975421
has answer: http://stackoverflow.com/a/29975565
type: AnsweredQuestion
has title: How can I get the browser viewport size and use that to align my website?
type: Question
has answer: http://stackoverflow.com/a/29975651
answer count: 2
tagged with: viewport
upvote count: 0
score: -2
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29975565
possible better answer: http://stackoverflow.com/a/29975651
has body: I am new to webdesign and I am wondering about the website size specially for a One Page Scroll Site. Sometimes I see some 'jumbotron' images with perfect height and width alignment to my browser size.Browser sizes can differ from one to another because of the browser ad-dons or extensions. So How can we get the users browser view port size and use that to align my website. I need a good explanation about all the things regarding the website sizes. Sorry for my poor English. If you wish, please provide the tutorial links that will help me also. Thank you
tagged with: size
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/48071629
tagged with: css
favorite count: 0
downvote count: 2

http://stackoverflow.com/a/29998972
has body: I'm not entirely sure what you are trying to test, but here's why you are getting this error message: You are firing $scope.close(), which is not mocked. It is you original $scope.close method from MenuCtrl. The close method in turn fires $mdSidenav('left').close().then... and in the parameters of the test $mdSidenav('left').close() returns undefined which means that it has no then method. If you want to control what happens you should either create a spy/mock for $scope.close or for $mdSidenav('left').close (which would mean mocking the $mdSidenav function to return an object with a spy/mock).
type: Answer
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/29998663
has comment: http://stackoverflow.com/comment/48127827
answers question: http://stackoverflow.com/q/29998663
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/q/29919425
tagged with: jquery
downvote count: 6
has comment: http://stackoverflow.com/comment/47960149
favorite count: 0
has answer: http://stackoverflow.com/a/29919608
has comment: http://stackoverflow.com/comment/47959975
score: -6
has body: I have modified a fiddle that I found online, and would like to run it on my page. However I get an Uncaught TypeError when trying to do so. Can you help me figure out the problem? Link to my page: http://goo.gl/7jTAya Link to jsfiddle: http://jsfiddle.net/Y5ZLL/1655/ Thanks already! Here is my code: var sliders = $("#sliders .slider"); sliders.each(function() { var value = parseInt($(this).text(), 10), availableTotal = 100; $(this).empty().slider({ value: 0, min: 0, max: 100, range: "max", step: 10, animate: 100, slide: function(event, ui) { // Update display to current value $(this).siblings().text(ui.value + ' %'); // Get current total var total = 0; sliders.not(this).each(function() { total += $(this).slider("option", "value"); }); // Need to do this because apparently jQ UI // does not update value until this event completes total += ui.value; var max = availableTotal - total; // Update each slider sliders.not(this).each(function() { var t = $(this), value = t.slider("option", "value"); t.slider("option", "max", max + value) .siblings().text(value + ' %'); t.slider('value', value); }); } }); });
upvote count: 0
has comment: http://stackoverflow.com/comment/47959935
has title: Uncaught TypeError: Not a function
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29919506
accepted answer: http://stackoverflow.com/a/29919506
possible better answer: http://stackoverflow.com/a/29919608
type: Question
answer count: 2
tagged with: javascript

http://stackoverflow.com/a/29882032
upvote count: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29878427
has comment: http://stackoverflow.com/comment/47897155
has body: The get query finds the first matching object. This is analogous to opening a cursor that moves forward, which happens when you do not specify a second argument to openCursor, or when you specify the 'next' parameter. You opened a cursor with a second argument of 'prev', which starts at the last matching object and moves backward. Obviously, the first and last object out of the set of matching objects are not the same object, unless there is only one matching object in total.
type: Answer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/29878427

http://stackoverflow.com/q/29856115
type: Question
tagged with: firefox
has title: Different "return null" results in Chrome and Firefox
tagged with: javascript
has comment: http://stackoverflow.com/comment/47838245
has comment: http://stackoverflow.com/comment/47838357
has comment: http://stackoverflow.com/comment/47841141
downvote count: 0
answer count: 1
tagged with: cross-browser
favorite count: 0
upvote count: 1
has answer: http://stackoverflow.com/a/29858522
has comment: http://stackoverflow.com/comment/47838370
type: AnsweredQuestion
has body: Given the following code: jQuery(document).ready(function($) { $('[name="clickableTD"]').click(function() { window.document.location = $(this).attr("href"); }); }); function Add(id) { var stock = "2"; var quantity = prompt("SELECT QUANTITY:", 1); if (quantity == null) { return null; } else if (quantity <= stock) { alert("Good"); } else if (quantity > stock) { alert("Over"); } else if (isNaN(quantity)) { alert("NaN"); } } Click If the user returns a null value (by clicking cancel) using Chrome as the browser nothing happens as would be expected. But if the user is using Firefox he will be redirected to the url Add() and display null as a text string on the screen. Why does Firefox react differently than Chrome?
score: 1
accepted answer: http://stackoverflow.com/a/29858522
has comment: http://stackoverflow.com/comment/47841180
tagged with: google-chrome

http://stackoverflow.com/comment/48046474
comment on: http://stackoverflow.com/a/29962051
type: AnswerComment
score: 0
has text: its not about changing the colors. It is about replacing the divs. I just took the colors to differentiate the divs
type: Comment

http://stackoverflow.com/comment/47940767
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/29909004
has text: I mean to say, a "click" handler will only fire once per click of the mouse, if you changed it to "click" and your function is getting called repeatedly, you must have some other handler attached to that element or are somehow calling that function repeatedly from elsewhere in your code, a click handler could not do that
type: Comment

http://stackoverflow.com/q/29934373
has comment: http://stackoverflow.com/comment/47990962
has body: I have this code $.ajax({ url: sServiceURL + 'submitData', type: 'GET', data: JSON.stringify(selectedData), contentType: 'application/json;charset=utf-8' }).done(function (data) { }).fail(function (status) { }) As it is a get request, so I entered the same URL on in the browser and when I hit enter, I am getting correct response. But when I try using jquery, the request fails and error response contains: Error: Access is denied
type: Question
has comment: http://stackoverflow.com/comment/47990897
tagged with: javascript
score: 0
has title: Error: Access is Denied coming in response?
has comment: http://stackoverflow.com/comment/47990946
has comment: http://stackoverflow.com/comment/47990914
tagged with: jquery
has comment: http://stackoverflow.com/comment/47990854
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/20035101
has comment: http://stackoverflow.com/comment/47990934
has comment: http://stackoverflow.com/comment/47990852
has comment: http://stackoverflow.com/comment/47990882
has comment: http://stackoverflow.com/comment/47990936
answer count: 0
has comment: http://stackoverflow.com/comment/47990860
tagged with: iis

http://stackoverflow.com/q/29991649
has answer: http://stackoverflow.com/a/29992143
accepted answer: http://stackoverflow.com/a/29992143
type: Question
type: AnsweredQuestion
score: 1
possible better answer: http://stackoverflow.com/a/29992102
downvote count: 2
answer count: 3
linked to: http://stackoverflow.com/q/111102
has answer: http://stackoverflow.com/a/29992102
has title: How to access values of nested arrays?
tagged with: javascript
favorite count: 0
upvote count: 3
has answer: http://stackoverflow.com/a/29992165
has body: I have an array inside an array of objects that I want to retrieve a property from. I've accomplished it here, but it seems clunky. Is there a better way of looping through each StaffList array within each room? window.onload = getInitials; var data = { "room" : [ { "id" : 1, "StaffList": [ { "inroom": true, "initials": "MG" }, { "inroom": false, "initials": "CT" }, { "inroom": true, "initials": "MS" } ] }, { "id" : 2, "StaffList": [ { "inroom": true, "initials": "MG" }, { "inroom": false, "initials": "CT" }, { "inroom": true, "initials": "MS" }, { "inroom": true, "initials": "MA" } ] } ] } function getInitials() { var len = data.room.length; for(i = 0; i &lt; len; i++) { var staffArray = data.room[i].StaffList; var room = data.room[i].id; if( staffArray != null ) { var allStaff = staffArray.filter(function(person) { if ( person.initials ) { var inits = person.initials; setInitials(room, inits); } }); } } } function setInitials(room, initials) { //get element by ID //var staffContainer = $('#div' + room); var staffContainer = document.getElementById('div' + room); if(staffContainer != null) { //create new div to append var newDiv = document.createElement('div'); newDiv.innerHTML = initials; //append newly created &lt;div&gt; staffContainer.append(newDiv); } }

primefaces
tags question: http://stackoverflow.com/q/29954507
tag name: primefaces
type: Tag

http://stackoverflow.com/q/29869268
has comment: http://stackoverflow.com/comment/47864155
has comment: http://stackoverflow.com/comment/47863696
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/47863835
has comment: http://stackoverflow.com/comment/47863873
tagged with: multidimensional-array
has body: I am trying to save values from parsed xml. And I am getting this kind of error. Any ideas what am I doing wrong?
type: UnansweredQuestion
tagged with: css
has comment: http://stackoverflow.com/comment/47864211
has title: Js 2 dimensional array error
has comment: http://stackoverflow.com/comment/47864325
upvote count: 0
has comment: http://stackoverflow.com/comment/47863792
downvote count: 1
has comment: http://stackoverflow.com/comment/47863724
type: Question
score: -1
has answer: http://stackoverflow.com/a/29869376
has comment: http://stackoverflow.com/comment/47863948

http://stackoverflow.com/comment/47964820
has text: No, the info is correct. It's just added to the wrong div.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29921631

http://stackoverflow.com/comment/47975336
type: QuestionComment
has text: `setTimeout('getNames(f.name)',1);` - where is `f` defined?
score: 0
comment on: http://stackoverflow.com/q/29926774
type: Comment

http://stackoverflow.com/comment/47838390
type: Comment
type: QuestionComment
has text: Thanks Dandavis. that's exactly what I did, buh was looking for a more dynamic solution here's what i did: $("a[href$=".jpg"], a[href$=".png"], a[href$=".gif"]").doSomething(); but what if we had 1million file extensions?
comment on: http://stackoverflow.com/q/29855916
score: 0

http://stackoverflow.com/q/29919345
tagged with: php
type: AnsweredQuestion
score: 2
has comment: http://stackoverflow.com/comment/47979680
upvote count: 2
has title: jQuery File Upload with Wistia API
accepted answer: http://stackoverflow.com/a/29986802
type: Question
has body: I've got an demo page with jQuery File Upload that is currently allowing upload of video files to the web hosting through PHP. Code: &lt;? // A list of permitted file extensions $allowed = array('mov', 'mp4', 'avi'); if(isset($_FILES['upl']) &amp;&amp; $_FILES['upl']['error'] == 0){ $extension = pathinfo($_FILES['upl']['name'], PATHINFO_EXTENSION); if(!in_array(strtolower($extension), $allowed)){ echo '{"status":"error"}'; exit; } if(move_uploaded_file($_FILES['upl']['tmp_name'], 'uploads/'.$_FILES['upl']['name'])){ echo '{"status":"success"}'; exit; } } echo '{"status":"error"}'; exit; ?&gt; I need this demo to be fully working to upload video files to my Wistia gallery through their API instead of upload directory. Working snippet for upload.php to Wistia API with video url: &lt;? $data = array( 'api_password' =&gt; '[password]', 'project_id' =&gt; '[project_id]', 'url' =&gt; '[video_url]' ); $wistia = curl_init('https://upload.wistia.com'); curl_setopt_array($wistia, array( CURLOPT_POST =&gt; TRUE, CURLOPT_RETURNTRANSFER =&gt; TRUE, CURLOPT_POSTFIELDS =&gt; http_build_query($data) )); // Send the request $wistia_request = curl_exec($wistia); ?&gt; However changing these values and using it in my form doesn't work: $data = array( 'api_password' =&gt; '[password]', 'project_id' =&gt; '[project_id]', 'file' =&gt; '@' . $_FILES['upl']['name'] ); As you can see I need guidance and help. Any hints are much appreciated. Here's some docs for this project: http://wistia.com/doc/upload-api https://github.com/blueimp/jQuery-File-Upload
tagged with: wistia
has comment: http://stackoverflow.com/comment/47979379
tagged with: javascript
possible better answer: http://stackoverflow.com/a/29945058
answer count: 2
has comment: http://stackoverflow.com/comment/47973654
has answer: http://stackoverflow.com/a/29945058
has comment: http://stackoverflow.com/comment/47983745
downvote count: 0
tagged with: jquery
tagged with: file-upload
favorite count: 0
has answer: http://stackoverflow.com/a/29986802
has comment: http://stackoverflow.com/comment/47979752
has comment: http://stackoverflow.com/comment/47979309
has comment: http://stackoverflow.com/comment/47962436

http://stackoverflow.com/q/30000357
has body: This is my jsFiddle I want to style the slider that you can see. Anyone have any Idea how can I do it? Hello How are you I am fine slide1 slide2 slide3 slide4 slide5 slide6 slide7 slide8 slide9 slide10 slide11 Js-- $(document).ready(function(){ $('.bxslider').bxSlider({ slideWidth:500, slideMargin: 20, minSlides: 2, maxSlides: 3 }); }); The code gives me the nice slider but i wants to style it . I don't know why but the right arrow is not working. Really i don't know the solution. I need your guidance. Thank you.
type: UnansweredQuestion
tagged with: css
has title: how can I style the bxslider?
has answer: http://stackoverflow.com/a/30001821
has comment: http://stackoverflow.com/comment/48122144
has answer: http://stackoverflow.com/a/30001874
type: Question
has comment: http://stackoverflow.com/comment/48121911
tagged with: javascript
tagged with: jquery
score: 0
answer count: 2

http://stackoverflow.com/q/29903815
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/47931518
favorite count: 0
has comment: http://stackoverflow.com/comment/47969024
has title: id: null issue in sailsJS when create an User
has comment: http://stackoverflow.com/comment/47969744
tagged with: node.js
type: UnansweredQuestion
upvote count: 1
type: Question
tagged with: sails.js
score: 1
has comment: http://stackoverflow.com/comment/47970549
has answer: http://stackoverflow.com/a/29906620
has body: I suspect my issue is something silly, but I can't find the error. I'm using mongodb to persist user data. Every seems to work fine but when I look the database I have id: null in every user record. I don't want that id: null, I already have _id field. $sails --version 0.11.0 My userController: module.exports = { create: function(req, res) { User.create(req.params.all(), function userCreated(err, user) { if(err) res.json(401, err); res.json(200, user); }) } } My user model: module.exports = { attributes: { name: { type: 'string', required: true }, email: { type: 'string', email: true, required: true, unique: true }, password: { type: 'string', minLength: 6, maxLength: 15, columnName: 'encrypted_password', required: true }, toJSON: function() { var obj = this.toObject(); delete obj.password; return obj; } }, beforeCreate: function(values, next) { require('bcrypt').hash(values.password, 10, function passwordEncrypted(err, encryptedPassword) { if(err) console.log(err); values.password = encryptedPassword; next(); }); } }; When I create a user from url like http://localhost:1337/user/create?name=theUser&amp;email=user@mail.com&amp;password=123456&amp;role=admin everythink seems to be fine but in my mongodb I see this: (id: null) { name: "theUser", email: "user@mail.com", role: "admin", id: null, createdAt: ISODate("2015-04-27T18:34:42.678Z"), updatedAt: ISODate("2015-04-27T18:34:42.678Z"), encrypted_password: "$2a$10$iNt/OR8XhjijqRjkpoNW/eR70HTSDgVJ2WmNppqab79rZt213aywm", _id: ObjectId("553e81429255e51f419a8ffc") } I'd tried with autoPK: false but nothing happens. Thanks in advance.
tagged with: waterline
tagged with: mongodb
answer count: 1

http://stackoverflow.com/a/29989743
downvote count: 0
answers question: http://stackoverflow.com/q/29989647
accepted answer of: http://stackoverflow.com/q/29989647
score: 4
has body: \n puts a newline in the string, but HTML treats newlines as spaces. To put in a line break, you: Use a ("break") element: var text = " "; text += " Cool Stuff "; or, Put the first line in one block element, the second in another: var text = " "; text += " " + " Cool " + " Stuff " + " "; That sort of thing.
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/48098959
type: Answer
upvote count: 4

http://stackoverflow.com/q/29846199
has comment: http://stackoverflow.com/comment/47821497
tagged with: node.js
score: 2
type: AnsweredQuestion
downvote count: 0
has comment: http://stackoverflow.com/comment/47826830
has comment: http://stackoverflow.com/comment/47819831
has comment: http://stackoverflow.com/comment/47821558
has body: I have been trying to upload a document using the following code. I did googled and could not find any solution as yet. app.post('/documents', function (req, res) { var document = {}; var fstream = null; // populate fields form.on("field", function (name, value) { document[name] = value ; }); form.on("part", function (part) { if (!part.filename) { return; } var path = __dirname + '/files/' + part.filename; fstream = app.npm.fs.createWriteStream(path); document.type = part.headers["content-type"] document.name = part.filename; document.size = part.byteCount; document.path = path; fstream.on("close", function () { db.sequelize.models.Document.create(document).then(function (newDocument) { res.send(newDocument) res.end(); }, function (error) { res.send(error); }); }); part.pipe(fstream); }); form.on("close", function (data) { fstream.end(); fstream = null; }); form.parse(req); }); NOTE: I am using fs module. https://nodejs.org/api/fs.html The first image works ok. but when I try to upload an another image, it throws an exception: events.js:72 throw er; // Unhandled 'error' event ^ Error: write after end at writeAfterEnd (_stream_writable.js:132:12) at Form.Writable.write (_stream_writable.js:180:5) at write (_stream_readable.js:601:24) at flow (_stream_readable.js:610:7) at IncomingMessage.pipeOnReadable (_stream_readable.js:642:5) at IncomingMessage.emit (events.js:92:17) at emitReadable_ (_stream_readable.js:426:10) at emitReadable (_stream_readable.js:422:5) at readableAddChunk (_stream_readable.js:165:9) at IncomingMessage.Readable.push (_stream_readable.js:127:10)
type: Question
tagged with: javascript
has title: Uploading document in NodeJs using Fs module : Error: write after end
upvote count: 2
tagged with: fs
answer count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/29846630
accepted answer: http://stackoverflow.com/a/29846630

http://stackoverflow.com/a/29996913
upvote count: 2
answers question: http://stackoverflow.com/q/29996803
downvote count: 0
type: Answer
score: 2
has body: One way to do this would be to define a function in your service which lets you register a callback to be called when setContacts is called (onContactsUpdated below). This solution is not perfect (for example, it only lets you register a single 'handler'), but should get you on the right track. You could tweak it if it needs to be used in multiple places. appServices.service('SharedData', function() { var data = {}; function setContacts(contacts) { data.contacts = contacts; if(typeof(data.contactsUpdatedCallback) !== "undefined"){ data.contactsUpdatedCallback(); } }; function getContacts() { return data.contacts; }; function onContactsUpdated(callback){ data.contactsUpdatedCallback = callback; }; return { setContacts: setContacts, getContacts: getContacts, onContactsUpdated: onContactsUpdated }; }); Then in your controller: SharedData.onContactsUpdated(function(){ //do something with updated SharedData.getContacts() });

http://stackoverflow.com/comment/47886693
comment on: http://stackoverflow.com/q/29869700
score: 0
type: Comment
type: QuestionComment
has text: What do you mean by "only uses notify"? What exactly is it used for? And no, it's not a bug in angular, it's by design. You can use the [deferred antipattern](http://stackoverflow.com/q/23803743/1048572) to work around it if you must.

http://stackoverflow.com/comment/48112389
score: 0
has text: thanks guest271314, that is what findPos is doing, just need to see if I can integrate offsetParent.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29996091

http://stackoverflow.com/q/29964071
has comment: http://stackoverflow.com/comment/48048820
score: 0
upvote count: 1
has comment: http://stackoverflow.com/comment/48048492
answer count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/48048918
tagged with: jquery
has comment: http://stackoverflow.com/comment/48048622
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/48048547
has comment: http://stackoverflow.com/comment/48049102
has comment: http://stackoverflow.com/comment/48048447
favorite count: 0
has answer: http://stackoverflow.com/a/29964444
type: Question
has body: I am trying to position an element using offset() but I'm not sure what is going on: This is default offset position: element.offset().top ‌770 element.offset().left ‌1822.796875 Then I try setting it manually element.offset({top: 674, left: 1722 }) And the output: element.offset().top ‌-1341 element.offset().left 1722 Top position is -1341 ? and then I tried setting just top property: element.offset({top:674}) element.offset().top ‌674 and this works ? What is going on, why I can't set both properties at the same time? UPDATE: I just figured that this might be important: there is also iframe element on the page that has a scrollbar. So everything with offfset work fine, until I scroll down the window of the iframe element. But after scrolling down and then calling offset() it works.
has title: setting top and left with offset()
has comment: http://stackoverflow.com/comment/48050294
tagged with: javascript

http://stackoverflow.com/q/29967316
score: 0
has title: How do I change parent page url based on if url of iframe is changed?
has body: I have a survey monkey survey, and after I make my selections and click submit I notice that the page url changes. I know that because of same origin policy my original idea to use jQuery to figure out if a submit occurred in the iframe will not work. JSFiddle code below: jQuery(document).ready(function(){ var title = 'Thank you for completing our survey!'; if($('#surveyMonkeyInfo').contents().find("div.embed_title").val() == title){ window.location.replace("http://stackoverflow.com"); } setTimeout(arguments.callee, 1000); }) Then I thought, what if instead I used jQuery to see whether or not the url in the iframe is changed, although I do not get an error in which the underlying cause is SOP related, it simply does not work, nothing happens at all when the url of the iframe changes. surveyMonkeyInfo.onbeforeunload = function () { window.location.replace("http://stackoverflow.com"); } Many apologies for the code smells if there are too many, but how do I get this to work?
answer count: 1
has answer: http://stackoverflow.com/a/29967531
type: UnansweredQuestion
tagged with: iframe
type: Question
tagged with: surveymonkey
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/29907933
favorite count: 0
tagged with: angularjs
type: AnsweredQuestion
has title: Loop is completing before all the promises responses do
upvote count: 2
has answer: http://stackoverflow.com/a/29908328
type: Question
has body: So i have this function where i need to combine multiple promises responses, but after some reading i realized promises are async so in this case my loop is going to complete before all the responses do. Should i need to use something like $q.all in this case? How can i improve this piece of code? Thanks.. $scope.messages = []; function getPastMessages(data) { angular.forEach(data, function(item) { Message.get(item.id).then(function(msg) { if (msg.data.is_private === false) { User.getPictures(msg.data.user.id).then(function(pics) { msg.data.user.pictures = pics.data; }); } else { User.get(msg.data.im.sender).then(function(sender) { msg.data.im.sender = sender.data; User.get(msg.data.im.reciever).then(function(reciever) { msg.data.im.reciever = reciever.data; }); }); } console.log(msg.data); // SHOW 4 OBJECTS CORRECT $scope.messages.push(msg.data); console.log($scope.messages); // SHOW ARRAY OF 6 OBJECTS ???????? }) }); };
tagged with: javascript
possible better answer: http://stackoverflow.com/a/29908346
has answer: http://stackoverflow.com/a/29908346
answer count: 2
score: 2
accepted answer: http://stackoverflow.com/a/29908328
downvote count: 0

extjs4.1
tags question: http://stackoverflow.com/q/29894207
tags question: http://stackoverflow.com/q/29858560
tags question: http://stackoverflow.com/q/29927228
tag name: extjs4.1
type: Tag

http://stackoverflow.com/comment/47844228
has text: Nothing in formData ever gets submitted though and selectors are likely to fail
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29857507
type: Comment

zingchart
type: Tag
tag name: zingchart
tags question: http://stackoverflow.com/q/29894115

http://stackoverflow.com/comment/47993983
has text: Looks like you want to use FormCollection to access the posted data. You have to do something on serverside in this case. Clientside can't perform what you want.
comment on: http://stackoverflow.com/q/29935771
score: 0
type: Comment
type: QuestionComment

google-sheets
tags question: http://stackoverflow.com/q/29907943
tags question: http://stackoverflow.com/q/29921052
type: Tag
tags question: http://stackoverflow.com/q/29958900
tag name: google-sheets
tags question: http://stackoverflow.com/q/29991455

http://stackoverflow.com/comment/48085911
type: QuestionComment
comment on: http://stackoverflow.com/q/29983321
has text: What!? (be more descriptive)
score: 0
type: Comment

http://stackoverflow.com/a/29955623
upvote count: 2
type: AcceptedAnswer
has body: In js objects there are two levels which are depend on directly object and depend on directly prototype. And when you call a property which is in object, it starts to search from the root then looks in branches. You can see the tree belowed picture:
type: Answer
score: 2
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29945447
answers question: http://stackoverflow.com/q/29945447

http://stackoverflow.com/q/29994296
score: 11
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29994490
tagged with: setstate
has title: How to use setState() in React to blank/clear the value of an array
has answer: http://stackoverflow.com/a/56469515
type: Question
tagged with: reactjs
has comment: http://stackoverflow.com/comment/48108256
tagged with: javascript
has body: I am trying to clear an array, but I'm having trouble. this.setState({warnErrorTypes:[]}) I'm not sure if I am dealing with a race condition, or what the specific issue is, but I can see that the value of my array is consistently wrong in the case that I need to reset its value to []. How does one replace an array that contains [1,2] with [] then subsequently [3] where the following are true: this.state.warnErrorTypes is an Array which starts out with [] Based on condition, 2 is pushed in Array Based on condition, 1 is pushed in Array. Based on condition, 3 is NOT pushed in Array Pause. User interacts with UI Array is blanked: this.setState({warnErrorTypes:[]}) Based on condition, 2 is NOT pushed in Array Based on condition, 1 is NOT pushed in Array Based on condition, 3 is pushed in Array. The result of the logic above is always [2,1,3], when I expect it to be [3].
accepted answer: http://stackoverflow.com/a/29994490
possible better answer: http://stackoverflow.com/a/48615121
answer count: 3
has answer: http://stackoverflow.com/a/48615121
downvote count: 0
upvote count: 11
linked to: http://stackoverflow.com/q/33613728
favorite count: 0
has comment: http://stackoverflow.com/comment/48108502

http://stackoverflow.com/comment/47936219
type: Comment
comment on: http://stackoverflow.com/q/29906693
score: 0
has text: ok its fixed but now i get this in the console `Uncaught RangeError: Maximum call stack size exceeded`
type: QuestionComment

http://stackoverflow.com/comment/48116037
type: QuestionComment
comment on: http://stackoverflow.com/q/29998231
has text: exactly, and server Y is already doing this task and I don't have any control on it
score: 0
type: Comment

http://stackoverflow.com/a/29927555
answers question: http://stackoverflow.com/q/29927228
has body: Add a text sprite to your chart using the items config: Ext.create('Ext.chart.Chart', { renderTo: Ext.getBody(), width: 500, height: 350, animate: true, store: store, theme: 'Base:gradients', series: [{ type: 'pie', angleField: 'data', showInLegend: true, donut:40, tips: { trackMouse: true, width: 140, height: 28, renderer: function(storeItem, item) { // calculate and display percentage on hover var total = 0; store.each(function(rec) { total += rec.get('data'); }); this.setTitle(storeItem.get('name') + ': ' + Math.round(storeItem.get('data') / total * 100) + '%'); } } }], items : [{ type: "text", text: store.sum('data'), fill: "green", font: "36px monospace", x: 227, y: 170 }] });
type: Answer
accepted answer of: http://stackoverflow.com/q/29927228
upvote count: 3
has comment: http://stackoverflow.com/comment/47977044
has comment: http://stackoverflow.com/comment/47977179
score: 3
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/29933209
has title: Redirect on click of an image
type: Question
tagged with: image
has answer: http://stackoverflow.com/a/29933321
has body: I am trying to have a redirect on click of an image, but nothing happens. Can anyone please guide me. &lt;img src="img/facebook.png" style="border:0px;margin:2px;padding:2px;left;width:26px; height:20px;" onclick="window.location.href('https://www.facebook.com/pages/Gr81');"/&gt;
has answer: http://stackoverflow.com/a/29933975
downvote count: 0
tagged with: javascript
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/42255847
answer count: 4
has answer: http://stackoverflow.com/a/29933256
score: 2
upvote count: 2

http://stackoverflow.com/q/29979661
tagged with: cors
has title: Cross browser support for Websockets in ActiveMQ
answer count: 1
tagged with: javascript
upvote count: 1
favorite count: 0
type: UnansweredQuestion
tagged with: mqtt
downvote count: 0
tagged with: activemq-classic
score: 1
has body: It seems clear that Apollo has support for CORS in their websockets protocol, but I can find nothing comparable in ActiveMQ. In Apollo you can add the parameter "cors_origin" to the connector description, but I can find nothing comparable in ActiveMQ's documentation. I've tried the Apollo parameter but I'm still getting connection refused errors. I'm attempting to use the Paho Mqtt javascript client to connect. The Go clients I've written work fine over both tcp and websockets, but I've had no luck getting the js client to work. I'm pretty sure the problem is CORS. Any ideas on how to configure ActiveMQ?
type: Question
has answer: http://stackoverflow.com/a/29995916

http://stackoverflow.com/q/29882133
has comment: http://stackoverflow.com/comment/47906284
tagged with: google-chrome-extension
has comment: http://stackoverflow.com/comment/47906801
has comment: http://stackoverflow.com/comment/47906361
has comment: http://stackoverflow.com/comment/47906540
has comment: http://stackoverflow.com/comment/47889440
has comment: http://stackoverflow.com/comment/47906443
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47906262
has body: I want my extension to only appear in specific website. Details: Let's say I set the url to example.com/* So every time I open example.com/* my extension will appear Otherwise, it should be invisible and not working How can I achieve that? My extention function is to run in specific website and highlight some div with saved ids. My current manifest: { "manifest_version": 2, "name": "Dv Extention", "description": "Highlight Selected", "version": "1.0", "background":{ "scripts":["background.js"], "persistent": false }, "page_action": { "default_icon": "icon.png", "default_popup": "popup.html", "default_title": "Click Here!" }, "permissions": [ "activeTab", "https://ajax.googleapis.com/", "webNavigation" ], "content_scripts": [ { "matches": ["*://example.com/*"], "js": ["jquery-2.1.3.min.js","main.js"] } ] } background.js chrome.runtime.onInstalled.addListener(function() { chrome.declarativeContent.onPageChanged.removeRules(undefined, function() { chrome.declarativeContent.onPageChanged.addRules([{ conditions: [ new chrome.declarativeContent.PageStateMatcher({ pageUrl: { hostEquals: 'example.com' } }) ], actions: [new chrome.declarativeContent.ShowPageAction()] }]); }); });
score: 1
has comment: http://stackoverflow.com/comment/47893852
has title: Chrome Extention Only Available in Specific Website
upvote count: 1
tagged with: google-chrome
linked to: http://stackoverflow.com/q/10504239
type: Question
has answer: http://stackoverflow.com/a/29891704
accepted answer: http://stackoverflow.com/a/29891704
tagged with: javascript
has comment: http://stackoverflow.com/comment/47888358
answer count: 1
has comment: http://stackoverflow.com/comment/47894773
downvote count: 0
favorite count: 0

http://stackoverflow.com/q/30001482
type: Question
has comment: http://stackoverflow.com/comment/48121596
tagged with: javascript
has answer: http://stackoverflow.com/a/70315254
answer count: 2
upvote count: 28
has body: Could someone clarify why the code below returns #text instead of 'li' ? Shouldn't the next sibling of first li be li ? Similarly previous sibling of last li be li ?
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
score: 28
favorite count: 0
accepted answer: http://stackoverflow.com/a/30001502
has title: previousSibling and nextSibling returns text?
possible better answer: http://stackoverflow.com/a/70315254
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/30001502
tagged with: dom

http://stackoverflow.com/a/29910205
score: 1
type: Answer
answers question: http://stackoverflow.com/q/29910137
upvote count: 1
has comment: http://stackoverflow.com/comment/47943087
downvote count: 0
has body: You cannot embed a tag within another tag's attribute. So you cannot embed a &lt;script&gt; inside the src of an &lt;img&gt;. That's just invalid won't-be-parsed HTML. What you can do, though, is write the attribute after the fact: &lt;img id="uniqueId"&gt; &lt;script&gt; var img = document.getElementById('uniqueId') img.setAttribute('src', PGL_BUT_PATH) &lt;/script&gt; The &lt;img&gt; tag without a src attribute in that is invalid HTML technically, although it will probably work in any browser anyway. But if you want to stay totally legit, create the &lt;img&gt; with JavaScript too. &lt;div id="uniqueId"&gt;&lt;/div&gt; &lt;script&gt; var elem = document.getElementById('uniqueId'); var img = document.createElement('img'); img.setAttribute('src', PGL_BUT_PATH); elem.appendChild(img); &lt;/script&gt;

http://stackoverflow.com/q/29928676
has comment: http://stackoverflow.com/comment/47979431
has answer: http://stackoverflow.com/a/30337190
has body: Note that I'm trying to upload from the meteor/node server. I'm trying to interface with EchoSign REST API. To do this I have to upload a pdf from my server to theirs using multipart POST. I've already figured out how to do a normal POST to a server using just node. If possible, I'd like to do this without using any extra modules besides the standard node modules like fs &amp; http. Here's my code so far: var http = require('http'); options = { host: 'localhost', port:8080, path: '/upload', method: 'POST', }; var callback = function(response) { response.setEncoding('utf-8'); var responseString = ''; response.on('data', function(data) { responseString += data; }); response.on('end', function() { console.log(responseString); }); } var request = http.request(options, callback); request.on('error', function(e) { console.log('There was an error: '+e); }); request.end(); Can anyone point me in the right direction?
tagged with: meteor
tagged with: node.js
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47983641
downvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/30337190
has title: How to upload files from a meteor/node server?
score: -1
linked to: http://stackoverflow.com/q/13797670
has comment: http://stackoverflow.com/comment/47982908
upvote count: 0
answer count: 1
tagged with: javascript
linked to: http://stackoverflow.com/q/25455475
favorite count: 0

http://stackoverflow.com/a/46571601
has body: I have found a rather easy and somewhat lazy option. You can set all your tabs to "tab-pane active" This way all your charts on the tabs show and render, then setTimeout(yourFunction, 250); function yourFunction() { $('.nav-tabs a[href="#anytabExceptdefault"]').tab('show') $('.nav-tabs a[href="#backtoyourdefaultTab"]').tab('show')
type: Answer
score: 0
answers question: http://stackoverflow.com/q/29861670

http://stackoverflow.com/a/29897923
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29897717
downvote count: 0
answers question: http://stackoverflow.com/q/29897717
type: Answer
has body: Javascript isn't some sort of magician that will render all your stuff on its own. However, you can use it to attach a template to every of your items. What you have to do is : Create a base HTML template for 1 of your item that can be applied to all of them Create a Javascript function that will attach thoses CSS classes and HTML attributes to every element out of your DB (or you could use a templating frameork .. since there's a lot of them I'll let you look for it on Google. It's pretty easy to use) On page load or whatever event you want to bind on, you call your function which will attach the CSS and HTML to every element out of your DB and will render it on your page Enjoy what you've done. I hope this helps. Good luck ! ;)
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/47966516

google-fusion-tables
type: Tag
tags question: http://stackoverflow.com/q/29857972
tags question: http://stackoverflow.com/q/29976168
tags question: http://stackoverflow.com/q/29952432
tag name: google-fusion-tables

http://stackoverflow.com/comment/48090595
comment on: http://stackoverflow.com/q/29937707
score: 0
type: Comment
type: QuestionComment
has text: What is the problem ?

http://stackoverflow.com/comment/48102623
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29991574
score: 1
has text: IMO, your request is way too broad. You'll need to be more specific and identify a problem you are having. Just telling us that your browser console is throwing an exception really is very vague. Where is the exception coming from? What steps have you already attempted?

http://stackoverflow.com/comment/47873957
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/29866502
type: Comment
has text: @RomanR. you are right, in JavaScript handler I was calling `document.writeln()`, if I do `alert()` it works!

http://stackoverflow.com/comment/47967713
type: AnswerComment
type: Comment
has text: https://jsfiddle.net/Lu0jz3nc/14/ Updated jsfiddle showing the subnav sticking to the top.
comment on: http://stackoverflow.com/a/29859700
score: 0

c#
tags question: http://stackoverflow.com/q/29864710
tags question: http://stackoverflow.com/q/29861472
tags question: http://stackoverflow.com/q/29945283
tags question: http://stackoverflow.com/q/29981221
tags question: http://stackoverflow.com/q/29900868
tags question: http://stackoverflow.com/q/29889190
tags question: http://stackoverflow.com/q/29855113
tags question: http://stackoverflow.com/q/29973237
tags question: http://stackoverflow.com/q/29923961
tags question: http://stackoverflow.com/q/29941825
tags question: http://stackoverflow.com/q/29892738
tags question: http://stackoverflow.com/q/29906273
tags question: http://stackoverflow.com/q/29989952
tags question: http://stackoverflow.com/q/29916313
tags question: http://stackoverflow.com/q/29986993
tags question: http://stackoverflow.com/q/29863361
tags question: http://stackoverflow.com/q/29898168
tag name: c#
tags question: http://stackoverflow.com/q/29912844
tags question: http://stackoverflow.com/q/29887817
tags question: http://stackoverflow.com/q/29923945
tags question: http://stackoverflow.com/q/29920645
tags question: http://stackoverflow.com/q/29921258
tags question: http://stackoverflow.com/q/29949129
tags question: http://stackoverflow.com/q/29962306
tags question: http://stackoverflow.com/q/29928073
tags question: http://stackoverflow.com/q/29868137
tags question: http://stackoverflow.com/q/29943824
tags question: http://stackoverflow.com/q/29929507
tags question: http://stackoverflow.com/q/29919462
tags question: http://stackoverflow.com/q/29948813
tags question: http://stackoverflow.com/q/29952899
tags question: http://stackoverflow.com/q/29942314
tags question: http://stackoverflow.com/q/29863494
tags question: http://stackoverflow.com/q/29930271
tags question: http://stackoverflow.com/q/29912905
tags question: http://stackoverflow.com/q/29891666
tags question: http://stackoverflow.com/q/29959537
tags question: http://stackoverflow.com/q/30001496
tags question: http://stackoverflow.com/q/29937886
tags question: http://stackoverflow.com/q/29926315
tags question: http://stackoverflow.com/q/29967599
tags question: http://stackoverflow.com/q/29907982
tags question: http://stackoverflow.com/q/29961224
tags question: http://stackoverflow.com/q/29999971
tags question: http://stackoverflow.com/q/29977668
tags question: http://stackoverflow.com/q/29995880
tags question: http://stackoverflow.com/q/29900098
tags question: http://stackoverflow.com/q/29846639
tags question: http://stackoverflow.com/q/29911950
tags question: http://stackoverflow.com/q/30001892
tags question: http://stackoverflow.com/q/29890544
type: Tag
tags question: http://stackoverflow.com/q/29943131
tags question: http://stackoverflow.com/q/29907837
tags question: http://stackoverflow.com/q/29921073
tags question: http://stackoverflow.com/q/29951698
tags question: http://stackoverflow.com/q/29931050
tags question: http://stackoverflow.com/q/29852780
tags question: http://stackoverflow.com/q/29936071
tags question: http://stackoverflow.com/q/29885381
tags question: http://stackoverflow.com/q/29876578
tags question: http://stackoverflow.com/q/29920263
tags question: http://stackoverflow.com/q/29986714
tags question: http://stackoverflow.com/q/29978009
tags question: http://stackoverflow.com/q/29890491
tags question: http://stackoverflow.com/q/29849313
tags question: http://stackoverflow.com/q/29913204
tags question: http://stackoverflow.com/q/29930552
tags question: http://stackoverflow.com/q/29980754
tags question: http://stackoverflow.com/q/29876011
tags question: http://stackoverflow.com/q/29946073

http://stackoverflow.com/a/44310685
score: 58
has body: its very easy. Use the bellow code, Its works for me. Here I have used fontawesome icon but you can use anything as image or any other Icon's code. $(document).ready(function(){ $('.slider').slick({ autoplay:true, arrows: true, prevArrow:" ", nextArrow:" " }); });
type: Answer
downvote count: 0
upvote count: 58
answers question: http://stackoverflow.com/q/29876185

http://stackoverflow.com/comment/50573213
type: QuestionComment
score: 0
has text: did you try using browserify or webpack to adapt it for browser use?
comment on: http://stackoverflow.com/q/29888878
type: Comment

http://stackoverflow.com/comment/48079805
has text: Like this? http://jsfiddle.net/rtx4hp9s/1
comment on: http://stackoverflow.com/q/29980053
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29876867
type: Question
has title: Return file contents with Content-type from Javascript
has comment: http://stackoverflow.com/comment/47878104
tagged with: javascript
has comment: http://stackoverflow.com/comment/47878179
has answer: http://stackoverflow.com/a/29876949
score: 0
answer count: 1
has body: I'm trying to include a vCard in a Weebly website, but I need to return the Content-type header, so a simple attachment won't work. I have found the following code in PHP to do this, but I can't include PHP code on Weebly, only Javascript: &lt;?php header("Content-type: text/x-vcard"); header("Content-Disposition: attachment; filename=\"contact.vcf\";"); echo file_get_contents("contact.vcf"); ?&gt; Is there a way to include a button that would return this in Javascript?
accepted answer: http://stackoverflow.com/a/29876949
linked to: http://stackoverflow.com/q/541430
type: AnsweredQuestion
tagged with: content-type

http://stackoverflow.com/comment/47919951
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29898168
has text: Please provide content of images as text inline in the post.

http://stackoverflow.com/q/29985121
has comment: http://stackoverflow.com/comment/48089642
accepted answer: http://stackoverflow.com/a/29985196
type: Question
has body: (this is in Angular) I need to make an array of arrays to be displayed in a chart. The values are generated by this code: $scope.getData = function() { $scope.series.length = 0 $scope.allData.length = 0 var dataArray = []; var dateArray = ["2015-04-03 00:00:00", "2015-04-04 00:00:00", "2015-04-05 00:00:00", "2015-04-06 00:00:00", "2015-04-07 00:00:00"] for (var i = 0 ; i &lt; $scope.dataDisplayModel.length ; i++) { if ($scope.dataDisplayModel[i].checked === true) { var field = $scope.dataList.fields.indexOf($scope.dataDisplayModel[i].field) dataArray.length = 0; for (var j = 0 ; j &lt; 5 ; j++) { var arrayList = $filter('filter')($scope.dataList.values, dateArray[j], true); var sum = _.sum(arrayList, field); dataArray.push(sum); } $scope.allData.push(dataArray); } } } with: $scope.allData = the target array dataDisplayModel = an array of objects containing field names and a checked proporty $scope.dataList = json array containing the original data For some reason every time i push to $scope.allData it overwrites the previous arrays leaving me with duplicates. So if i check 2 fields i get $scope.allData = [[ARRAY2],[ARRAY2]] and if i check 3 fields i get $scope.allData = [[ARRAY3],[ARRAY3],[ARRAY3]] etc. I can't figure out why it keeps overriding my previous arrays.
has comment: http://stackoverflow.com/comment/48089692
tagged with: arrays
downvote count: 0
answer count: 1
tagged with: javascript
has title: javascript .push overwrites previous array values by duplicating the new values
has answer: http://stackoverflow.com/a/29985196
favorite count: 0
upvote count: 2
score: 2
type: AnsweredQuestion

http://stackoverflow.com/comment/47898242
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/29887186
has text: This would apply for entire body. He want it for tree only.
type: Comment

http://stackoverflow.com/comment/48099711
type: QuestionComment
comment on: http://stackoverflow.com/q/29990050
has text: But why down vote the man?
score: 0
type: Comment

http://stackoverflow.com/a/29992874
type: Answer
has comment: http://stackoverflow.com/comment/48190017
has comment: http://stackoverflow.com/comment/48187567
answers question: http://stackoverflow.com/q/29991941
score: 0
has body: Disclaimer: this depends on the implimentation of the promise library used. The main benefit of using .catch() is that it allows you to catch any un-handled error anywhere in the promise chain. $http({ ... }) .then( thing1 ) .then( thing2 ) .then( thing3 ) .then( thing4 ) .then( thing5 ) .catch( function( err ){ console.log( 'An error occurred while processing the response' ) })

http://stackoverflow.com/q/29875620
has body: individualproduct = @All of Transaction Product Name+''; productitem= individual_product.split(','); individual_quantity = @All of Transaction Quantity+'' quantityitem = individualquantity.split(',')+''; for(count=0;count&lt;productitem.length;count++) { var combine += productitem[count]+'' + quantity_item[count]+''; } It does not work. If we do it like : for(count=0;count&lt;productitem.length;count++) { productitem[count]+'' + quantity_item[count]+''; } It does not show an error. but through this, I can only get value at last index. we are expecting to get them all.
has title: Spliting two different @All of items and then combining them according to same indexes. Total number of indexes are same in both @All of items
type: UnansweredQuestion
type: Question
has answer: http://stackoverflow.com/a/29883885
tagged with: javascript
score: 0
answer count: 1
tagged with: podio

http://stackoverflow.com/comment/48034408
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29956297
has text: Can help me more??? What is the error?
score: 1

http://stackoverflow.com/a/29995774
has body: UI Bootstrap, from the AngularUI team, includes a Modal directive. It also has a good number of other handy modules.
score: 0
type: Answer
answers question: http://stackoverflow.com/q/29995678

http://stackoverflow.com/q/29988298
answer count: 1
tagged with: d3plus
has answer: http://stackoverflow.com/a/29993589
tagged with: d3.js
score: 0
type: UnansweredQuestion
has body: I am making a visualisation with d3plus.here is my fiddle.http://jsfiddle.net/kasimsert/wLvpph35/11/ I want to make some basic custom processing over elements like tooltips, rectangles etc.However I could not find a way to do it with d3 selectors.As far as I see problem is when selector function works this elements are not there. For this I have added onLoad function to html body but no change. My question is when in the code flow I should call such code blocks in order to take effect? d3.select(".d3plus_tooltip_container") .style("background-color", 'red');
has title: How to customize d3plus large tooltip
type: Question
linked to: http://stackoverflow.com/q/29291723
tagged with: javascript

http://stackoverflow.com/comment/48014018
comment on: http://stackoverflow.com/a/29946048
has text: But I'm using the `$promise` object that comes with the `$resource` return, notice I never return the values from the `$resource` object.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/29864550
score: 0
has body: Correct way to pass data to ajax post via webmethod is like this. var params = "{'Name' :'" + nm + "', 'code' :'" + cde + "', 'category' :'" + cat + "', 'date' : '" + dt + ", 'price' :'" + pr + "' , 'img_name' :'" + f3 + "' }" // Declare this above $.ajax... data: params, //Use above in $.ajax... .
type: Answer
has comment: http://stackoverflow.com/comment/47865517
answers question: http://stackoverflow.com/q/29863361
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47877141
accepted answer of: http://stackoverflow.com/q/29863361

http://stackoverflow.com/a/29910695
score: 1
answers question: http://stackoverflow.com/q/29852970
accepted answer of: http://stackoverflow.com/q/29852970
type: AcceptedAnswer
downvote count: 0
has body: You shouldn't call a function that makes an HTTP request from a watched expression, whether it's ng-bind or the equivalent {{ }}. This expression, and the subsequent HTTP call` will get called on every digest cycle - clearly not what you expect or need. Instead, get the data that you need and store it, for example, with each profile, and access that value from within the ng-repeat. Also, as per the comment above, you should consider calling Facebook in a batch. Create a separate service to handle all of this complexity and expose a simple API to the controller.
type: Answer
upvote count: 1

http://stackoverflow.com/comment/47826069
type: AnswerComment
has text: I do not want to continue the embed output. . I hope when audio is playing out once .
type: Comment
comment on: http://stackoverflow.com/a/29849781
score: 0

http://stackoverflow.com/q/29977285
has body: I am new learner of meteorJS, as to learn meteor,I started developing chat application in it,I done with a simple chat application with meteor application which inserts message in database and the messages section will just update all messages available in database. Now the problem is with mobile clients. How do I connect mobile applications with meteor when these mobile applications are closed. This means, I just want to push messages to android applications using gcm service and android application updates data when gcm sends update notification. And application will show notifications also. Can I create android application using meteorjs?how?
accepted answer: http://stackoverflow.com/a/29993439
tagged with: javascript
has title: Communicating GCM service and updating application data in realtime with meteor in mobile app
type: AnsweredQuestion
tagged with: meteor
type: Question
tagged with: android
has answer: http://stackoverflow.com/a/29993439
score: 0
answer count: 1

http://stackoverflow.com/comment/48051605
comment on: http://stackoverflow.com/a/29965577
has text: @Devin Gray: Yes, that will work, but my next question will be: What happens when you add, 2 or 10 or 100 fields... Do you *ever* want to hard-wire elements together like that and keep replicating code? :)
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/30000804
type: Answer
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/48120415
upvote count: 1
accepted answer of: http://stackoverflow.com/q/30000171
type: AcceptedAnswer
has body: Each function only returns once. If the function should return several values, you can return an object or an array. The module works with only 1 element. Some parts of the module should be rewritten so it will work with 1 or more elements. You are using jQuery and the modification can be done easily. (function () { 'use strict'; var module = { ratio: 1.38, init: function (selector) { var me = this; this.collection = $(selector); this.plugins(); $(window).on('resize', function (e) { me.collection.each(function () { var size = me.resize(this); $(this).turn('size', size.width, size.height); }); }).resize(); }, resize: function (el) { // reset the width and height to the css defaults el.style.width = ''; el.style.height = ''; var width = el.clientWidth, height = Math.round(width / this.ratio), padded = Math.round(document.body.clientHeight * 0.9); // if the height is too big for the window, constrain it if (height &gt; padded) { height = padded; width = Math.round(height * this.ratio); } // set the width and height matching the aspect ratio el.style.width = width + 'px'; el.style.height = height + 'px'; return { width: width, height: height }; }, plugins: function () { // run the plugin this.collection.each(function () { $(this).turn({ gradients: true, acceleration: true }); }); // hide the body overflow document.body.className = 'hide-overflow'; } }; module.init('.book'); }()); Here is a demo. Note that I have used the .each() method for iterating through the collection and calling the turn method as it seems the plugin only use the first element of the current collection.
answers question: http://stackoverflow.com/q/30000171

http://stackoverflow.com/q/29947580
score: 0
answer count: 1
has body: I'm facing an issue while using bluebird Promises. I'm using CoffeeScript but JavaScript answers are welcome too :) Here is what I'm trying to do : Code example Promise = require 'bluebird' Model = Promise.promisifyAll(require '[...]') # mongoose model promisified getOpts = () -&gt; [...] # whatever Promise.each [1..3], (number) -&gt; opts = getOpts(number) return Model.count(opts).exec (err, count) -&gt; return "the count is #{count}" .spread () -&gt; console.log JSON.stringify arguments result = arguments.join(',') [...] Explanations I want to run the same function with 1, 2, 3 (sequentially), so I use bluebird's .each function. In the function, I need to get a count from my database. I'm using mongoose with bluebird's promisifyAll function to return a Promise and make sure that .each waits until each query is done to go next. Then, I would like to gather the result of each query. I'm using bluebird's spread to gather the return values of .each. However, it doesn't contain the return value of the nested promise. arguments value is : { "0": 1, "1": 2, "2": 3 } Any ideas ? Thanks EDIT Looks like bluebird's .each doesn't go well with .spread. I'm investigating on this issue. EDIT 2 (Thanks Bergi) I found a solution : first I build an array of functions. Then I call bluebird's .all on this array, and then .spread. EDIT 3 Ok, I finally tried .map instead of .each and it works great also.
tagged with: promise
has title: Bluebird nested promises with each/spread
accepted answer: http://stackoverflow.com/a/29948323
type: AnsweredQuestion
tagged with: bluebird
tagged with: coffeescript
has answer: http://stackoverflow.com/a/29948323
type: Question
tagged with: mongoose
tagged with: javascript
linked to: http://stackoverflow.com/q/29818688

http://stackoverflow.com/comment/48081405
type: Comment
type: QuestionComment
has text: So in a way call each $.getJSON at once in the same loop.
score: 0
comment on: http://stackoverflow.com/q/29980772

performance
tags question: http://stackoverflow.com/q/29862451
tags question: http://stackoverflow.com/q/30002398
tags question: http://stackoverflow.com/q/29931866
tags question: http://stackoverflow.com/q/29877297
tags question: http://stackoverflow.com/q/29893174
tags question: http://stackoverflow.com/q/29977956
tags question: http://stackoverflow.com/q/29949109
tags question: http://stackoverflow.com/q/29906672
tags question: http://stackoverflow.com/q/29907871
tags question: http://stackoverflow.com/q/29931421
tags question: http://stackoverflow.com/q/29864822
tags question: http://stackoverflow.com/q/29916329
tags question: http://stackoverflow.com/q/29967488
tags question: http://stackoverflow.com/q/29979787
tags question: http://stackoverflow.com/q/30000903
tag name: performance
type: Tag
tags question: http://stackoverflow.com/q/29845708
tags question: http://stackoverflow.com/q/29921593

http://stackoverflow.com/a/29958825
type: Answer
has body: I used to be hardcore into AMD using require. But with angular, I usually find it better to just minify my js and use the angular dependency injection. However, there are cases where it makes sense to use angular/require - particularly if you have large chunks of js you only want to load for certain scenarios. Here is a good article to help you understand the basics of angular and require together.
score: 0
answers question: http://stackoverflow.com/q/29958258

http://stackoverflow.com/comment/48070772
score: 0
type: Comment
type: QuestionComment
has text: @BenVoigt you're right, that was a "duhh" moment on my behalf, luckily you've edited further for more clarification, though I'm not sure the https/http thing is an accurate title either, especially given the accepted answer.
comment on: http://stackoverflow.com/q/29964674

http://stackoverflow.com/comment/61022521
score: 2
type: AnswerComment
has text: What's the difference between `req([])` and invoking `req` on each key like the accepted answer does?
type: Comment
comment on: http://stackoverflow.com/a/34252626

http://stackoverflow.com/comment/48051757
type: QuestionComment
has text: Your two examples don't have the same behaviour.
comment on: http://stackoverflow.com/q/29965562
score: 0
type: Comment

http://stackoverflow.com/q/29990329
has title: Firefox onkeypress with ctrl key
tagged with: firefox
answer count: 1
tagged with: javascript
tagged with: dom-events
favorite count: 0
has comment: http://stackoverflow.com/comment/48100160
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
upvote count: 4
downvote count: 0
has comment: http://stackoverflow.com/comment/48100948
type: Question
has answer: http://stackoverflow.com/a/30005363
score: 4
has body: I have an input, on which I want specific behavior when a character is inserted, but I want the default behavior on shortcuts like ctrl+c and ctrl+v. Here's the html: and the JavaScript: function onInputKeyPress(event) { if (event.charCode >= 32) { // do some processing here event.preventDefault(); } } This works fine in IE and Chrome, but not in Firefox. This is because when I use ctrl+c or ctrl+v, the onkeypress doesn't get called on IE and Chrome, but it does get called in Firefox. So I tried to insert this code to the start of my handler: if (event.ctrlKey) { // leave default behavior for shortcuts return true; } Now my custom processing doesn't get called when I press ctrl+c, but the shortcut still doesn't work (the text doesn't get copied into the clipboard). Should I do something more to force Firefox to do the default action?

http://stackoverflow.com/comment/47891004
type: QuestionComment
comment on: http://stackoverflow.com/q/29883421
score: 0
has text: Your example works for me http://jsfiddle.net/j08691/6vwp3qwj/. Are you getting errors in the console? Do you need jQuery for this?
type: Comment

http://stackoverflow.com/a/29847000
type: Answer
accepted answer of: http://stackoverflow.com/q/29846983
answers question: http://stackoverflow.com/q/29846983
score: 12
upvote count: 12
type: AcceptedAnswer
downvote count: 0
has body: You can use the attribute starts with selector and then get the length $('[id^="myInputElem"]').length

http://stackoverflow.com/comment/47837696
comment on: http://stackoverflow.com/q/29855261
has text: as I wrote it worked well with me too so call it day ;)
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/q/29922682
downvote count: 1
has comment: http://stackoverflow.com/comment/47967903
accepted answer: http://stackoverflow.com/a/29923421
has body: Right now, I have an event listener that listens to a click on the screen. There is also a button on the screen. When I click on the button the event listener will execute before the onclick. Is there a way I can make onclick have higher priority? Click this Clicking the button also triggers the event handler. 1 shows before 2, when I click the button. I want 2 to show first.
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47967641
has title: onClick priority over addEventListener in javascript?
tagged with: onclick
score: 24
type: Question
answer count: 2
tagged with: handler
tagged with: addeventlistener
tagged with: javascript
has answer: http://stackoverflow.com/a/29923421
possible better answer: http://stackoverflow.com/a/29923365
favorite count: 0
has comment: http://stackoverflow.com/comment/47967186
has answer: http://stackoverflow.com/a/29923365
upvote count: 25

http://stackoverflow.com/q/29959744
tagged with: google-chrome-app
has answer: http://stackoverflow.com/a/29959941
type: UnansweredQuestion
downvote count: 1
type: Question
score: -1
has body: Could someone let me know how can a chrome app (without publishing ) is tested in Google chromebook so as to check its basic functionalities?
tagged with: chromebook
upvote count: 0
answer count: 1
has title: How to test chrome app in chrome book
tagged with: javascript
tagged with: kiosk
favorite count: 0

http://stackoverflow.com/comment/47975094
type: Comment
type: QuestionComment
has text: It seems you have a typo with if statement. `if(bgpg.count=>0)` should be `if(bgpg.count>=0)`.
comment on: http://stackoverflow.com/q/29913946
score: 0

http://stackoverflow.com/comment/47999874
score: 0
type: Comment
type: QuestionComment
has text: I clearly don't understand what is the issue? it is already on right corner.
comment on: http://stackoverflow.com/q/29938668

http://stackoverflow.com/comment/48032838
has text: You already are in your OP. I added a bit more detail in my post. If you don't see it you could try refreshing.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29955878

http://stackoverflow.com/a/29854754
has comment: http://stackoverflow.com/comment/47835532
has comment: http://stackoverflow.com/comment/47835777
score: 0
has body: You need something like this - you need to change #sb and data to reflect the actual element and the data returned $(function(){ $("#form").on("submit",function(e) { // when submitted e.preventDefault(); // cancel the submission $("#info").html("Please wait ..."); $.post(function.php",$("#form").serialize(),function(data) { if (data != "please wait"){ $("#info").html(data); $("#sb).show(); else { $("#form").show(function(){ $("#form").slideUp(3840); $("#payment2").show(); }); }); });
has comment: http://stackoverflow.com/comment/47835828
has comment: http://stackoverflow.com/comment/47835483
has comment: http://stackoverflow.com/comment/47835730
type: Answer
answers question: http://stackoverflow.com/q/29854522
has comment: http://stackoverflow.com/comment/47835931
has comment: http://stackoverflow.com/comment/47835804

http://stackoverflow.com/comment/48117017
type: AnswerComment
type: Comment
has text: add single quote around 3000 also. Try luck
comment on: http://stackoverflow.com/a/29998676
score: 0

http://stackoverflow.com/a/29884801
answers question: http://stackoverflow.com/q/29884688
downvote count: 0
has body: You can specify the target using custom data-* attributes: function chbg(e) { document.querySelector(this.dataset.chbgTarget) .style.backgroundColor = this.dataset[ 'chbgColor' + (e.type == 'mouseover' ? 'Over' : 'Out') ]; } var els = document.querySelectorAll('.chbg'); for(var i=0; i<els.length; ++i) { els[i].addEventListener('mouseover', chbg); els[i].addEventListener('mouseout', chbg); } A - This should effect B only B - This is neutral C - This should effect D only D - This is neutral If at mouseout you only want to remove the color, consider this: function chbg(e) { document.querySelector(this.dataset.chbgTarget) .style.backgroundColor = e.type == 'mouseover' ? this.dataset.chbgColor : ''; } var els = document.querySelectorAll('.chbg'); for(var i=0; i<els.length; ++i) { els[i].addEventListener('mouseover', chbg); els[i].addEventListener('mouseout', chbg); } A - This should effect B only B - This is neutral C - This should effect D only D - This is neutral
upvote count: 2
type: Answer
score: 2

http://stackoverflow.com/comment/47911936
type: QuestionComment
has text: JSONdata has valid content. Looks something like below:
comment on: http://stackoverflow.com/q/29893098
score: 0
type: Comment

http://stackoverflow.com/a/29957252
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29956855
downvote count: 0
type: Answer
upvote count: 3
accepted answer of: http://stackoverflow.com/q/29956855
score: 3
has body: Updated There are two things here. 1. Using the EventEmitter API I think you're asking why ee1 !== ee2 using the API. They're different because the API let's you create as many EventEmitter's as you like. This let's you have an EventEmitter for multiple sockets, streams, db connections, or whatever you need. You could think of new EventEmitter() as a factory stamping out EventEmitter's 2. If you're asking about this specific code, there's a bug in the 2nd version. The bug is due to JavaScript's Operator Order. Tl;DR, you need ()'s around the . for a one-line new: var ee4 = new (require('events').EventEmitter); ( . ) &lt;-- do . before new The issue is that new and . have the same precidence so are evaluated left-to-right. That precedence puts it above or below the . operator after require('events'). This code helped me understand better node test.js: var EventEmitter = require('events').EventEmitter; console.log('require(\'events\').EventEmitter: ' + EventEmitter); // Works var ee1 = new EventEmitter; console.log('ee1: new EventEmitter: ' + ee1); // Works var ee1a = new EventEmitter(); console.log('ee1a: new EventEmitter(): ' + ee1a); // Desn't work. Appears to be the constructor. var ee2 = new require('events').EventEmitter; console.log('ee2: new require(\'events\').EventEmitter: ' + ee2); // Doesn't work. Undefined var ee3 = new require('events').EventEmitter(); console.log('ee3: new require(\'events\').EventEmitter(): ' + ee3); // Works. 'one-liner' var ee4 = new (require('events').EventEmitter); console.log('ee4: new (require(\'events\').EventEmitter): ' + ee4); // Works. 'one-liner' with parameters var ee4a = new (require('events').EventEmitter)(); console.log('ee4: new (require(\'events\').EventEmitter)(): ' + ee4a); // Doesn't work. Undefined var ee5 = require('events').EventEmitter(); console.log('ee5: require(\'events\').EventEmitter(): ' + ee5);

http://stackoverflow.com/comment/47997037
has text: Indeed, i tried this, and it changed nothing. I don't understand why ng-class don't repercute my model change... What could be the reason ? Maybe the fast value's change ? The $scope.refresh change from false to true and true to false in <20ms..
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29921384

collections
tags question: http://stackoverflow.com/q/29924932
tags question: http://stackoverflow.com/q/29862214
type: Tag
tag name: collections

http://stackoverflow.com/a/29927147
upvote count: 2
has comment: http://stackoverflow.com/comment/47976187
answers question: http://stackoverflow.com/q/29926720
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/47976546
accepted answer of: http://stackoverflow.com/q/29926720
type: Answer
has body: You want to use dot notation to get to the value you want. The Google V3 Geocoder returns an array so what you're looking for is the following: results[0].formatted_address Here is a fiddle which alerts the formatted address for you: http://jsfiddle.net/iamjpg/h39041w2/ I hope this is helpful.
score: 2

http://stackoverflow.com/comment/48039897
score: 0
type: Comment
has text: I appreciate your effort...but I was looking for the reason of the log order to understand event-loop better. I know setInterval and setTimeout will work perfectly, but for this program as per my understanding, the output log should have been: #End 'main.js' #Event file 'open' #Event custom 'tick'....which is not showing up.
type: AnswerComment
comment on: http://stackoverflow.com/a/29959347

http://stackoverflow.com/a/29882525
has comment: http://stackoverflow.com/comment/47889253
has comment: http://stackoverflow.com/comment/47889218
downvote count: 0
has comment: http://stackoverflow.com/comment/47889123
has comment: http://stackoverflow.com/comment/47889064
has comment: http://stackoverflow.com/comment/47889902
type: Answer
has comment: http://stackoverflow.com/comment/47889161
has comment: http://stackoverflow.com/comment/47889421
has body: Here is how you can refactor your code: var module = angular.module('app', ['onsen', 'ngSanitize']); module.service('DirectoryService',function(){ var self = this; self.GetCategoryIndex = function(scope){ $http.get("http://www.somewebsite.com/api/get_category_index/").success(function(data, status, headers, config) { //console.log(data.categories); scope.PostCategories = data.categories; scope.spinner = false; }).error(function(data, status, headers, config) { alert("ajax didnt work"); }); } }); module.controller('directoryControl', function($scope, $http, $rootScope,DirectoryService) { ons.ready(function() { $scope.spinner = true; DirectoryService.GetCategoryIndex($scope); $scope.setCurrentCategory = function(categoryName){ $scope.CurrentCategory = categoryName; $rootScope.CurrentCategory=$scope.CurrentCategory; } }); });
has comment: http://stackoverflow.com/comment/47890111
score: 1
has comment: http://stackoverflow.com/comment/47889087
upvote count: 1
has comment: http://stackoverflow.com/comment/47889649
has comment: http://stackoverflow.com/comment/47890062
has comment: http://stackoverflow.com/comment/47890195
has comment: http://stackoverflow.com/comment/47889101
has comment: http://stackoverflow.com/comment/47889952
answers question: http://stackoverflow.com/q/29882401
has comment: http://stackoverflow.com/comment/47890078
has comment: http://stackoverflow.com/comment/47889960

http://stackoverflow.com/a/29989425
accepted answer of: http://stackoverflow.com/q/29986048
type: Answer
has body: When concatenating and minifying through gulp make sure your paths are correct. Mine changed and gulp didn't throw any errors about not finding the files!
answers question: http://stackoverflow.com/q/29986048
score: 0
type: AcceptedAnswer

http://stackoverflow.com/a/29950683
has body: Use jquery validation to validate this form... its simple to do but hard to explain for me. for without post page save this data... 1. make a php function to save the data.. 2. call this function using ajax/jquery.. Sample Code is here... $.ajax({ type: 'GET', url: "Your Function Path/Url", crossDomain: 'true', success: function (data){ // here alert your function response.. alert(data); } });
upvote count: 1
type: Answer
answers question: http://stackoverflow.com/q/29949971
downvote count: 0
score: 1

http://stackoverflow.com/comment/47943162
score: 0
type: Comment
type: QuestionComment
has text: Open your browser's JavaScript / developer console and read the errors
comment on: http://stackoverflow.com/q/29910493

http://stackoverflow.com/comment/47987332
has text: hash and range - both parts of the key, of course you _have_ to specify both
score: 1
comment on: http://stackoverflow.com/q/29932513
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29885803
downvote count: 0
has comment: http://stackoverflow.com/comment/47896085
accepted answer of: http://stackoverflow.com/q/29885671
type: Answer
answers question: http://stackoverflow.com/q/29885671
score: 4
has comment: http://stackoverflow.com/comment/47918645
has body: You want something like ┌──&gt; Fuu.prototype instances ──┤ └──&gt; OtherClass.prototype But that's not possible, because objects only have one Prototype. Therefore, you must achieve one of these: instances ───&gt; Fuu.prototype ───&gt; OtherClass.prototype instances ───&gt; OtherClass.prototype ───&gt; Fuu.prototype So you must set the Prototype of one of those to be the other one. I will assume the first possibility. There are two main ways to set the Prototype: Object.create, when creating the object The problem is that both Fuu.prototype and OtherClass.prototype have been created already. However, you can create a new object with the right Prototype and assign the properties of the old one. Since there may be non-enumerable properties, you must use getOwnPropertyNames. Using defineProperty and getOwnPropertyDescriptor may also be a good idea, in case there are getters or setters. var old = Fuu.prototype, props = Object.getOwnPropertyNames(old); Fuu.prototype = Object.create(OtherClass.prototype); for(var i=0; i&lt;props.length; ++i) Object.defineProperty( Fuu.prototype, props[i], Object.getOwnPropertyDescriptor(old, props[i]) ); setPrototypeOf or __proto__ (ES6), once the object has been created: Object.setPrototypeOf(Fuu.prototype, OtherClass.prototype); Fuu.prototype.__proto__ = OtherClass.prototype; However, be aware that Mutating the Prototype of an object is, by the nature of how modern JavaScript engines optimize property accesses, a very slow operation, in every browser and JavaScript engine. The effects on performance of mutating prototypes [...] may extend to any code that has access to any object whose Prototype has been mutated. If you care about performance you should avoid mutating the Prototype of an object.
has comment: http://stackoverflow.com/comment/47896157
upvote count: 4
type: AcceptedAnswer

http://stackoverflow.com/comment/47829483
comment on: http://stackoverflow.com/q/29851636
has text: Please create a plunkr (or something similar) where the problem is visible.
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/47933096
score: 1
has text: When you say it does not work, does it fail or does it not display as expected? The screens may be small, but often the res is way up in the desktop realm.
comment on: http://stackoverflow.com/q/29905139
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/48085854
has text: @Quentin the duplicates answer the question
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29983159
type: Comment

http://stackoverflow.com/q/29909459
type: Question
has title: Momentjs start of day off by 4 minutes?
has answer: http://stackoverflow.com/a/29909470
answer count: 1
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29909470
tagged with: momentjs
favorite count: 0
has body: this is exactly what i am putting into the chrome console: moment().startOf("day").format('MM/DD/YYYY HH:MM:ss') "04/27/2015 00:04:00" why could this be happening??
tagged with: google-chrome
type: AnsweredQuestion
score: 3
upvote count: 3
tagged with: google-chrome-devtools

http://stackoverflow.com/comment/48078390
type: Comment
type: QuestionComment
has text: @CoryDanielson - Awesome. If you want to add that to your answer, I'll accept.
comment on: http://stackoverflow.com/q/29978252
score: 0

http://stackoverflow.com/comment/47899554
type: AnswerComment
score: 0
type: Comment
has text: try this: https://jsfiddle.net/2xaz90y7/6/embedded/result/ I don't think your scripts are being loaded, try https
comment on: http://stackoverflow.com/a/29887577

http://stackoverflow.com/q/29872452
linked to: http://stackoverflow.com/q/16063394
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29872536
accepted answer: http://stackoverflow.com/a/29872536
has body: A similar but different issue to a recent post of mine - I'm experiencing an error "Cannot set property 'globalCompositeOperation' of undefined" when I'm trying to access a class variable from inside a prototype call. Here is the code - var DrawSlinky = function() { this.c = document.getElementById("c"), this.w = c.width, this.h = c.height, this.ctx = c.getContext('2d'), this.prob = .7, this.minSparks = 3, this.maxSparks = 10, this.minArea = 5, this.maxArea = 40, this.minVel = 10, this.maxVel = 50, this.particles = [], this.frame = 0; }; DrawSlinky.prototype.anim = function(){ this.c.requestAnimationFrame(this.anim); this.ctx.globalCompositeOperation = 'source-over'; this.ctx.fillStyle = 'rgba(0, 0, 0, .04)'; this.ctx.shadowBlur = 0; this.ctx.fillRect(0, 0, w, h); this.ctx.globalCompositeOperation = 'lighter'; ++frame; if(Math.random() &lt; prob) genParticles(); for(var i = 0; i &lt; particles.length; ++i){ var part = particles[i]; part.use(); if(part.x &lt; 0 || part.x &gt; w || part.y &lt; 0 || part.y &gt; h || Math.random() &lt; .01){ particles.splice(i, 1); --i; } } }; What's going on? It should be referencing the .ctx in drawSlinky, but i'm getting an infinite loop of errors... UPDATE - actually, two problems. One is that I can't figure out how to get it to work without hardcoding this.requestAnimationFrame(drawSlinky.anim); (drawSlinky is the instantiation of this DrawSlinky class), and two, the this.cx.globalCompositeOperation = 'source-over'; isn't referencing the ctx from DrawSlinky and its putting it into an infinite loop. So I think I need help with both, even though the second problem was what I originally made the question for
tagged with: refactoring
has title: Refactoring animation code into a class, receiving error on accessing class variable
type: Question
tagged with: javascript
score: 0
answer count: 1

http://stackoverflow.com/comment/48075986
comment on: http://stackoverflow.com/a/29977361
type: AnswerComment
score: 0
type: Comment
has text: lets say i want to pass riskDTO how i can do that i took off $stateParams.processKey still getting that that error [object%object]

http://stackoverflow.com/q/29882412
has comment: http://stackoverflow.com/comment/47888903
type: UnansweredQuestion
duplicate of: http://stackoverflow.com/q/6487366
has comment: http://stackoverflow.com/comment/47888949
linked to: http://stackoverflow.com/q/750486
has comment: http://stackoverflow.com/comment/47889145
has comment: http://stackoverflow.com/comment/47888887
has comment: http://stackoverflow.com/comment/47889001
type: Question
tagged with: for-loop
answer count: 1
has comment: http://stackoverflow.com/comment/47889283
tagged with: javascript
score: 0
has body: I'm a bit confused by why this function always sets the h1#attack to the first element of the hero.attacks-array, when any li.attack is clicked? I'm trying to make set it to the corresponding hero.atatcks-element's name. I've tried with both a for-loop and a foreach and an index set outside of the loop which 'm increasing for every iteration, but nothing seems to work? http://jsfiddle.net/47r768p8/2/ Javascript: var hero = { attacks: [{ name: "atck1" }, { name: "atck2" }, { name: "atck3" }, { name: "atck4" }] }; var attacks = document.getElementsByClassName("attack"); for (var i = 0; i < attacks.length; i++) { var atck = hero.attacks[i]; attacks[i].addEventListener("click", function (event) { document.getElementById("attack").innerText = atck.name; }) } HTML: Atck1 Atck2 Atck3 Atck4
has comment: http://stackoverflow.com/comment/47889181
has title: Why does this function only return the last element of an array?
linked to: http://stackoverflow.com/q/6487366
has answer: http://stackoverflow.com/a/29882442
has comment: http://stackoverflow.com/comment/47889444

http://stackoverflow.com/q/29882420
answer count: 0
score: 1
has comment: http://stackoverflow.com/comment/60257330
upvote count: 1
tagged with: clean-css
tagged with: ruby-on-rails
type: Question
has title: How to mangle class names and IDs all throughout ones ERB, JS and CSS in Rails?
tagged with: uglifyjs
has comment: http://stackoverflow.com/comment/47892511
tagged with: javascript
has body: How does one mangle class names and IDs all throughout ones ERB, JS and CSS in Rails? Every time I open Facebook or Google in Chrome dev tools I see tons of random class names like .201g, .1ayx, c3ag etc. How do they do that? I'm already using Uglifier for basic JS mangling and ruby-clean-css for CSS minification.
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/47889297
type: UnansweredQuestion
tagged with: asset-pipeline

http://stackoverflow.com/a/29994513
answers question: http://stackoverflow.com/q/29994467
has comment: http://stackoverflow.com/comment/48199563
has body: Try using jQuery, it helps alot I find. $('#YourElement').click()
has comment: http://stackoverflow.com/comment/48108596
score: 0
has comment: http://stackoverflow.com/comment/48114408
type: Answer
has comment: http://stackoverflow.com/comment/48108907
has comment: http://stackoverflow.com/comment/48108624

http://stackoverflow.com/comment/48055121
comment on: http://stackoverflow.com/a/29967295
has text: @Regent I took it to mean the second-last class, but reading your comment again it certainly sounds like the "last class if we remove `third`" - in which case you're right, this isn't the correct solution. I'm sure they'll find that out and as a new question if required :)
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/29868400
type: Answer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/29868291
upvote count: 1
has body: The only problem is that you have neglected to define Observer. After adding the function definition, the fiddle works: http://jsfiddle.net/cm5a62jb/1/ // The Observer function Observer(){ this.update = function(){ // ... }; } function ObserverList(){ this.observerList = []; } ObserverList.prototype.add = function( obj ){ return this.observerList.push( obj ); }; ObserverList.prototype.count = function(){ return this.observerList.length; }; ObserverList.prototype.get = function( index ){ if( index > -1 && index < this.observerList.length ){ return this.observerList[ index ]; } }; ObserverList.prototype.indexOf = function( obj, startIndex ){ var i = startIndex; while( i < this.observerList.length ){ if( this.observerList[i] === obj ){ return i; } i++; } return -1; }; ObserverList.prototype.removeAt = function( index ){ this.observerList.splice( index, 1 ); }; function Subject(){ this.observers = new ObserverList(); } Subject.prototype.addObserver = function( observer ){ this.observers.add( observer ); }; Subject.prototype.removeObserver = function( observer ){ this.observers.removeAt( this.observers.indexOf( observer, 0 ) ); }; Subject.prototype.notify = function( context ){ var observerCount = this.observers.count(); for(var i=0; i < observerCount; i++){ this.observers.get(i).update( context ); } }; // Extend an object with an extension function extend( extension, obj ){ for ( var key in extension ){ obj[key] = extension[key]; } } // References to our DOM elements var controlCheckbox = document.getElementById( "mainCheckbox" ), addBtn = document.getElementById( "addNewObserver" ), container = document.getElementById( "observersContainer" ); // Concrete Subject // Extend the controlling checkbox with the Subject class extend( new Subject(), controlCheckbox ); // Clicking the checkbox will trigger notifications to its observers controlCheckbox.onclick = function(){ controlCheckbox.notify( controlCheckbox.checked ); }; addBtn.onclick = addNewObserver; // Concrete Observ…

http://stackoverflow.com/q/29950841
has answer: http://stackoverflow.com/a/29951379
has comment: http://stackoverflow.com/comment/48022710
tagged with: regex
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/48022871
has comment: http://stackoverflow.com/comment/48022620
upvote count: 1
type: Question
score: 1
has body: I try to wrap string with # hashtag character follow any language , below is my code after I add u shows error Invalid flag supplied to RegExp constructor., how to solve it? javascript text.replace(/#([a-z0-9_\pL_]+)/igu, '@$1');
has comment: http://stackoverflow.com/comment/48022586
has comment: http://stackoverflow.com/comment/48022589
has comment: http://stackoverflow.com/comment/48022718
has comment: http://stackoverflow.com/comment/48022769
has title: javascript string.replace any language
has comment: http://stackoverflow.com/comment/48022661
accepted answer: http://stackoverflow.com/a/29951379
answer count: 1
downvote count: 0
tagged with: javascript
linked to: http://stackoverflow.com/q/25968770
favorite count: 0
has comment: http://stackoverflow.com/comment/48022688
has comment: http://stackoverflow.com/comment/48022825

http://stackoverflow.com/a/29929267
has comment: http://stackoverflow.com/comment/48041662
type: Answer
has comment: http://stackoverflow.com/comment/47996386
has comment: http://stackoverflow.com/comment/48003266
score: 1
has body: It seems as if the problem lies in the third party table sorting script you are using. It is likely that you are using it incorrectly, which could be because the script is buggy, because the documentation is wrong, or because you have misunderstood how to use it. I have not used that script and you are unlikely to get support for a 3rd party script on SO unless it is very well known. I had a quick look at the Table_Sort docs you linked to, and you seem to be using it in the correct way. Double check that your column types match up with the ones you have in your array. Since you haven't provided an example of the data you are sorting it is not clear from your question whether you are using the right parameters, nor is it clear which columns are not sorting correctly. It is likely that your date is in an incorrect format as the script you are using does not seem to provide localisation or date formatting options, so it is probably not reading it correctly. If you would like more help with using this script, please provide an example of the table including which columns are not behaving as they should! If there is no particular reason to use this script, why not use a more common, tried and tested one such as Christian Bach's TableSorter? It is free and highly customisable, much easier to use, and being far more common is likely to have fewer bugs and a great deal more support. Edit for new TableSorter problem I took a look at your code and the problem in your case is simply invalid HTML. Two simple changes will get it working: in your table heading you have accidentally closed your &lt;th&gt; tags with &lt;\td&gt;. Change all of these tags to &lt;\th&gt;. in your table body, you have placed &lt;/tbody&gt;&lt;tbody&gt; in between each row. &lt;tr&gt;...&lt;/tr&gt; denotes a HTML row, &lt;tbody&gt;...&lt;\tbody&gt; is meant to enclose all the body rows. Performing a replace on &lt;/tbody&gt;&lt;tbody&gt; to an empty string will clear this up. The script might have been …
accepted answer of: http://stackoverflow.com/q/29927343
upvote count: 1
answers question: http://stackoverflow.com/q/29927343
has comment: http://stackoverflow.com/comment/48002111
has comment: http://stackoverflow.com/comment/48020742
has comment: http://stackoverflow.com/comment/48036659
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/47932527
score: 0
comment on: http://stackoverflow.com/a/29904759
type: Comment
has text: Yes, I saw that info, but my question is specifically just track when the window is closed, it's impossible as well?
type: AnswerComment

http://stackoverflow.com/a/29992982
has body: Your general approach will work, except for some syntax issues, but you can greatly simplify. // Get an array of words by splitting a sentence on spaces. var words = ('TO INFINITY AND BEYOND').split(' '); // Counter of the current word var currentWord = -1; // Define our click handler function clickMe() { // Add one to the current word index currentWord++; // If we have gone beyond the number of words we have, reset if (currentWord &gt;= words.length) { currentWord = 0; document.getElementById('txt').innerHTML = ''; } // Display the word document.getElementById('txt').innerHTML += words[currentWord]; } I should also note that since you are setting HTML, you need to be sure that whatever you put into that HTML is escaped properly for HTML. &amp; becomes &amp;amp;, &gt; becomes ~&gt;`, etc. If you set the text properties, this is done for you automatically.
upvote count: 1
answers question: http://stackoverflow.com/q/29992919
type: Answer
downvote count: 0
score: 1

http://stackoverflow.com/q/29895827
has answer: http://stackoverflow.com/a/29895879
tagged with: javascript
answer count: 3
upvote count: 0
tagged with: jquery
has answer: http://stackoverflow.com/a/29895870
favorite count: 0
linked to: http://stackoverflow.com/q/14220321
has title: Variable set in JSON response not undefined elsewhere
type: UnansweredQuestion
has body: Using this to get a value and set it as a var. var interval; // Get interval from DB constants table $.getJSON("/get_slideshow_interval", function(data){ interval = data; } ); console.log(interval); If I put that console log in the function(data) then it works, but when its out of the getJSON call it returns undefined... How can I use it outside?
score: -3
duplicate of: http://stackoverflow.com/q/14220321
has comment: http://stackoverflow.com/comment/47914280
tagged with: http://stackoverflow.com/tag/json
downvote count: 3
type: Question
has answer: http://stackoverflow.com/a/29895900
has comment: http://stackoverflow.com/comment/47914306

http://stackoverflow.com/comment/47923363
score: 0
has text: Can you paste a little more of your code? Its hard to figure out whats going on...
comment on: http://stackoverflow.com/q/29900359
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/48047425
score: 0
type: AnswerComment
type: Comment
has text: Perfectly Working ...Thanks But i Have 1 More lil Question i want to replace [img] as <img src="
comment on: http://stackoverflow.com/a/29963203

http://stackoverflow.com/q/29929618
tagged with: jquery
score: 0
has answer: http://stackoverflow.com/a/33113032
answer count: 1
has body: I have the following html: &lt;div id="test" ui-jq="plot" ui-options=" [ { data: {{line}}, points: { show: true, radius: 6}, splines: { show: true, tension: 0.45, lineWidth: 5, fill: 0 }, label: 'Akademi' }, ], { colors: ['{{app.color.info}}', '{{app.color.success}}'], series: { shadowSize: 3 }, xaxis:{ font: { color: '#ccc' }, position: 'bottom', ticks: {{categories}} }, yaxis:{ font: { color: '#ccc' } }, grid: { hoverable: true, clickable: true, borderWidth: 0, color: '#ccc' }, tooltip: true, tooltipOpts: { content: '%x.1 is %y.4', defaultTheme: false, shifts: { x: 0, y: 20 } }, redrawOverlayInterval: 60 } " style="height:240px"&gt; &lt;/div&gt; The data for this chart is being loaded by a $http get request: $http.get(api.getUrl('latestActivityByTeamAndModule', [$scope.team_id, $scope.module_id])) .success(function(response){ var i = 0; $scope.line = []; $scope.categories = []; response.forEach(function(y){ var log_date = y.date.substr(0, y.date.indexOf('T')); var date = new Date(log_date); var logg_date = moment(date).fromNow(); $scope.categories.push(logg_date); $scope.line.push(y.num_taken); }); }); Sadly when i force reload (F5) the chart is empty. HOWEVER the html is correctly updated: From inspecting the element in chrome: &lt;div id="test" ui-jq="plot" ui-options="[ { data: [4], points: { show: true, radius: 6}, splines: { show: true, tension: 0.45, lineWidth: 5, fill: 0 }, label: 'Akademi' }, ], { colors: ['#23b7e5', '#27c24c'], series: { shadowSize: 3 }, xaxis:{ font: { color: '#ccc' }, position: 'bottom', ticks: [&amp;quot;21 hours ago&amp;quot;] }, yaxis:{ font: { color: '#ccc' } }, grid: { hoverable: true, clickable: true, borderWidth: 0, color: '#ccc' }, tooltip: true, tooltipOpts: { content: '%x.1 is %y.4', defaultTheme: false, shifts: { x: 0, y: 20 } }, redrawOverlayInterval: 60 }" style="height: 240px; padding: 0px; position: relative;"&gt; im guessing its because of the lazy load so that it does not redraw on the data change?
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47982544
has title: ui-jq flot chart on lazy load
type: Question
has comment: http://stackoverflow.com/comment/47982984
tagged with: flot
tagged with: javascript

http://stackoverflow.com/a/29881637
type: AcceptedAnswer
type: Answer
downvote count: 0
score: 1
has body: Sorry, this post is a bit too length for the comment box. \n is the universal newline character. But perhaps you should look at this alternative: var stateData = { MA: { fullName: 'Massachusetts', motto: 'A catchy expression here', information: 'More data here', population: 1000 }, } To me it looks like you are building some JSON that you'll probably reference like: stateData.MA.fullName It's considered bad practice to format your raw data. You should probably do this when you use the data: console.log('Now you\'ve travelled to: ' + stateData.MA.fullName + "/n" + stateData.MA.motto); Just a thought.
accepted answer of: http://stackoverflow.com/q/29881463
answers question: http://stackoverflow.com/q/29881463
upvote count: 1

http://stackoverflow.com/a/29900640
score: 0
has comment: http://stackoverflow.com/comment/47924064
type: Answer
answers question: http://stackoverflow.com/q/29900098
has comment: http://stackoverflow.com/comment/47927089
has body: If I put the parameter as a string instead of a int it works function confirmAll() { if (confirm("You are about to end session. Are you sure you want to do this.")) { $('#&lt;%=txtconfirmmessageValue.ClientID %&gt;').val("1"); } else { $('#&lt;%=txtconfirmmessageValue.ClientID %&gt;').val("0"); } }

http://stackoverflow.com/q/29892438
upvote count: 0
answer count: 1
tagged with: jquery
favorite count: 0
has body: I know that there are a lot of topics about this, but I couldn't find my error anywhere. I am building a mobile app and I am trying to find places and display their names in a list. My code so far finds all my desired places and creates the markers for all of them, but when I try to write the names, it only writes 15-20. It starts writing the names after all the markers have been placed on the map. I searched for solutions and I've found one using "pagination", but when I tried it, it gives me the following error: "Uncaught TypeError: Cannot read property 'hasNextPage' of undefined" This is my code for showing the places: var map; var nextPlace; function initialize() { //get the current position of the device navigator.geolocation.getCurrentPosition(search, failPosition,{timeout:10000}); document.addEventListener("backbutton", onBackKeyDown, false); } //called if the position is not obtained correctly function failPosition(error) { alert("Your position is not available, please check your settings"); } function search(position) { var lat = position.coords.latitude; var lon = position.coords.longitude; var myPos= new google.maps.LatLng(lat, lon); var mapOptions = { zoom: 12, center: new google.maps.LatLng(lat, lon) }; map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions); var Types=new Array(); var ty = window.localStorage.getItem("types"); if(ty[0]!='0') { Types.push('restaurant'); } if(ty[1]!='0') { Types.push('bar'); } if(ty[2]!=0) { Types.push('night_club'); } var request = { location: myPos, radius: String(window.localStorage.getItem("distance")), types: Types }; var service = new google.maps.places.PlacesService(map); service.radarSearch(request, callback); } function callback(results, status, pagination) { if (status == google.maps.places.PlacesServiceStatus.OK) { getPlacesDetails(results); if (pagination.hasNextPage) { sleep:2; pagination.nextPage(); } else { $('li').click(function() { alert("clicked"); }) } } } function getPlacesDetails…
has answer: http://stackoverflow.com/a/29893976
has title: pagination undefined google maps : showing multiple placeDetails
type: AnsweredQuestion
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/47909638
tagged with: google-maps
has comment: http://stackoverflow.com/comment/47909746
accepted answer: http://stackoverflow.com/a/29893976
tagged with: pagination
tagged with: javascript
score: -1
tagged with: google-maps-api-3

http://stackoverflow.com/q/29928206
has answer: http://stackoverflow.com/a/29928387
has body: Goal The media="print"on my page is horrible and I want to improve it. Basically, I want to improve the look of my page when my users print it out. I'm thinking . . . Rather than, hiding and showing a lot of items on my page on media="print". I decided to hide my page completely, and load a PDF instead. The PDF that I made. I'm not sure if this is the best approach for this, but I find that save a lot of time, and still have a full control in term of showing/hiding objects. HTML &lt;body &gt; &lt;span id="web"&gt; &lt;!-- My whole site structure --&gt; &lt;/span&gt; &lt;span id="print"&gt;&lt;iframe src="img/USER.pdf" width="100%" height="830" &gt;&lt;/span&gt; &lt;/body&gt; Within my &lt;body&gt;, I have a PDF &lt;span id="print"&gt;&lt;iframe src="img/name.pdf" width="100%" height="830" &gt;&lt;/span&gt; I hide that PDF thoughout my whole page by doing : #print{ display: none; } Then, when the user want to print my page out. I want to load this PDF back, and hide my whole site. CSS /*Hide the whole page*/ #web{ display: none; } /*Show PDF back*/ #print{ display:block!important; } Result It works, but unfortunately, it's only work in Safari. Not Chrome, Not Firefox. What is the most efficient way to achieve something like this ? Can someone help me fix this to work with all browsers ? Is there any JS, or jQuery plug-in that will help me accomplish this ? If there is anything else that I can provide, let me know.
type: AnsweredQuestion
has title: How can I load a custom PDF when user(s) trying to print my page out?
has answer: http://stackoverflow.com/a/29945743
accepted answer: http://stackoverflow.com/a/29945743
type: Question
answer count: 2
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/29928387
score: 0
tagged with: http://stackoverflow.com/tag/pdf
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47978627
tagged with: css
has comment: http://stackoverflow.com/comment/47978359
has comment: http://stackoverflow.com/comment/47978493
has comment: http://stackoverflow.com/comment/47978485

http://stackoverflow.com/comment/48001729
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29940216
type: AnswerComment
has text: Actually this doesn't work for multiselect2side (no tag for this plugin)

http://stackoverflow.com/comment/48096410
comment on: http://stackoverflow.com/q/29988359
score: 0
has text: @mplungjan The way I understand it, they are required. [Try this](http://jsfiddle.net/qxrqk4xt/1/)
type: Comment
type: QuestionComment

http://stackoverflow.com/a/30015801
score: 0
has body: You can get modelb's info in modela's afterModel hook. Example: App.ModelaRoute = Ember.Route.extend({ model: function(params) { return this.store.find('modela', params.id); }, afterModel: function(modela) { // Note: afterModel is called after modela is loaded // Iterate through modelbs modela.get('modelbs').foreach(function(modelb) { // Get current modelb's extra information by ajax. Note that this may result in *many* ajax requests - may be undesirable ajaxRequestForModelbInfo.done(function(response) { // Assign extra information to modelb's extraInformation property modelb.set('extraInformation', response); }); }); } }); In the hbs template file: {{#each modelb in modela.modelbs}} {{modelb.extraInformation}} {{/each}}
type: Answer
answers question: http://stackoverflow.com/q/29983765
has comment: http://stackoverflow.com/comment/48153932

http://stackoverflow.com/q/29999097
has comment: http://stackoverflow.com/comment/48117718
tagged with: javascript
has answer: http://stackoverflow.com/a/29999210
accepted answer: http://stackoverflow.com/a/29999210
score: 4
has body: I came across a strange issue with jQuery. It seems that when jQuery is used to add multiple css properties with the same name (for cross browser compatibility), each "duplicate" property, is being overwritten and only the last occurrence is being used. Example, in pure css, I have this: div.ellipse { background-image: radial-gradient(center bottom, ellipse cover, #ffeda3, #ffc800); background-image: -o-radial-gradient(center bottom, ellipse cover, #ffeda3, #ffc800); background-image: -ms-radial-gradient(center bottom, ellipse cover, #ffeda3, #ffc800); background-image: -moz-radial-gradient(center bottom, ellipse cover, #ffeda3, #ffc800); background-image: -webkit-radial-gradient(center bottom, ellipse cover, #ffeda3, #ffc800); } Fiddle: http://jsfiddle.net/Lzhcdr2f/ The background image property is used multiple times for cross browser compatibility. Now I try to apply the above css code using jQuery like this: $('.ellipse').css({ 'background-image': 'radial-gradient(center bottom, ellipse cover, #ffeda3, #ffc800)', 'background-image': '-o-radial-gradient(center bottom, ellipse cover, #ffeda3, #ffc800)', 'background-image': '-ms-radial-gradient(center bottom, ellipse cover, #ffeda3, #ffc800)', 'background-image': '-moz-radial-gradient(center bottom, ellipse cover, #ffeda3, #ffc800)', 'background-image': '-webkit-radial-gradient(center bottom, ellipse cover, #ffeda3, #ffc800)' }); Fiddle: http://jsfiddle.net/z9ygxj9j/ The above code will ONLY work in webkit browsers (chrome/safari), because the last line refers to -webkit browser, and jQuery seems to override properties with the same name and only use the last occurrence. The only way around, seems to be this: $('.ellipse').css({'background-image': 'radial-gradient(center bottom, ellipse cover, #ffeda3, #ffc800)'}); $('.ellipse').css({'background-image': '-ms-radial-gradient(center bottom, ellipse cover, #ffeda3, #ffc800)'}); $('.ellipse').css({'background-image': '-moz-radial-gradient(center bottom, ellipse cover, …
downvote count: 0
has comment: http://stackoverflow.com/comment/48117427
tagged with: jquery
has answer: http://stackoverflow.com/a/29999258
favorite count: 0
has comment: http://stackoverflow.com/comment/48117510
upvote count: 4
tagged with: css
linked to: http://stackoverflow.com/q/11072785
has comment: http://stackoverflow.com/comment/48117411
answer count: 4
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29999721
has comment: http://stackoverflow.com/comment/48117603
has comment: http://stackoverflow.com/comment/48117542
has comment: http://stackoverflow.com/comment/48117472
has title: jQuery adding multiple css properties with same name doesn't work
has comment: http://stackoverflow.com/comment/48117464
possible better answer: http://stackoverflow.com/a/29999258
linked to: http://stackoverflow.com/q/9847580
type: Question
has answer: http://stackoverflow.com/a/29999473
has comment: http://stackoverflow.com/comment/48117400

http://stackoverflow.com/a/74300906
has body: It's really late but bencekd's answer to "Add Link to X-Label Chart.js" worked for me. My project uses the old Chart.js v1 and it's for a bar chart, not radar. You'll have to modify it accordingly as per the current version Chart.js. I don't see why it shouldn't work for a radar with a little refactoring. Code (their provided Fiddle, one minor change by me, comments by "/*" indicate my lines): var randomScalingFactor = function() { return Math.round(Math.random()*100) }; var barChartData = { labels : ["January","February","March","April","May","June","July"], datasets : [ { fillColor : "rgba(220,220,220,0.5)", strokeColor : "rgba(220,220,220,0.8)", highlightFill: "rgba(220,220,220,0.75)", highlightStroke: "rgba(220,220,220,1)", data : [randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor()] }, { fillColor : "rgba(151,187,205,0.5)", strokeColor : "rgba(151,187,205,0.8)", highlightFill : "rgba(151,187,205,0.75)", highlightStroke : "rgba(151,187,205,1)", data : [randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor()] } ] } var ctx = document.getElementById("canvas").getContext("2d"); window.myBar = new Chart(ctx).Bar(barChartData, { responsive : true }); $("#canvas").click( function(evt){ var ctx = document.getElementById("canvas").getContext("2d"); // from the endPoint we get the end of the bars area var base = myBar.scale.endPoint; var height = myBar.chart.height; var width = myBar.chart.width; // only call if event is under the xAxis if(evt.pageY > base){ // how many xLabels we have var count = myBar.scale.valuesCount; var padding_left = myBar.scale.xScalePaddingLeft; var padding_right = myBar.scale.xScalePaddingRight; // calculate width for each label var xwidth = (width-padding_left-padding_right)/count; // determine what label were clicked on AND PUT IT INTO bar_index …
score: 0
answers question: http://stackoverflow.com/q/29973533
type: Answer

http://stackoverflow.com/comment/47847481
has text: var jsonUrl = 'myJson.json'; var item = ''; function myFunc() { $.ajax({ async: false, url: jsonUrl, type: 'get', success: function(data) { $.each($.parseJSON(data)['titles'], function(k, v){ item += v['title']; }); } }); return item; } console.log(myFunc());
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29851451

http://stackoverflow.com/comment/47916238
type: Comment
comment on: http://stackoverflow.com/a/29896700
has text: Just leave off the `join` in that case. `map` will return an array.
score: 0
type: AnswerComment

http://stackoverflow.com/q/29845275
downvote count: 1
has comment: http://stackoverflow.com/comment/47817290
type: Question
tagged with: javascript
tagged with: jquery
tagged with: ajax
score: 0
has comment: http://stackoverflow.com/comment/47816338
answer count: 1
has comment: http://stackoverflow.com/comment/47818748
favorite count: 0
type: UnansweredQuestion
has title: Ajax request collapsing multi-level JSON object?
tagged with: python
has comment: http://stackoverflow.com/comment/47816389
has comment: http://stackoverflow.com/comment/47816546
has comment: http://stackoverflow.com/comment/47818224
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/29850709
upvote count: 1
has body: Im sending data through JQuery AJAX to a python backend server. When I send the data it changes the object to a different format. Is there a way of stopping this? I've looked online but i'm not 100% whats going on. Example of data im sending through the request: data:{ name:"test", products:[ { name: "test_product", id: 1 }, { name: "test product2", id: 2 } ], session_id:"blablabla", } How it appears when it comes into the server: { "name":"test", "products[0][name]":"test_product", "products[0][id]":"1", "products[1][name]":"test_product2", "products[1][id]":"2", "session_id":"blablabla", }

http://stackoverflow.com/comment/47942895
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29910387
has text: `$(this).next('.lbl')` to access the associated label. Use `.addClass()` and `.removeClass()` to add an remove class names. But why not use a ` ` so its associated with the button?

http://stackoverflow.com/q/29960410
has answer: http://stackoverflow.com/a/29960689
type: AnsweredQuestion
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/48041331
favorite count: 0
has body: I checked out all the links relating to this topic that I could and I found out that the reason why this is probably occurring is because my variable is not an array. I'm not too sure how to fix this. This is my code: function addStudent() { var newStudentInfo = { 'studentNumber': document.getElementById("addStudentStudentNumber").value, 'name': document.getElementById("addStudentName").value } var oldStudentInfo = []; oldStudentInfo = JSON.parse(localStorage.getItem("students")) || []; oldStudentInfo.push(newStudentInfo); localStorage.setItem("students", JSON.stringify(oldStudentInfo)); } When looking at errors in google chrome, it tells me Paused on exception: 'TypeError: oldStudentInfo.push is not a function'. Where did I mess up? All help will be appreciated. Thanks!
type: Question
score: 3
has title: .push is not a function, using Javascript and localstorage
accepted answer: http://stackoverflow.com/a/29960689
upvote count: 3
answer count: 1
has comment: http://stackoverflow.com/comment/48041592
has comment: http://stackoverflow.com/comment/48041468

http://stackoverflow.com/comment/48125470
has text: @Hamed discussion is really going out of scope as ypu asked in question..its already solved.please do upvote & accept this answer..And do open another question thanks
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/30002388
type: Comment

sitemap
type: Tag
tag name: sitemap
tags question: http://stackoverflow.com/q/29895733

http://stackoverflow.com/q/29937410
answer count: 1
has answer: http://stackoverflow.com/a/30357567
favorite count: 0
has comment: http://stackoverflow.com/comment/48789251
linked to: http://stackoverflow.com/q/26264608
tagged with: gps
type: AnsweredQuestion
tagged with: altitude
accepted answer: http://stackoverflow.com/a/30357567
type: Question
has comment: http://stackoverflow.com/comment/48807276
score: 5
upvote count: 5
downvote count: 0
tagged with: javascript
has title: HTML5: get device altitude
has body: In my HTML5 page I would like to retrieve the altitude of the device (I'm testing on my Nexus 5 with Chrome mobile). As mentioned in HTML5 Geolocation Altitude, the altitude returned by the Geolocation API is always null. I've read that some native Android apps use different approaches such as pressure sensor (when available). Is it somehow possible in HTML5? Do you have other suggestions?
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/10630664

http://stackoverflow.com/comment/47923689
comment on: http://stackoverflow.com/a/29884066
type: Comment
score: 0
has text: yes, `returnedCatsArray['CategoryC'][5]` will always return the correct item. Whether `returnedCatsArray == {categoryA:[] , categoryC: [1,2] }` or `returnedCatsArray == {categoryC:[1,2] , categoryA: [] }` shouldn't matter because you should access it with the keys ie. `returnedCatsArray["categoryC"] == [1,2]` in both cases. The order of the keys is not guaranteed, but they tend to stay in the correct order in practice.
type: AnswerComment

http://stackoverflow.com/q/30000929
has body: HTML Code: Nick: Hasło Pamiętaj mnie Zaloguj się JS Code: $(function() { var checkLogForm=function(){ alert('anything'); }; $('#login-button').on("click", fn) }); I don't know why but I can't attach any event to element #login-button. It works even with other elements in form. I've tried also with bind() function but it still doesn't work. Please help!
tagged with: jquery
favorite count: 0
tagged with: events
possible better answer: http://stackoverflow.com/a/30001159
answer count: 4
has answer: http://stackoverflow.com/a/30001159
downvote count: 0
has answer: http://stackoverflow.com/a/30000986
accepted answer: http://stackoverflow.com/a/30001022
type: Question
has answer: http://stackoverflow.com/a/30001039
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/30001022
score: 1
has title: Event attached to button JQUERY
has comment: http://stackoverflow.com/comment/48121151
has comment: http://stackoverflow.com/comment/48120671
upvote count: 1
tagged with: button
tagged with: javascript

http://stackoverflow.com/comment/47994879
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29927588
type: Comment
has text: Add `toLocaleTimeString()` to the end of date. When I changed the code on the link it worked for me with just new date but that may be due to the date settings for my region.

http://stackoverflow.com/q/29973283
upvote count: 3
has comment: http://stackoverflow.com/comment/48367817
has comment: http://stackoverflow.com/comment/57952177
has comment: http://stackoverflow.com/comment/48067587
has comment: http://stackoverflow.com/comment/48160699
has comment: http://stackoverflow.com/comment/48072692
has answer: http://stackoverflow.com/a/35419753
favorite count: 0
downvote count: 0
answer count: 5
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/48152211
type: Question
score: 3
has answer: http://stackoverflow.com/a/49582750
has comment: http://stackoverflow.com/comment/48078999
tagged with: onedrive
has answer: http://stackoverflow.com/a/32492185
has title: OneDrive FilePicker "The provided value for the input parameter 'redirect_uri' is not valid"
has comment: http://stackoverflow.com/comment/48279246
tagged with: javascript
has body: I've spent a lot of time searching and trying to find a solution, so far without success. I'm trying to implement a simple OneDrive filepicker as per https://dev.onedrive.com/sdk/javascript-picker-saver.htm#opening-files-on-onedrive However I am continually getting the error https://login.live.com/err.srf?lc=1033#error=invalid_request&error_description=The+provided+value+for+the+input+parameter+'redirect_uri'+is+not+valid.+The+expected+value+is+'https://login.live.com/oauth20_desktop.srf'+or+a+URL+which+matches+the+redirect+URI+registered+for+this+client+application.&state=redirect_type%3dauth%26display%3dpage%26request_ts%3d1430410948914%26response_method%3durl%26secure_cookie%3dfalse I have tried different options originally with localhost, but even when I load up a page onto a simple domain I get the same message. I have tried variations of the redirect url- none appear to work. My web page: OneDrive One Drive Picker I have registered and have a client ID, and have tried variations of the redirect URL in the API settings, such as mydomain.com, www.mydomain.com, and www.mydomain.com/redirect with no success. While I have found many good solutions in Stack Overflow previously this is the first time I have asked a question. Thank you.
has comment: http://stackoverflow.com/comment/48115450
has answer: http://stackoverflow.com/a/37355530
has answer: http://stackoverflow.com/a/33410907

http://stackoverflow.com/q/29850812
tagged with: arrays
tagged with: javascript
possible better answer: http://stackoverflow.com/a/29850952
has answer: http://stackoverflow.com/a/29850952
accepted answer: http://stackoverflow.com/a/29850931
answer count: 3
score: 2
downvote count: 0
favorite count: 0
tagged with: angularjs
upvote count: 2
has comment: http://stackoverflow.com/comment/47828107
has answer: http://stackoverflow.com/a/29850957
has title: Angular JS copy Object to another into a for loop
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29850931
tagged with: loops
type: Question
has body: Trying to copy a part of a json object into another json object (thats a filter), into a for loop, under a conditional statement, it doesn't work. This work but a plain to write an array: $scope.candidats=[]; for (i=0;i&lt;omegaCandidats.length;i++){ if (omegaCandidats[i].dateRdv==date){ $scope.candidats.push( { "id" :omegaCandidats[i].id, "prenom" :omegaCandidats[i].prenom, "nom" :omegaCandidats[i].nom, "heure" :omegaCandidats[i].heure, "dateRdv" :omegaCandidats[i].date } ) }; }; This doesn't work, and that's what i want to do. Its logical and should work: $scope.candidats=[]; for (i=0;i&lt;omegaCandidats.length;i++){ if (omegaCandidats[i].dateRdv==date){ $scope.candidats[i] = omegaCandidats[i]; }; }; This one work but only get one value of the for loop its useless: $scope.candidats=[]; for (i=0;i&lt;omegaCandidats.length;i++){ if (omegaCandidats[i].dateRdv==date){ $scope.candidats[0] = omegaCandidats[i]; }; };
tagged with: object

http://stackoverflow.com/q/29975316
type: Question
tagged with: mongodb
downvote count: 0
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/48070583
favorite count: 0
has comment: http://stackoverflow.com/comment/48070878
tagged with: meteor
has body: Users waitOn a data subscription: waitOn: function(){ if(Meteor.user()){ var current_user_admin_status = Meteor.user().admin; console.log(current_user_admin_status); return Meteor.subscribe('users', current_user_admin_status); } } But current_user_admin_status always returns null, even though I can go into the db and find the admin field db.users.find({"_id" : "6Mqx5Ky92bZfhaX8A"}, {"admin" : 1}) { "_id" : "6Mqx5Ky92bZfhaX8A", "admin" : true } Im defining this variable on the client, to pass to the server to only publish user collection if current user is an admin, but it keeps getting caught on the null if else statement Meteor.publish('users', function(current_user_admin_status){ if(!this.userId){ console.log('you are not signed in'); } else if( current_user_admin_status = 'null' ){ console.log('you are not an admin'); } else if ( current_user_admin_status = 'false' ) { console.log('you are not an admin'); } else if (current_user_admin_status = 'undefined'){ console.log('you are not an admi'); } else { console.log('you are logged in as an admin'); return Meteor.users.find({}, {fields: {createdAt: 1, admin: 1, emails: 1, username: 1, first_name: 1, last_name: 1}}); } });
type: UnansweredQuestion
upvote count: 1
has title: Meteor user property undefined
has comment: http://stackoverflow.com/comment/48070489
score: 1
has comment: http://stackoverflow.com/comment/48072071
has answer: http://stackoverflow.com/a/29979772
has comment: http://stackoverflow.com/comment/48071179

http://stackoverflow.com/comment/47823408
type: QuestionComment
score: 2
has text: Can't use `indexOf` if the objects aren't references to each other. They can look identical but doesn't mean they are the same object
comment on: http://stackoverflow.com/q/29848617
type: Comment

http://stackoverflow.com/q/29980113
answer count: 2
accepted answer: http://stackoverflow.com/a/29980143
tagged with: jquery
has answer: http://stackoverflow.com/a/29980163
tagged with: jquery-ui-dialog
has body: I have the following php and java script am working on,as soon as the label_dialog box pops-up ,it opens to the top left corner of the browser even though I have it as center..can anyone help to figure out why it is not in the center? php code:- &lt;div id="label_dialog" title="Submission Details"&gt; &lt;center&gt;&lt;table border='1' align="center"&gt; &lt;div id="submission_details" name="submission_details"&gt;&lt;/div&gt; &lt;/table&gt;&lt;/center&gt; &lt;/div&gt; javascript code:- $("#label_dialog").dialog({ modal: true, draggable: false, resizable: true, position: ['center'], width: $( window ).width()*3/4, dialogClass: 'ui-dialog-osx', buttons: { "Edit": function() { $(this).dialog("close"); }, "Submit": function() { $(this).dialog("close"); $('#submitted_gerrits_form').hide(); $('#gerrits_form').hide(); $("#component_form").hide(); $("#submitted_gerrits_table").hide(); $("#gerrits_form").hide(); $("#check_gerrits").hide(); $("#main_form_su_validation").hide(); $("#contacts_form").hide(); $("#dependencies_form").hide(); $("#su_release_form").hide(); $("#submission_note_form").hide(); $("#submission").hide();
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29980143
type: AnsweredQuestion
type: Question
possible better answer: http://stackoverflow.com/a/29980163
tagged with: jquery-ui
tagged with: javascript
has title: Position of dialog box not in the center of the web browser
score: 0

http://stackoverflow.com/comment/49449729
comment on: http://stackoverflow.com/q/29926388
score: 0
type: QuestionComment
type: Comment
has text: The problem is in the Browser rendering the font, i have this problem occassionaly!

http://stackoverflow.com/comment/48044026
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29961409
has text: Inside your callback function for `core-select` event put a `console.log(arguments);` and post results here please.
type: Comment

http://stackoverflow.com/q/29868564
has comment: http://stackoverflow.com/comment/47883923
has answer: http://stackoverflow.com/a/29868736
has comment: http://stackoverflow.com/comment/47892322
has comment: http://stackoverflow.com/comment/47880429
upvote count: 1
has comment: http://stackoverflow.com/comment/47879423
has body: The Dart &lt;object&gt; element does not support a getter to access &lt;object&gt;.contentDocument and thus I thought about extending the object to add the functionality. I took a look at the implementation of the ObjectElement and I basically need to add these lines: @DomName('HTMLObjectElement.contentDocument') @DocsEditable() Document get contentDocument =&gt; _blink.BlinkHTMLObjectElement.instance.contentDocument_Getter_(this); However, I have no idea how to do this. The solution I am using at this time is with a proxy which redirects all calls to the underlying JsObject but to be honest, this is not just dirty, it impossible to maintain. /* Updated to explain the root of all evil */ When starting the project I am working on, I wanted to display SVGs, which are uploaded by the user, on the website and let the user manipulate these SVGs by inserting additional SvgElements or removing others. When downloading the SVGs as a String and displaying them by container.append(new SvgElement(svgCode)) I got really strange display bugs such that embeded images in the SVGs are displaced or even removed and other bugs with masks. The problem was solved by using an &lt;object&gt; tag and set setting its data attribute to the SVG's url. The SVGs are rendered correctly. That being said, another issue came up. I wasn't able to access and manipulate the SVGs DOM because it's inside an &lt;object&gt; tag and the tag's document cannot be accessed by using contentDocument. When taking all this into account, there are pretty much only two options left: I use the &lt;object&gt; tag with no display bugs but not being able to manipulate the SVGs or I create new SvgElements fromt the SVG's source and append them to the DOM which let's me manipulate the SVGs but having display bugs. Since having display bugs isn't really a solution I can only make use of the first option, using an &lt;object&gt; tag and working around with Javascript to access the object's contentDocument. As you can see,…
type: Question
has comment: http://stackoverflow.com/comment/47880811
has comment: http://stackoverflow.com/comment/47883901
tagged with: javascript
has comment: http://stackoverflow.com/comment/47882280
has comment: http://stackoverflow.com/comment/47879272
has comment: http://stackoverflow.com/comment/47883161
downvote count: 0
answer count: 1
score: 1
has comment: http://stackoverflow.com/comment/47882827
has comment: http://stackoverflow.com/comment/47882918
favorite count: 0
has comment: http://stackoverflow.com/comment/47882986
type: UnansweredQuestion
tagged with: dart
tagged with: http://stackoverflow.com/tag/html
has title: Extending in Dart
has comment: http://stackoverflow.com/comment/47879458
has comment: http://stackoverflow.com/comment/47883989
has comment: http://stackoverflow.com/comment/47883609
has comment: http://stackoverflow.com/comment/47883113

http://stackoverflow.com/a/29980337
type: Answer
answers question: http://stackoverflow.com/q/29980181
score: 1
upvote count: 1
downvote count: 0
has body: var lines = $('textarea').val().split('\n'); lines.splice(0, 1); $('textarea').val(lines.join("\n")); jsfiddle DEMO

http://stackoverflow.com/comment/47919823
score: 1
has text: @MarcAudet I've updated with the helper and css
type: Comment
comment on: http://stackoverflow.com/q/29898105
type: QuestionComment

http://stackoverflow.com/comment/47845041
type: QuestionComment
has text: Something like [this](https://jsfiddle.net/Lu0jz3nc/12/) ?
score: 0
comment on: http://stackoverflow.com/q/29859434
type: Comment

http://stackoverflow.com/a/64261715
has body: Another approach here is to change the geometry. In the cylinder geometry you specify thetaStart and thetaLength for the cylinder section you want to render, and usually you choose a positive angle, i.e. thetaLength&gt;0. If instead you pass thetaStart + thetaLength and -thetaLength to CylinderBufferGeometry, the cylinder is rendered clockwise instead of counter-clockwise, and all face normals now point inwards. So, there is no need to flip the texture anymore.
answers question: http://stackoverflow.com/q/29974578
score: 0
type: Answer

http://stackoverflow.com/a/29906546
upvote count: 4
downvote count: 0
has comment: http://stackoverflow.com/comment/47951604
has comment: http://stackoverflow.com/comment/47954948
score: 4
has comment: http://stackoverflow.com/comment/60581101
answers question: http://stackoverflow.com/q/29905472
has body: I'm not sure if you can check if a third party app is installed on your device by code. I think only when you know the url-scheme of this specific 3rd party app you can check by BOOL canOpen = NO; canOpen = [[UIApplication sharedApplication] canOpenURL:url]; if (canOpen) { [[UIApplication sharedApplication] openURL:url]; } else { [[UIApplication sharedApplication] openURL:@"itms://itunes.apple.com/us/app/mensa-essen/id742570910?ls=1&amp;mt=8"]; }
type: Answer

http://stackoverflow.com/q/29969538
score: 1
has body: I am following the nested selections tutorial here: http://bost.ocks.org/mike/nest/. I've copied the code, but it is failing to bind the values to the tds. The table structure is being created, but the values aren't being entered in to the td elements. If I log d on the td append functions, it prints the arrays from matrix. Even if I put in return 1, the tds aren't populated. &lt;!DOCTYPE html&gt; &lt;style&gt; &lt;/style&gt; &lt;body&gt; &lt;/body&gt; &lt;script src="http://d3js.org/d3.v3.min.js"&gt;&lt;/script&gt; &lt;script&gt; var matrix = [ [ 0, 1, 2, 3], [ 4, 5, 6, 7], [ 8, 9, 10, 11], [12, 13, 14, 15], ]; var body = d3.select("body"); var table = body.append("table"); var tr = table.selectAll("tr") .data(matrix) .enter().append("tr"); var td = tr.selectAll("td") .data(function(d) { console.log(d); return d; }) .enter().append("td"); &lt;/script&gt; Console output: Array [ 0, 1, 2, 3 ] nested_selections.html:30:6 Array [ 4, 5, 6, 7 ] nested_selections.html:30:6 Array [ 8, 9, 10, 11 ] nested_selections.html:30:6 Array [ 12, 13, 14, 15 ] nested_selections.html:30:6 If I try grabbing the index like this: var td = tr.selectAll("td") .data(function(d, i) { console.log(d[i]); return d; }) .enter().append("td"); I get this console output (which looks like it combines index of array and nested array): 0 nested_selections.html:30:6 5 nested_selections.html:30:6 10 nested_selections.html:30:6 15 nested_selections.html:30:6 Thanks for any help.
has title: d3 nested selection tutorial not rendering table
type: Question
downvote count: 0
accepted answer: http://stackoverflow.com/a/29970295
tagged with: javascript
answer count: 1
favorite count: 0
tagged with: d3.js
upvote count: 1
has answer: http://stackoverflow.com/a/29970295
type: AnsweredQuestion

http://stackoverflow.com/comment/47842819
type: Comment
has text: thank you but it did't work, perhaps the javascript my webpage uses is old? I created the forum as phpBB2 in forummotion
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29858366

http://stackoverflow.com/a/29897275
downvote count: 0
score: 1
has body: I usually use underscore template for similar things. http://underscorejs.org/#template
answers question: http://stackoverflow.com/q/29897176
upvote count: 1
type: Answer

http://stackoverflow.com/q/29900554
has title: Detect dead scrolling at the bottom of the page (mousewheel, scroll events)
has comment: http://stackoverflow.com/comment/47924001
tagged with: jquery
favorite count: 0
upvote count: 9
has answer: http://stackoverflow.com/a/29901541
has comment: http://stackoverflow.com/comment/47924016
has body: I'm looking to detect when a user has scrolled to the bottom of a page and then attempts to continue scrolling but where there's nothing left to scroll/view. I'm creating usability metrics where dead scroll is one metric and need a way to accurately detect when users try to scroll but are not offered anything left to see. I need something that fires when the mousewheel event initiates but the page does not scroll, with up/down direction.
accepted answer: http://stackoverflow.com/a/29902447
type: AnsweredQuestion
downvote count: 0
linked to: http://stackoverflow.com/q/2837741
has comment: http://stackoverflow.com/comment/47924115
tagged with: scroll
has answer: http://stackoverflow.com/a/29902447
type: Question
tagged with: mousewheel
possible better answer: http://stackoverflow.com/a/29901541
tagged with: javascript
has comment: http://stackoverflow.com/comment/47923989
has comment: http://stackoverflow.com/comment/47924190
has comment: http://stackoverflow.com/comment/47923799
score: 9
answer count: 2
linked to: http://stackoverflow.com/q/8189840

http://stackoverflow.com/comment/48121726
comment on: http://stackoverflow.com/a/29986723
has text: i had to swap the returns of the sort function, but nevertheless, your answer was the simplest and did what i wanted to, thank you
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/47915530
type: Comment
type: QuestionComment
has text: There's a way to know absolutely for a given use case: Measure it.
score: 2
comment on: http://stackoverflow.com/q/29896225

http://stackoverflow.com/comment/47870587
score: 0
has text: @SLaks, that's the problem, I wish I could explicitly terminate, but throwing from inside a promise handler execution context all exceptions get caught and explicit termination is not possible, or at least I don't know how to do it
comment on: http://stackoverflow.com/q/29872725
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47988889
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29930382
has text: If I understand correctly, you just want to exclude all links that start with a hash symbol? If that's what you want then I've edited my answer to be correct. If there is a different pattern you are searching for, let me know and I can provide a regex solution.

http://stackoverflow.com/a/38798104
upvote count: 0
answers question: http://stackoverflow.com/q/29964035
score: -1
has body: Try this: var getPasswordValue = function getPasswordValue(inputEl){ inputEl.type = "text"; var value = inputEl.value; inputEl.type = "password"; return value; };
downvote count: 1
type: Answer

http://stackoverflow.com/q/29970008
tagged with: passport.js
has answer: http://stackoverflow.com/a/29970694
has title: express.js static html with get
favorite count: 0
type: UnansweredQuestion
tagged with: node.js
has comment: http://stackoverflow.com/comment/48060722
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/48059954
has body: On the front page of my app, the user can register an account and then login. It is expressed as a login and register button on the front page which then show the appropriate form when either are clicked. I would like to replace the two buttons with a log out button if the user is already logged in but I need to inform the client of that first. In my index.js, I am serving static html like so app.use(express.static('public')); I thought I could then do the following app.get('/', function(req, res) { // inform the client if req.user isn't null }); but the callback is never called
type: Question
tagged with: javascript
tagged with: express
has answer: http://stackoverflow.com/a/29972320
answer count: 2
tagged with: passport-local
upvote count: 1
has comment: http://stackoverflow.com/comment/48060615

http://stackoverflow.com/comment/47887208
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29881347
has text: @AydIn don;t sure vimeo has such feature or not

http://stackoverflow.com/comment/47911401
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29894158
score: 0
has text: The code in your question would work (other than the syntax issue that Adam referred to). Look in your browser console for errors, double-check that your code doesn't have the typo(s) above, etc.

http://stackoverflow.com/a/29850646
has comment: http://stackoverflow.com/comment/47828507
has comment: http://stackoverflow.com/comment/47831964
upvote count: 2
type: Answer
has comment: http://stackoverflow.com/comment/47830560
has comment: http://stackoverflow.com/comment/47833854
has comment: http://stackoverflow.com/comment/47828164
has comment: http://stackoverflow.com/comment/47833828
has comment: http://stackoverflow.com/comment/47833418
accepted answer of: http://stackoverflow.com/q/29850351
answers question: http://stackoverflow.com/q/29850351
has comment: http://stackoverflow.com/comment/47827615
has comment: http://stackoverflow.com/comment/47827492
has body: you have 2 options. Option 1: When you execute this piece of code foreach ($listaGrupo as $value) { $html .= '&lt;option value="' . $value['ProcuraProdutoPedOnline']['cd_familia'] . '-' . $value['ProcuraProdutoPedOnline']['cd_depto'] . '-' . $value['ProcuraProdutoPedOnline']['cd_grupo'] . '-' . $value['ProcuraProdutoPedOnline']['cd_grupo_sub'] . '*' . strtoupper(utf8_encode($value['ProcuraProdutoPedOnline']['ds_grupo'] . '-' . $value['ProcuraProdutoPedOnline']['ds_grupo_sub'] . '-' . $value['ProcuraProdutoPedOnline']['ds_depto'])) . '"&gt;' . strtoupper(utf8_encode($value['ProcuraProdutoPedOnline']['ds_grupo'] . '/' . $value['ProcuraProdutoPedOnline']['ds_grupo_sub'] . '/' . $value['ProcuraProdutoPedOnline']['ds_depto'])) . '&lt;/option&gt;'; } you can add selected to the option for the value you want (or the last one) example: foreach ($listaGrupo as $value) { if($value == whatYouWant) { $html .= '&lt;option selected value="' . $value['ProcuraProdutoPedOnline']['cd_familia'] . '-' . $value['ProcuraProdutoPedOnline']['cd_depto'] . '-' . $value['ProcuraProdutoPedOnline']['cd_grupo'] . '-' . $value['ProcuraProdutoPedOnline']['cd_grupo_sub'] . '*' . strtoupper(utf8_encode($value['ProcuraProdutoPedOnline']['ds_grupo'] . '-' . $value['ProcuraProdutoPedOnline']['ds_grupo_sub'] . '-' . $value['ProcuraProdutoPedOnline']['ds_depto'])) . '"&gt;' . strtoupper(utf8_encode($value['ProcuraProdutoPedOnline']['ds_grupo'] . '/' . $value['ProcuraProdutoPedOnline']['ds_grupo_sub'] . '/' . $value['ProcuraProdutoPedOnline']['ds_depto'])) . '&lt;/option&gt;'; continue; } $html .= '&lt;option value="' . $value['ProcuraProdutoPedOnline']['cd_familia'] . '-' . $value['ProcuraProdutoPedOnline']['cd_depto'] . '-' . $value['ProcuraProdutoPedOnline']['cd_grupo'] . '-' . $value['ProcuraProdutoPedOnline']['cd_grupo_sub'] . '*' . strtoupper(utf8_encode($value['ProcuraProdutoPedOnline']['ds_grupo'] . '-' . $value['ProcuraProdutoPedOnline']['ds_grupo_sub'] . '-' . $value['ProcuraProdutoPedOnline']['…
has comment: http://stackoverflow.com/comment/47834228
has comment: http://stackoverflow.com/comment/47831339
score: 2
has comment: http://stackoverflow.com/comment/47827415
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/47831658
has comment: http://stackoverflow.com/comment/47830989

google-oauth
type: Tag
tags question: http://stackoverflow.com/q/29920336
tags question: http://stackoverflow.com/q/29886809
tags question: http://stackoverflow.com/q/29858865
tag name: google-oauth
tags question: http://stackoverflow.com/q/29930271

http://stackoverflow.com/comment/48099848
score: 0
comment on: http://stackoverflow.com/q/29990245
type: Comment
type: QuestionComment
has text: `else{return str.slice(0,num-3)+'…';}`?

http://stackoverflow.com/comment/47991435
comment on: http://stackoverflow.com/q/29934688
score: 0
has text: I think he means command in the title.
type: QuestionComment
type: Comment

http://stackoverflow.com/q/29992428
type: Question
accepted answer: http://stackoverflow.com/a/29992727
has body: I am trying to rotate my SVG image along its axis, which I can successfully do with the following code: &lt;animateTransform attributeName="transform" type="rotate" from="120 262.5 125" to="0 262.5 125" begin="2s" dur="2s" repeatCount="indefinite" /&gt; My question is whether or not there is a way to deal the restart of the animation by a second or two. With repeatCount set to indefinite, it immediately restarts it. Thanks in advance! UPDATE I have tried the code given below, but it didn't quite work the way I needed it to. It needs to rotate around the svg's central axis, but pause for about a second before restarting. Any ideas? FINAL UPDATE On the off chance that anyone sees this in the future searching for this issue, I'll provide what I was able to do to get it to work. By adding an id, changing the begin time and the repeatCount, I was successfully able to get a repetitive rotation with a delay in between. Here's the code: &lt;animateTransform id="rotation" attributeName="transform" type="rotate" from="120 262.5 125" to="0 262.5 125" begin="2+rotation.end+2" dur="2s" repeatCount=1 /&gt;
tagged with: javascript
tagged with: image
answer count: 1
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/127500700
tagged with: http://stackoverflow.com/tag/svg
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion
has title: Is there a way to delay the restart in SVG animateTransform
score: 1
linked to: http://stackoverflow.com/q/31690880
has answer: http://stackoverflow.com/a/29992727
upvote count: 1

http://stackoverflow.com/comment/47922329
type: QuestionComment
comment on: http://stackoverflow.com/q/29897540
has text: Post your server code and I'll show you.
score: 0
type: Comment

http://stackoverflow.com/q/29936971
has title: find a value inside array of JSON object
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/29937906
answer count: 5
possible better answer: http://stackoverflow.com/a/29937906
accepted answer: http://stackoverflow.com/a/29937164
has answer: http://stackoverflow.com/a/29937939
downvote count: 2
has answer: http://stackoverflow.com/a/29937661
has answer: http://stackoverflow.com/a/29938349
upvote count: 17
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json
score: 15
has body: I get below Array of JSON objects from JSP "Titles":[ { "Book3" : "BULLETIN 3" } , { "Book1" : "BULLETIN 1" } , { "Book2" : "BULLETIN 2" } ] On JS side, it is parsed and I see an array with 3 objects. Now, I want to find/identify a value when I pass String key. For e.g. when I pass "Book2" I should get value "BULLETIN 2". Can someone help me identify the approach?
type: Question
has answer: http://stackoverflow.com/a/29937164

http://stackoverflow.com/q/29856674
has comment: http://stackoverflow.com/comment/47840152
has comment: http://stackoverflow.com/comment/47839818
has comment: http://stackoverflow.com/comment/47886299
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47886197
has title: Replace a select dropdown with images
score: 0
has answer: http://stackoverflow.com/a/29856804
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47886585
has comment: http://stackoverflow.com/comment/47886902
has comment: http://stackoverflow.com/comment/47887084
has answer: http://stackoverflow.com/a/29857030
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47839339
has body: I'm looking to replace a select dropdown with images. My current code for the drop down is Class IV MOT (Up to 3,000KG) Class VII MOT (3,000KG - 3,500KG) Which is generated by this code: $s .= ' '; $s .= ' '; $s .= ' '; $s .= $select; $s .= ' '; $s .= ' '; $s .= ' '; if ( $services ) { foreach ( $services as $service ) { $service_description = ''; // Check if this is the first service, so it would be displayed by default if ( $service->ID == $appointments->service ) { $d = ''; $sel = ' selected="selected"'; } else { $d = ' style="display:none"'; $sel = ''; } // Add options $s .= ' ID.'"'.$sel.'>'. stripslashes( $service->name ) . ' '; } } $s .= ' '; $s .= ' '; $s .= ' '; $s .= ' '; And I really want an image of a car as value 1 and a van as value 2, plus I really want it to submit on click rather than having the button. Is it possible to replace the dropdown with images instead or would I need to use a radio button, then style it using an image? You can see my current dropdown in use here
has comment: http://stackoverflow.com/comment/47886639
linked to: http://stackoverflow.com/q/9508029
has comment: http://stackoverflow.com/comment/47886569
has comment: http://stackoverflow.com/comment/47886929
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/47886667

express
tags question: http://stackoverflow.com/q/29873557
tags question: http://stackoverflow.com/q/29998843
tags question: http://stackoverflow.com/q/29988569
tags question: http://stackoverflow.com/q/29906113
tags question: http://stackoverflow.com/q/29983140
tags question: http://stackoverflow.com/q/29999972
tags question: http://stackoverflow.com/q/29854405
tags question: http://stackoverflow.com/q/29934726
tags question: http://stackoverflow.com/q/29877172
tags question: http://stackoverflow.com/q/29987732
tags question: http://stackoverflow.com/q/29896589
tags question: http://stackoverflow.com/q/29960154
tags question: http://stackoverflow.com/q/29851567
tags question: http://stackoverflow.com/q/29896322
tags question: http://stackoverflow.com/q/29941208
tags question: http://stackoverflow.com/q/29986406
tags question: http://stackoverflow.com/q/29893735
tags question: http://stackoverflow.com/q/29987847
tags question: http://stackoverflow.com/q/29926502
tags question: http://stackoverflow.com/q/29998921
tags question: http://stackoverflow.com/q/29886339
tags question: http://stackoverflow.com/q/29860848
tags question: http://stackoverflow.com/q/29871858
tags question: http://stackoverflow.com/q/29858896
tags question: http://stackoverflow.com/q/29853333
tags question: http://stackoverflow.com/q/29949701
tags question: http://stackoverflow.com/q/29860835
tags question: http://stackoverflow.com/q/29999500
tags question: http://stackoverflow.com/q/29909006
tags question: http://stackoverflow.com/q/29906382
tags question: http://stackoverflow.com/q/29913499
tags question: http://stackoverflow.com/q/29926648
tags question: http://stackoverflow.com/q/29942304
tags question: http://stackoverflow.com/q/29867547
tags question: http://stackoverflow.com/q/29908780
tags question: http://stackoverflow.com/q/29970008
tags question: http://stackoverflow.com/q/29857555
tags question: http://stackoverflow.com/q/29873732
tags question: http://stackoverflow.com/q/29979529
tags question: http://stackoverflow.com/q/29921272
tags question: http://stackoverflow.com/q/29888978
tags question: http://stackoverflow.com/q/29853488
tags question: http://stackoverflow.com/q/29917462
tags question: http://stackoverflow.com/q/29960326
tag name: express
tags question: http://stackoverflow.com/q/29880721
tags question: http://stackoverflow.com/q/29876253
tags question: http://stackoverflow.com/q/29854492
tags question: http://stackoverflow.com/q/29928953
type: Tag
tags question: http://stackoverflow.com/q/29958747
tags question: http://stackoverflow.com/q/29998595
tags question: http://stackoverflow.com/q/29962949
tags question: http://stackoverflow.com/q/29992402
tags question: http://stackoverflow.com/q/29882601
tags question: http://stackoverflow.com/q/29872443
tags question: http://stackoverflow.com/q/29966467

react-rails
type: Tag
tag name: react-rails
tags question: http://stackoverflow.com/q/29919328

http://stackoverflow.com/comment/48311216
has text: please check my answer and reply
score: 1
comment on: http://stackoverflow.com/q/30001920
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29977842
downvote count: 0
type: Answer
has body: String objects are immutable, which means you can't directly change their values. I'm sure there are better ways you can do it, but one simple way is to just create a second variable and keep adding to it as you go along.
has comment: http://stackoverflow.com/comment/48075670
upvote count: 1
accepted answer of: http://stackoverflow.com/q/29977749
answers question: http://stackoverflow.com/q/29977749
score: 1
type: AcceptedAnswer

http://stackoverflow.com/comment/48082257
comment on: http://stackoverflow.com/a/29936036
type: AnswerComment
score: 0
type: Comment
has text: Yes, I see that one is angular strap. Just extend the u-bootstrap one then. If you compare the docs for extending with the angular strap one, it looks pretty easy to do: https://github.com/networknt/angular-schema-form-datetimepicker/blob/master/src/schema-form-datetimepicker.js Install the ui-bootstrap one and create your extension module.

http://stackoverflow.com/q/29922807
has answer: http://stackoverflow.com/a/29923541
accepted answer: http://stackoverflow.com/a/29923541
has comment: http://stackoverflow.com/comment/47968082
type: Question
has body: I am kind of new to javascript and trying to accomplish a simple (yet complicated for me) task. I am trying to exclude first row and first column from a table and got stuck in excluding first cell in every row from this table (HTMLTableRowElement). Following is my sample code. function clickSchedule(){ var table var grow // group row table= document.getElementById("myTable"); grow = table.rows; for(var i= 1; i&lt;= grow.length ; i++ ){ var cellIndex = this.cells; for( var j =1 ; j&lt;= cellIndex.length ; j++ ){ this.onclick = function () { alert("test"); } } } The first "for loop" will grab all rows from the table excluding row[0] that is why you can see var i = 1. Next, I am storing cells from all rows to a variable and trying to exclude cell[0] using second "for loop" in order to perform an onclick event to the selected table area. Also, is it possible to get the index value of the selected cell from this table? I would really appreciated your help Faraz Amjad
answer count: 1
tagged with: javascript
has title: Excluding first cell in HTMLTableRowElement
score: 0
has comment: http://stackoverflow.com/comment/47967681
has comment: http://stackoverflow.com/comment/47968206
linked to: http://stackoverflow.com/q/3065342
has comment: http://stackoverflow.com/comment/47968171
type: AnsweredQuestion

http://stackoverflow.com/q/29867314
has body: I am testing a react based grid component by mocha and jsdom. There is an options button on the grid which on mouseDown generates a popup within the grid. Now I can simulate the mouseDown by TestUtils.Simulate and also verified that the function is getting called, but I am unable to get the class of the generated popup by TestUtils.scryRenderedDOMComponentsWithClass. The popup does not fade away untill the user clicks outside of the grid. What should be the approach? Is there is any way I can print the jsdom markup so that I can inspect further?
type: Question
tagged with: reactjs
has comment: http://stackoverflow.com/comment/47930692
tagged with: javascript
tagged with: mocha.js
score: 0
has comment: http://stackoverflow.com/comment/47881489
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47879192
tagged with: jsdom
answer count: 0
has comment: http://stackoverflow.com/comment/47942473
has title: React Testing by jsdom - unable to get a class which is dynamically inserted into dom

http://stackoverflow.com/q/29857327
upvote count: 1
has answer: http://stackoverflow.com/a/29857409
has answer: http://stackoverflow.com/a/29857400
tagged with: arrays
duplicate of: http://stackoverflow.com/q/8495687
has body: I have an example data set. I want to push this data into an array with a subarray for every 16 pieces of data. I got started, but am stuck. Any ideas? [ [16 names], [16 names ], [16 names] ]; // This is the output I want. var data = ["Michael", "Marc", "John", "David", "Nick", "Mom", "Al", "Marlana", "Max", "Scooter", "Pat", "George", "Lynne", "Tatyana", "Kim", "Kerry", "Enza", "Matt", "Liz", "Linda", "Ryan", "Ed", "Frank", "Christine", "Bill", "Jack", "Jill", "Joe", "Harry", "Red", "Fred", "Iggy", "Brian", "Bob", "Paul", "Gil", "Damian", "Kip", "Phil", "Curtis", "Aly", "Richard", "Robin", "Grant", "Ian", "Raptor", "T-Rex", "Stegosaurux", "Triceratops", "Compy"] var sixteengroup = []; for (var i = 0; i &lt; data.length; i++){ if (i % 16 == 0) sixteengroup.push([i]) } console.log(sixteengroup);
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/47840576
score: 0
linked to: http://stackoverflow.com/q/8495687
answer count: 5
has answer: http://stackoverflow.com/a/29857417
has title: JavaScript: How to push data in array, into subarrays with an array for each 16 items
downvote count: 1
accepted answer: http://stackoverflow.com/a/29857417
has answer: http://stackoverflow.com/a/29857475
type: AnsweredQuestion
tagged with: nested-loops
has comment: http://stackoverflow.com/comment/47840619
has answer: http://stackoverflow.com/a/29857542
type: Question
possible better answer: http://stackoverflow.com/a/29857475

http://stackoverflow.com/comment/47854630
comment on: http://stackoverflow.com/q/29864588
has text: In order to compare, you have to know at least on a basic level what Angular JS is. That's not something you learn in a couple of hours. I think that at the very least the question is not well defined. At least you need to ask him for some parameters.
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/47833059
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29853178
has text: I suppose one improvement would be making it easier to add the same methods to more than one class, like `function add_methods(MyClass){the second code block here}`.

http://stackoverflow.com/q/29867001
has comment: http://stackoverflow.com/comment/47859005
score: 2
answer count: 1
downvote count: 0
favorite count: 0
type: UnansweredQuestion
has body: I just started to use a pre-commit hook in a project, in that script I run some grunt tasks like jshint and jsbeautifier. The thing is that jsbeautifier does modify the files, so when it does, I have to restage the modified files. Would it be possible to only have to stage those files only once?
has title: Modifying files in pre-commit hook without having to restage them
tagged with: git
upvote count: 2
has answer: http://stackoverflow.com/a/29868021
type: Question
linked to: http://stackoverflow.com/q/2855140
tagged with: githooks
has comment: http://stackoverflow.com/comment/47860327
tagged with: javascript
tagged with: gruntjs

http://stackoverflow.com/q/29958424
type: UnansweredQuestion
upvote count: 1
score: 1
tagged with: firefox-developer-tools
type: Question
has body: I set two breakpoint as the following screenshot shows, then I click the example plugin, to my surprised, the debugger seems to just ignore these two breakpoints, why? Is that debuggabe for the initialization code of jetpack plugin? This question is a bit related to Why the addone button is lost when I enable panel code?, I set this breakpoint in order to know what is in require ("sdk/panel").data debug from addone manager
linked to: http://stackoverflow.com/q/29710818
has answer: http://stackoverflow.com/a/29996518
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
has title: Why I cannot set breakpoint at some of the jetpack code?
tagged with: firefox-addon
tagged with: firefox-addon-sdk

http://stackoverflow.com/a/29855029
score: 2
upvote count: 2
has body: When clicking on the submit button, check the fields before you let the user continue, and if they are incorrect, return false; so the submit button won't refresh the page. Then just use yourelement.style.backgroundColor = "red"; on all the wrong elements.
has comment: http://stackoverflow.com/comment/47838471
has comment: http://stackoverflow.com/comment/47838674
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/29854402
type: Answer
accepted answer of: http://stackoverflow.com/q/29854402

http://stackoverflow.com/q/29848678
favorite count: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/29848855
has comment: http://stackoverflow.com/comment/47823716
has comment: http://stackoverflow.com/comment/47823362
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47823598
tagged with: vb.net
downvote count: 1
accepted answer: http://stackoverflow.com/a/29848855
type: Question
has title: Resize image, need a good library
upvote count: 5
tagged with: javascript
linked to: http://stackoverflow.com/q/18922880
has body: First of all - The problem I am developing a web application that enables the user to take a picture with their smartphone, tablet or just browse for a picture on their pc. I need to upload this file to my database, which is working perfectly IF the picture is small enough. After experimenting a bit with certain photos, I found out that a smartphone takes a picture with a size of at least 1MB and this is way to big too upload to my database. The uploading goes as following: 1. Convert the image to a Base64 encoded string. 2. Send the string in an array (contains string in pieces) to WebAPI 3. Join the strings into one and convert this into byte array. I noticed that if a file is around 70-90kb, this would be the maximum size of a file that can be inserted in the database. The moment I have a file that is bigger then 100kb, the inserting fails. So I am searching for a good resizing library to resize the picture that was chosen. I don't know if this is even possible, but everything has to be done client-side. Technology I am using Javascript/jQuery and AngularJS for the client side and VB.NET for my WebAPI. This is because I'm doing an internship and don't have another choice to use VB.NET. But this has nothing to do with the issue, I just need to find a way to compress/resize/minimize the chosen file, so this can be uploaded to the database. The upload is happening via the $http.post() from AngularJS. If someone could advice a library, care to help a fellow programmer out with some basic example code? I mostly have trouble figuring out how to use a plugin or library, because I'm quite new to all this. And I would appreciate it if you guys could provide me with at least some information to get me on track. Thanks in advance! Sorry that I couldn't provide any code or something other, it's more an informative question than a coding problem. This might popup when I have a library that I can use. Also, if there are any remarks, I'll consider them, because I have a deadlin…
score: 4
tagged with: image
answer count: 1
has comment: http://stackoverflow.com/comment/47823521
tagged with: jquery

http://stackoverflow.com/q/29934209
tagged with: javascript
has answer: http://stackoverflow.com/a/29935280
downvote count: 0
answer count: 1
tagged with: passport.js
favorite count: 0
has comment: http://stackoverflow.com/comment/63399080
type: UnansweredQuestion
has body: Working with Google contacts API using Node.js I am getting all the contacts except images by Google feed API https://www.google.com/m8/feeds/photos/media/faizy04%40gmail.com/ya29.ZAFTNcQ6sEue40gFqH5h8h91k8LO8Bwvf50NUgQKKmsD5fipWg9XvN5GeHmyref_TK1xJZVrB9Ubuw For getting contacts I have passed the following scope with passport.js passport.authenticate('google', { scope : ['profile', 'email','https://www.google.com/m8/feeds'] }) everything is working fine. Now I want to get all the images of related contacts. Do I need to pass something else with parameter in scope variable Or Need to send another GET request for that?
tagged with: google-contacts-api
linked to: http://stackoverflow.com/q/5983484
tagged with: node.js
score: 1
upvote count: 1
type: Question
has title: How to get Google contact images with Google contacts API?

http://stackoverflow.com/comment/48033288
has text: 2 files in same folder: *index.html* (contents: ` Demo Buy tomorrow. `) and *myscript.js* (contents: `function showname(el) { el.value = el.name; }`) works perfectly. You probably didn't post all relevant code.
type: QuestionComment
comment on: http://stackoverflow.com/q/29955986
score: 0
type: Comment

http://stackoverflow.com/comment/47980906
score: 0
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/29929004
has text: I saw the code but there is no much detail of how to re fetch the data from the DATABASE..As you recommended, In many pages i saw some mentioning of explode and implode but i couldn't understand it ,can you help?

http://stackoverflow.com/a/29908651
accepted answer of: http://stackoverflow.com/q/29908617
score: 4
answers question: http://stackoverflow.com/q/29908617
has comment: http://stackoverflow.com/comment/47939872
has comment: http://stackoverflow.com/comment/48087977
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/48087537
has body: When you cast splice method on an array, its length is updated immediately. Thus, in future iterations, you will probably jump over some of its members. For example: var arr = ['a','b','c','d','e','f','g'] for(var i = 0; i &lt; arr.length; i++) { console.log(i, arr) if(i%2 === 0) { arr.splice(i, 1) // remove elements with even index } } console.log(arr) It will output: 0 ["a", "b", "c", "d", "e", "f", "g"] 1 ["b", "c", "d", "e", "f", "g"] 2 ["b", "c", "d", "e", "f", "g"] 3 ["b", "c", "e", "f", "g"] 4 ["b", "c", "e", "f", "g"] ["b", "c", "e", "f"] My suggestion is, do not modify the array itself if you still have to iterate through it. Use another variable to save it. var arr = ['a','b','c','d','e','f','g'] var another = [] for(var i = 0; i &lt; arr.length; i++) { if(i%2) { another.push(arr[i]) // store elements with odd index } } console.log(another) // ["b", "d", "f"] Or you could go with Array.prototype.filter, which is much simpler: arr.filter(function(el, i) { return i%2 // store elements with odd index }) It also outputs: ["b", "d", "f"]
type: Answer
upvote count: 4
has comment: http://stackoverflow.com/comment/47939818
has comment: http://stackoverflow.com/comment/47941497
downvote count: 0
has comment: http://stackoverflow.com/comment/47940314
has comment: http://stackoverflow.com/comment/48087730

http://stackoverflow.com/comment/47860170
type: Comment
has text: @bryan You're pretty much always going to be cycling one way or another. Computers can cycle through thousands of entries incredibly quickly these days so I wouldn't worry about speed
type: AnswerComment
comment on: http://stackoverflow.com/a/29867639
score: 0

http://stackoverflow.com/q/29872641
downvote count: 0
answer count: 1
score: 1
favorite count: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/29872657
type: AnsweredQuestion
upvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/29872657
tagged with: javascript
has title: angular tutorial not working on fiddle
has body: I've been reading the angularjs tutorials on tutorialspoint.com and I've been testing things that I learn on jsfiddle. The first few things I tried worked, like ng-model and ng-bind. But this was all with an empty ng-app (ng-app=""). However, now I'm trying to make an app and a controller, but its not working. Heres the fiddle How do I fix this code? I've done exactly as the tutorial says. I just noticed when inspecting the page I get the following error: Error: [$injector:modulerr] Failed to instantiate module myapp due to: [$injector:nomod] Module 'myapp' 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. First Last {{ person.fullname() }} var myapp = angular.module("myapp", []); myapp.controller('appController', function($scope) { $scope.person = { firstname: "one", lastname: "two", fullname: function() { var personobject; personobject = $scope.person; return personobject.firstname + " " + personobject.lastname; } }; });

http://stackoverflow.com/q/29923949
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29925895
has answer: http://stackoverflow.com/a/29924289
type: Question
has comment: http://stackoverflow.com/comment/47969711
tagged with: javascript
tagged with: jquery
score: 0
has title: jQuery - Adding increasing number to image for each click
answer count: 3
possible better answer: http://stackoverflow.com/a/29924125
has body: I need to create a notification counter for my app. For now, I want to add an increasing number on top of an image for each button click. How can this be achieved using jQuery? JSfiddle HTML: click this CSS: .show_notif{ visibility: hidden; } JS: var counter=0; $( "#kick_button" ).click(function() {$("#header_bell_notificator").removeClass("show_notif"); });
has answer: http://stackoverflow.com/a/29924125
has answer: http://stackoverflow.com/a/29925895
has comment: http://stackoverflow.com/comment/47969888
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47969791
tagged with: css

http://stackoverflow.com/comment/48009913
has text: You want here to use referenced function, so remove parentheses. Otherwise, you are using as handler the result returned by function, which here is undefined
comment on: http://stackoverflow.com/q/29944122
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/47933971
comment on: http://stackoverflow.com/q/29905553
type: QuestionComment
type: Comment
has text: Try out bootstrap framework. This has everything you want.
score: 1

http://stackoverflow.com/a/29948416
score: 3
has comment: http://stackoverflow.com/comment/48017713
has body: Since you're using jQuery you can (and should) remove the inline event handling and just use: $( document ).ready(function() { $('.navitem').click(function(){ var bgString = "url('navbuttonpressed.png')"; $(this).css('backgroundImage',bgString); }) }); jsFiddle example
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/29948325
upvote count: 3
has comment: http://stackoverflow.com/comment/48017744
has comment: http://stackoverflow.com/comment/48017678

http://stackoverflow.com/comment/48083119
score: 0
comment on: http://stackoverflow.com/q/29981713
type: QuestionComment
type: Comment
has text: Your code works as you described. "Cookie Value: b"

http://stackoverflow.com/a/29984611
type: Answer
has body: First, why doesn't your answer work: var Cookies; { if (navigator.cookieEnabled) { Cookies = "True"; } else { Cookies = "False"; } } // you're over-writing your found Cookies variable with // the value of Cookie, which you haven't assigned and // is therefore retrieved from the browser, in most (perhaps all) // browsers if an element with this id exists (as it does, here) // the uninitialised variable will be a reference to that Node // otherwise (if not initialised) it'll be undefined. var Cookies = Cookie; window.onload = function() { // here you're correctly attempting to assign the variable, // but it's the wrong variable: document.getElementById("Cookie").innerHTML = Cookies; // here you should be, but aren't, closing the assignment of the // window.onload function. Your corrected code (removing (apparently) unnecessary curly braces, a needless variable-assignment and closing the function properly: //Cookies enabled var Cookies; if (navigator.cookieEnabled) { Cookies = "True"; } else { Cookies = "False"; } window.onload = function() { document.getElementById("Cookie").innerHTML = Cookies; }; Cookies Enabled: //Cookies enabled window.onload = function() { document.getElementById("Cookie").innerHTML = navigator.cookieEnabled; }; Cookies Enabled:
upvote count: 1
accepted answer of: http://stackoverflow.com/q/29984446
score: 1
answers question: http://stackoverflow.com/q/29984446
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/a/29969822
type: Answer
has comment: http://stackoverflow.com/comment/48060120
has body: Why shouldn't it be possible with Excel Builder? Just a few seconds of googl'ing... Creating Worksheets: http://excelbuilderjs.com/cookbook/creatingWorksheet.html Fonts and Colors: http://excelbuilderjs.com/cookbook/fontsAndColors.html Theming Tables: http://excelbuilderjs.com/cookbook/themingTables.html All you need and more, isn't it? Or do you want others to do the work for you?
accepted answer of: http://stackoverflow.com/q/29969136
score: 0
answers question: http://stackoverflow.com/q/29969136
has comment: http://stackoverflow.com/comment/48061609
type: AcceptedAnswer

http://stackoverflow.com/comment/48155447
type: Comment
type: QuestionComment
has text: @wergeld, this is based on dynamic data. Sometimes there is a big gap that makes the chart messy.
comment on: http://stackoverflow.com/q/29947062
score: 0

http://stackoverflow.com/comment/47823211
type: QuestionComment
comment on: http://stackoverflow.com/q/29848011
score: 0
has text: Why you name variables in a soooooo weird fashion?
type: Comment

http://stackoverflow.com/a/29994458
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29993835
has comment: http://stackoverflow.com/comment/48108578
has comment: http://stackoverflow.com/comment/48110046
answers question: http://stackoverflow.com/q/29993835
has body: Try // elements var elems = $("[data-order]"); // ordering map var elArray = ["3", "1", "2"]; // replace `elems` `outerHTML` $.map(elArray, function(order, i) { var el = elems.filter(function() { // ie < 11 does not appear to support `dataset` // jQuery `.data()` appear to cast `String` "3" to `Number` `3` // utilize equality operator `==` to convert operands return $(this).data("order") == order }); elems.eq(i)[0].outerHTML = el[0].outerHTML }); content here 1 content here 3 content here 2 jsfiddle http://jsfiddle.net/saf77L4w/4/
has comment: http://stackoverflow.com/comment/48110535
type: Answer
has comment: http://stackoverflow.com/comment/48110288
score: 0
has comment: http://stackoverflow.com/comment/48108801

http://stackoverflow.com/a/29966227
answers question: http://stackoverflow.com/q/29965937
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29965937
type: Answer
upvote count: 1
has body: You can use an array like this : var data = [{ "value": "008-408-601-000"}, { "value": "002-408-641-000"}, {"value": "001-002-003-000" }]; var valueTab = []; $.each(data, function( index, obj ) { valueTab.push(obj.value); }); console.log(valueTab.join(", ")); $("#spanid").html(valueTab.join(", "));
score: 1

http://stackoverflow.com/comment/48046132
type: AnswerComment
has text: I need each, because I need to grab each input value and put it in another div, since on PDF I need the quantity of the products. But thanks for info, because I will need to remove some helper divs, from which I don't need to keep any data ;)
type: Comment
comment on: http://stackoverflow.com/a/29962372
score: 1

http://stackoverflow.com/q/29870899
tagged with: sails.io.js
tagged with: node.js
has comment: http://stackoverflow.com/comment/47878652
type: AnsweredQuestion
has title: Keeping a client-side sync of Sails.js collection, using sockets
downvote count: 0
tagged with: socket.io
upvote count: 8
type: Question
tagged with: sails.js
has answer: http://stackoverflow.com/a/30100428
has body: I very much like Meteor's pub/sub. I wonder if there is a way to get a similar workflow, using sails.js or just a socket library in general. In particular, what I would like to be able to do is something along the lines of: // Server-side: App.publish('myCollection', -&gt; collection.find({})) // Client-side: let myCollection = App.subscribe('myCollection') let bob = myCollection.find({name: 'Bob'}) myCollection.insert({name: 'Amelie'}, callback) All interaction with the server should happen in the background.
accepted answer: http://stackoverflow.com/a/30100428
tagged with: javascript
possible better answer: http://stackoverflow.com/a/35800535
has answer: http://stackoverflow.com/a/35800535
answer count: 2
linked to: http://stackoverflow.com/q/45431466
score: 8
favorite count: 0

http://stackoverflow.com/q/29913916
has comment: http://stackoverflow.com/comment/47966069
downvote count: 0
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
score: 2
favorite count: 0
type: Question
upvote count: 2
answer count: 1
has answer: http://stackoverflow.com/a/40603289
has body: jquery validation engine scroll: false is working fine without 'validate' like below... jQuery('#form').validationEngine({scroll: false}); But not working if I put like this. jQuery('#form').validationEngine('validate',{scroll: false}); Actually i need validationEngine with 'validate' and 'no scroll'. any idea? Thanks.
has title: jquery validation engine scroll false not working with validate
has comment: http://stackoverflow.com/comment/68441741

http://stackoverflow.com/comment/48063491
has text: This was the closest to what I needed. Fantastic work. To illustrate what I meant by the icons, I've added the following: https://jsfiddle.net/qfd64soL/
comment on: http://stackoverflow.com/a/29960481
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/29972752
type: Answer
has body: It's an OR condition if (tagObjects != "empty" || tagObjects.length === 0) { If it's not the string "empty" OR if it has no length, continue. In other words the length doesn't matter if the Array is not the string "empty", which it probably always is if it's an array ? Also, you're accessing tagObjects.tags which suggest it's neither a string nor an array, but an object, and objects don't have length. In other words, your if condition makes no sense at all ? if (tagObjects != "empty" &amp;&amp; tagObjects.length === 0) {
downvote count: 0
score: 7
accepted answer of: http://stackoverflow.com/q/29972722
answers question: http://stackoverflow.com/q/29972722
upvote count: 7
type: AcceptedAnswer

http://stackoverflow.com/q/30000540
tagged with: regex
has title: How can I make a regular expression that contains special characters, like word boundaries, with a variable?
upvote count: 1
has body: In Javascript, I am trying to write a regular expression that will match a word that is contained in a variable, but only when the word is a whole word. I wanted to do this by using word boundaries, like this: var data = 'In this example of data, word has to be replaced by suggestion, but newword must not be replaced'; var item = {word: 'exampleWord', suggestion: 'suggestion'} var word = "\b"+item.word+"\b"; var suggestion = item.suggestion; var re = new RegExp(word, "gi"); data = data.replace(re, suggestion); However, constructing a regular expression in this fashion apparently does not work. Can anyone suggest a way to construct this regular expression containing the variable and the word boundaries?
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/3561493
accepted answer: http://stackoverflow.com/a/30000554
tagged with: javascript
type: Question
answer count: 1
downvote count: 0
score: 1
favorite count: 0
has answer: http://stackoverflow.com/a/30000554

http://stackoverflow.com/comment/47966492
has text: Thanks for your solution! If there is specific function for these, I would be better.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29911481

http://stackoverflow.com/q/29988570
has comment: http://stackoverflow.com/comment/48096472
has comment: http://stackoverflow.com/comment/48096555
has comment: http://stackoverflow.com/comment/48096475
answer count: 0
tagged with: http://stackoverflow.com/tag/json
duplicate of: http://stackoverflow.com/q/5874652
has title: Going crazy with jQuery and multiple checkbox set
type: Question
tagged with: javascript
score: 0
has body: Just discovered a crazy thing using jQuery and I just can't explain it. In the return of a $.getJSON, I've to unset/set some checkbox regarding to which categories are returned by the JSON. Before calling the JSON, I did : $("input[type='checkbox'][name^='category_']").each(function() { this.checked = false; }); Which works perfectly. Then, inside the result function of the getJSON, I did this: var checkedCats = data.categories.split(';'); for (i=0; i&lt;checkedCats.length; i++) { $('#category_'+checkedCats[i]).attr('checked',true); } And that works... randomly... Sometimes checking boxes, sometimes not... The craziest thing is that, when I transform this code to: var checkedCats = data.categories.split(';'); for (i=0; i&lt;checkedCats.length; i++) { var aCheckbox = document.getElementById('category_'+checkedCats[i]); aCheckbox.checked = true; } Then this code works perfectly... Is there any reason ?
linked to: http://stackoverflow.com/q/5874652
linked to: http://stackoverflow.com/q/22435346
tagged with: jquery
type: UnansweredQuestion

http://stackoverflow.com/comment/47861493
score: 2
comment on: http://stackoverflow.com/q/29867933
type: Comment
type: QuestionComment
has text: @vsync: There are dozens if not hundreds of these obscure type coercive questions. Simple answer is always the same... JS operators work on all values. Values that don't make sense are usually coerced to some other value. Referencing the ECMAScript spec is a crucial step that many people skip.

http://stackoverflow.com/a/29902847
type: Answer
has body: Do it like this: asdf What we do here is assigning the function "yourfunction()" to "onclick" of your anchor (the element). Due to the fact that your code is automatically executed when you reload the page (note that we've just posted a line of code into the script tag) you can trigger the onclick event just by using ".onclick()". However, you're executing "yourfunction()" every time you reload the page and as you click your anchor. The function itself is pretty boring. It just makes an alert (small window with a message and ok button) which says "clicked". Further reading: How can I trigger a JavaScript event click https://developer.mozilla.org/de/docs/Web/API/GlobalEventHandlers/onclick https://developer.mozilla.org/de/docs/Web/API/Window/alert Some further advice. I think you are trying to achieve a "redirection" to another site as soon as you got to a domain. You probably want to do stuff like redirecting a typo ("gogole.com") to your "real" domain (google.com). This shouldn't be done with Javascript! You have to configure your webserver to do so (it's pretty easy). See this for example. However, ther is also another approach to achieve this: Put this line of code into the of your document.
score: 0
answers question: http://stackoverflow.com/q/29902697

http://stackoverflow.com/q/29996242
answer count: 4
possible better answer: http://stackoverflow.com/a/29996347
score: 4
has answer: http://stackoverflow.com/a/29996347
has answer: http://stackoverflow.com/a/29996740
has body: I know how to check if an element contains certain text, but I need to determine if a class has certain text. I have several pages where the body will have a class like: &lt;body class="high-school-region-1"&gt; &lt;body class="middle-school-region-1"&gt; &lt;body class="elementary-school-region-1"&gt; So I need to target all classes that contain the phrase "region-1". Something like this: if ($('body').hasClass('region-1')) { // do this } But instead of hasClass, it would be more like "classContains" - which I know is not a real thing, but... is there a way to do that? Or a better way? I don't really have an easy way to inject "region-1" as its own class on each of those pages, so it seemed like this was the way to go. Thanks for your help!
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29996259
has answer: http://stackoverflow.com/a/29996470
has title: Check if a body class contains a phrase with jquery?
type: Question
upvote count: 4
downvote count: 0
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/29996259
favorite count: 0

http://stackoverflow.com/a/29957174
answers question: http://stackoverflow.com/q/29957123
score: 0
type: Answer
has body: Split the string into multiple lines, do the replacement on the first line, then rejoin them. var lines = input.split('\n'); lines[0] = lines[0].replace(/X/g, ''); input = lines.join('\n');

http://stackoverflow.com/a/29885990
has comment: http://stackoverflow.com/comment/48029884
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/29852645
has comment: http://stackoverflow.com/comment/48062655
answers question: http://stackoverflow.com/q/29852645
has comment: http://stackoverflow.com/comment/48043537
upvote count: 1
type: AcceptedAnswer
has body: According to MDN In order to load it with CORS as a WebGL texture, we set the crossOrigin attribute on it: var earthImage = new Image(); earthImage.crossOrigin = "anonymous"; Now we load it as usual: earthImage.onload = function() { // whatever you usually to do load WebGL textures }; earthImage.src = "http://khm0.googleapis.com/kh?v=95&amp;x=0&amp;y=0&amp;z=0";
type: Answer

http://stackoverflow.com/a/29864759
has body: UberKaeL is correct. update: corrected multiple problems with the code and data, e.g., the trailing comma in the data. It works now ... click the "Run Code Snippet" button. "mydata" is the problem. You are attempting to use data before the json file has loaded. That triggers the error. And mydata is not used for anything. You also need to add a DIV to hold the pie chart. The code snippet below works, but the json data is incorrect for drawing a pie chart. Correct the data and it should work for you.
has comment: http://stackoverflow.com/comment/47855482
score: 1
has comment: http://stackoverflow.com/comment/47855547
has comment: http://stackoverflow.com/comment/47855150
downvote count: 0
has comment: http://stackoverflow.com/comment/47855569
has comment: http://stackoverflow.com/comment/47855288
has comment: http://stackoverflow.com/comment/47855436
answers question: http://stackoverflow.com/q/29864178
has comment: http://stackoverflow.com/comment/47854983
has comment: http://stackoverflow.com/comment/47855239
has comment: http://stackoverflow.com/comment/47855385
has comment: http://stackoverflow.com/comment/47855025
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/47855325

http://stackoverflow.com/comment/48024699
type: Comment
has text: He already told with words whats happening, the .then is executed before all the ajax call are resolved. because he is using only the promise of the first call (That is resolved inmediatly after calling the second ajax call, but never waiting for it). he miss used my code example :/
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/29950179

http://stackoverflow.com/comment/47944792
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29907127
has text: Can you post the code for your component, please?

http://stackoverflow.com/comment/47968661
type: Comment
has text: @TrueBlueAussie your script worked well on our test server , but when i wrote the script on our live server the script raised the folloiwing error "SCRIPT5007: Unable to set property 'ListId' of undefined or null reference "
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29920842

linux
tags question: http://stackoverflow.com/q/29907870
type: Tag
tags question: http://stackoverflow.com/q/29909070
tags question: http://stackoverflow.com/q/29993531
tag name: linux
tags question: http://stackoverflow.com/q/29902347
tags question: http://stackoverflow.com/q/29881199

http://stackoverflow.com/comment/47881978
score: 0
type: AnswerComment
type: Comment
has text: @tkoomzaaskz, put it in the same line then. that's about html, not related to angular.
comment on: http://stackoverflow.com/a/29877800

http://stackoverflow.com/q/29945767
tagged with: angularjs
has answer: http://stackoverflow.com/a/29947359
type: UnansweredQuestion
tagged with: angular-promise
score: 1
upvote count: 1
has answer: http://stackoverflow.com/a/29946265
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/29946048
has title: Angular problems chaining $resource promises
answer count: 3
downvote count: 0
favorite count: 0
has body: I was trying to chain some promises for this service I have but the $stateprovider resolves without waiting for $q. This results in my controller getting back the result object with just the empty array, and the object gets filled later on. Where is my promise chain going wrong? My $stateprovider: .state('somestate', { resolve: { neededvalue: function(anotherservice) { return anotherservice.getData(); //this one works pretty well , but doesn't use any chaining }, finalvalue: function(myService, neededvalue) { return myService.startChain(neededvalue); } } } My Service: app.factory("myService", ['$resource', '$q', function ($resource, $q) { var firstApi = $resource("api/somewhere/first", {}, { "getData": { method: "POST" } }); var secondApi = $resource("api/somewhere/second", {}, { "getData": { method: "POST" } }); var result = { array: [] }; var myService = { startChain: startChain }; return myService; function startChain(someNeededValues) { var deferred = $q.defer(); firstApi .getData(someNeededValues.values).$promise .then(function (data) { result.value = data.value; }) .then(recurringAction) .then(deferred.resolve(result)); return deferred.promise; } function recurringAction() { return secondApi.getData(result.value, function (data) { angular.copy(data.array, result.array); }).$promise; } }]);

http://stackoverflow.com/comment/48036305
type: QuestionComment
comment on: http://stackoverflow.com/q/29957804
score: 0
has text: Which version of IE?
type: Comment

http://stackoverflow.com/comment/48133369
has text: @stribizhev Thank you for your input. `(=|==|<=|>=)` actually does work, I recommend you test it. Using an "unrolled" list improves legibility -- this was explained. Yes, `[=<>]=?` also matches exactly the possibilities we seek, but we should be careful not to use hard-to-read expressions because we can and it's fun, when we also value being able to easily read code. I don't think the objective is "shorter" as much as "more readable". I've had to interpret enough of my own regexes, coming back to them long after having written them, to know that being clever isn't being very clever.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29995820
score: 0

http://stackoverflow.com/comment/48066351
has text: Thank you for the answer. Could you plz specify where I should put this line because I tried this one too inside the http.request function but then I couldnt use it in the next() callback.
type: AnswerComment
comment on: http://stackoverflow.com/a/29971603
score: 0
type: Comment

http://stackoverflow.com/comment/47852499
type: Comment
has text: @appu It's right there in the answer... And you should not bind an event handler for every row, you only need one.
score: 0
comment on: http://stackoverflow.com/a/29863619
type: AnswerComment

http://stackoverflow.com/q/29901753
upvote count: 3
answer count: 2
has comment: http://stackoverflow.com/comment/47926303
has body: Consider this URL below: http://test/Preview.aspx?By=AJ_Swift&amp;Title=Meeting_Planning_&amp;_Participation From the above URL I am extracing each query string values. For the Title query string, I need to split it on symbol underscore '_' and replace/join with a space. The problem is the "&amp;". The javasript split stops right at '&amp;' and escapes everything following. var title = vars['Title'].split("_").join(" "); gives me Meeting Planning How do I split and join so I get Meeting Planning &amp; Participation
has answer: http://stackoverflow.com/a/29902266
accepted answer: http://stackoverflow.com/a/29902266
favorite count: 0
tagged with: regex
type: AnsweredQuestion
score: 3
downvote count: 0
has title: Javascript split and ampersand escaping
type: Question
has comment: http://stackoverflow.com/comment/47926137
possible better answer: http://stackoverflow.com/a/29902033
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29902033

http://stackoverflow.com/a/29939052
type: Answer
score: 1
has body: With corrected HTML structure in Vainlla JS it would be something like this (JSFiddle): var rows = document.getElementsByTagName('tbody')[0].getElementsByTagName('tr'); var groups = [], item, itemName; for (var i = 0, l = rows.length; i < l; i++) { item = rows[i].getElementsByTagName('td')[0]; itemName = item.innerText.trim(); if (groups.indexOf(itemName) !== -1) { addClass(rows[i], 'group-element'); } else { groups.push(itemName); addClass(rows[i], 'group-root'); addClass(rows[i], 'group-element'); if (item.addEventListener) { // For all major browsers, except IE 8 and earlier item.addEventListener("click", toggleGroup); } else if (x.attachEvent) { // For IE 8 and earlier versions item.attachEvent("onclick", toggleGroup); } } } function toggleGroup(evt) { var tr = evt.target.parentNode, isVisible = !hasClass(tr, 'group-element'); do { if (tr.nodeType === 1) { isVisible ? addClass(tr, 'group-element') : removeClass(tr, 'group-element'); } tr = tr.nextSibling; } while (tr && !hasClass(tr, 'group-root')); } /* helpers */ // source: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf // Production steps of ECMA-262, Edition 5, 15.4.4.14 // Reference: http://es5.github.io/#x15.4.4.14 if (!Array.prototype.indexOf) { Array.prototype.indexOf = function (searchElement, fromIndex) { var k; // 1. Let O be the result of calling ToObject passing // the this value as the argument. if (this == null) { throw new TypeError('"this" is null or not defined'); } var O = Object(this); // 2. Let lenValue be the result of calling the Get // internal method of O with the argument "length". // 3. Let len be ToUint32(lenValue). var len = O.length >>> 0; // 4. If len is 0, return -1. if (len === 0) { return -1; } // 5. If argument fromIndex was passed let n be // ToInteger(fromIndex); else let n be 0. var n = +fromIndex || 0; if (Math.abs(n) === Infinity) { n = 0; } // 6. If n >= len, return -1. if (n >= len) { return -1; } // 7. If n >= 0, then Let …
upvote count: 1
answers question: http://stackoverflow.com/q/29937954
downvote count: 0

http://stackoverflow.com/comment/48041500
type: Comment
has text: updated resposne, and changed to conversion function.
type: AnswerComment
comment on: http://stackoverflow.com/a/29960017
score: 0

http://stackoverflow.com/comment/47985300
has text: the `this` keyword allows you to pass a variable into the scope of the function without it being an argument in the function. so if i'm trying to reference window in a factory and window is unavailabled, i can call my function like `myClass['myfunction'].call(window, args);` effectively passing window as this.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29931446

http://stackoverflow.com/a/29968150
answers question: http://stackoverflow.com/q/29968066
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29968066
score: 0
has comment: http://stackoverflow.com/comment/48055849
type: Answer
has body: Change it to: &lt;script&gt; function select() { if (document.getElementById("lan").value=="Français") { document.getElementById("txt1").innerHTML="Veuillez entrer votre adresse mail et cliquer sur le bouton ci-dessous."; document.getElementById("txt2").innerHTML="Consultez ensuite votre boîte mail."; } else { document.getElementById("txt1").innerHTML="Enter your e-mail address and click on the button below"; document.getElementById("txt2").innerHTML="Then check your mail box"; } } &lt;/script&gt;

http://stackoverflow.com/a/29852388
answers question: http://stackoverflow.com/q/29852263
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47830689
has body: Is Prototype Synonymous with Static? No. Properties on the prototype are instance properties. If you attach a method to the prototype of a function then instances created from that function will inherit from that prototype. This means that all instances created from that function will share a single copy of that method on the prototype. A 'static' property in JavaScript is best represented by a property directly on the constructor function itself: function Person() {} Person.count = 0; Here, count is a 'static' property on the constructor. You could update that from e.g. within the constructor with Person.count++; The example above does not declare the variables in the class so they will be globally scoped You don't have any variable declarations, only property assignments. Because the prototype method will be called in the context of an instance this will refer to that instance and therefore the prototype method has access to those instance properties. The only thing that is 'global' in your example is the person constructor itself.
type: Answer
score: 13
downvote count: 0
upvote count: 13
accepted answer of: http://stackoverflow.com/q/29852263

http://stackoverflow.com/comment/47960793
score: 0
has text: I know what page.php does, but according to your javascript code the page.php is not receiving a param1. You have to put it in like i have shown you in the code. If you do that it should work. Try the code I have supplied, and it should work without a hitch.
type: Comment
comment on: http://stackoverflow.com/a/29919728
type: AnswerComment

http://stackoverflow.com/q/29890720
score: 3
answer count: 1
downvote count: 0
tagged with: gulp
tagged with: gulp-uglify
favorite count: 0
has answer: http://stackoverflow.com/a/29890978
has body: I have a gulp task that look like this: gulp.task('compressjs', function() { gulp.src('local/**/*.js') .pipe(sourcemaps.init()) // purpose compress here is only to give better error report .pipe(uglify()) .pipe(concat('all.min.js')) .pipe(wrap('(function(){"use strict"; &lt;%= contents %&gt;\n})();')) // compress here to get best final compression .pipe(uglify()) .pipe(sourcemaps.write('.')) .pipe(gulp.dest('public/app')); }); This gulp task uses: gulp-uglify gulp-wrap gulp-concat gulp-sourcemaps Everything above is running properly. But then I found that gulp-uglify seems to come with it's own wrap function. How can I use gulp-uglify function to wrap the script?
tagged with: node.js
upvote count: 3
type: UnansweredQuestion
tagged with: javascript
type: Question
has title: Gulp-uglify wrap JS
tagged with: gulp-concat

http://stackoverflow.com/comment/47987868
has text: The code above works (if you use `yes`). Click the "Run code snippet" button to see. If it doesn't work on your development system, then yes, you may have a bigger issue.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29932606

http://stackoverflow.com/q/29906907
upvote count: 1
type: Question
has body: I have a page that has a number of divs with content inside them. The divs are wrapped with lines - one line in the top and one in the bottom to sort of give the user a frame for each div. Now I have a problem that if those divs have a lot of content their appearance in the website and in the actual printed page are different. The actual printed page needs more lines to show the same content, and so i need to make that div higher and lower the bottom line. I wrote some code that works in chrome: var mediaQueryList = window.matchMedia('print'); mediaQueryList.addListener(function (mql) { if (mql.matches) { changeDivHeight(); } }); For FF and IE that code doesn't work. I use: window.onbeforeprint = function () { changeDivHeight(); }; window.onafterprint = function () { changeDivHeight(); } // i need those two because when i'm back in the web-site i want the height to be changed again because in the print mode the page what thinner.. changeDivHeight looks at all the div's child elements and adds their heights to the div height. As i said it works in chrome. In FF and IE it doesn't work and I think because they don't have the print preview, the div doesn't change to fit the actual printed page, whereas in chrome I do have a print preview so the div fits itself in the actual printed page. How can I fix this in FF and IE? thanks! EDIT function changeDivHeight() { $.each(".div, function(index, div) { var newHeight = 0; for (i = 0; i &lt; div.children.length) { newHeight += div.children[i].clientHeight; } if (newHeight &gt; 240) { $(div.parent).css("height", newHeight); } } } and every div is just filled up with P elements may have a lot of text EDIT I found that because chrome has a print preview, the clientHeight of the paragraphs with a lot of text changes in the print view, and so it works. in IE and FF i don't have this feature and so the height doesn't change, and it doesn't work.
tagged with: javascript
tagged with: jquery
has title: Expanding a div's height when printing
has comment: http://stackoverflow.com/comment/47936551
tagged with: http://stackoverflow.com/tag/html
answer count: 1
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/29907313
type: UnansweredQuestion
tagged with: css
score: 1

http://stackoverflow.com/comment/47909641
comment on: http://stackoverflow.com/a/29892500
type: AnswerComment
score: 0
type: Comment
has text: You Are The Man. Thankyou so much, now all I need to do is make it look pretty. Hopefully it's not too long till I can code things like this myself :).

http://stackoverflow.com/comment/47837810
comment on: http://stackoverflow.com/a/29854352
score: 0
type: AnswerComment
has text: Do you expect the server to save new html files automatically as you insert new data into database? or a human is going to save htmls on server and you want to make this process easier?
type: Comment

http://stackoverflow.com/q/29965209
accepted answer: http://stackoverflow.com/a/29967684
tagged with: javascript
has title: Bootstrap submenu items stay open when clicking on other item
score: 0
has body: I have this piece of Javascript: which addresses this: Category Name Subcategory This is sample code - the subcategory li items are dynamically genetrated in a foreach loop. Now the issue is that when I click on one submenu item it expands fine. Then when I click on another submenu item, the previous one stays open and the new clicked on also opens and so forth. The only way to collaps the is to click on them again. Looking at the abvove javascript, what am I missing to collapse the other submenu items when I expand on a new one? Here is a sample:
has comment: http://stackoverflow.com/comment/48050357
answer count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/48053285
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29967684
tagged with: css
type: AnsweredQuestion
tagged with: twitter-bootstrap
type: Question

http://stackoverflow.com/comment/48059047
score: 0
type: Comment
type: QuestionComment
has text: Hmm good point. No it wasn't. But it doesn't change anything without the mousemove. It was result of the problem ... The hoverIntent shouldn't behave other that the regular hover
comment on: http://stackoverflow.com/q/29963250

http://stackoverflow.com/q/29947737
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29948517
score: 1
upvote count: 1
type: Question
tagged with: javascript
has title: Jquery Autocomplete results link not working on click
answer count: 2
downvote count: 0
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/48016709
has body: I am using the jquery autocomplete.i am getting the search results from database. basically when i start typing in search box i am getting some suggestions.I have given the link for the results using . but when i click on those suggestions i am not getting to results.html I need to redirect to results.html page onclick on some suggestions how can i do that? Code:Jquery $().ready(function() { $("#search").autocomplete("php/getvalues.php", { width: 383, matchContains: true, //mustMatch: false, //minChars: 0, //multiple: true, //highlight: true, //multipleSeparator: ",", selectFirst: false }); }); getvalue.php <?php require_once "config.php"; $q = strtolower($_GET["q"]); if (!$q) return; $sql = "select file_name,img_url,captions from completer"; $rsd = mysql_query($sql); while($rs = mysql_fetch_array($rsd)) { $fname = $rs['file_name']; $iurl = $rs ['img_url']; $caption = $rs ['captions']; echo ' '."$fname".' '.$caption.''."\n"; } ?> html:
has answer: http://stackoverflow.com/a/29947984
type: UnansweredQuestion

http://stackoverflow.com/q/29876185
has answer: http://stackoverflow.com/a/69537100
tagged with: slider
tagged with: http://stackoverflow.com/tag/html
upvote count: 94
has title: Change the Arrow buttons in Slick slider
has answer: http://stackoverflow.com/a/58836163
tagged with: css
has answer: http://stackoverflow.com/a/55941333
favorite count: 0
has answer: http://stackoverflow.com/a/58903498
type: Question
has answer: http://stackoverflow.com/a/51148691
has answer: http://stackoverflow.com/a/77772400
has comment: http://stackoverflow.com/comment/59191183
has answer: http://stackoverflow.com/a/54887525
has answer: http://stackoverflow.com/a/30107306
has body: I want to change the arrows in my slick slider but it does not change. I want the next and previous button as an image. I have tried putting it in a &lt;style&gt; but it still not working. Where can I change the arrows setting? slick theme css @charset "UTF-8"; // Default Variables $slick-font-path: "./fonts/" !default; $slick-font-family: "slick" !default; $slick-loader-path: "./" !default; $slick-arrow-color: white !default; $slick-dot-color: black !default; $slick-dot-color-active: $slick-dot-color !default; $slick-prev-character: "←" !default; $slick-next-character: "→" !default; $slick-dot-character: "•" !default; $slick-dot-size: 6px !default; $slick-opacity-default: 0.75 !default; $slick-opacity-on-hover: 1 !default; $slick-opacity-not-active: 0.25 !default; @function slick-image-url($url) { @if function-exists(image-url) { @return image-url($url); } @else { @return url($slick-loader-path + $url); } } @function slick-font-url($url) { @if function-exists(font-url) { @return font-url($url); } @else { @return url($slick-font-path + $url); } } /* Slider */ .slick-list { .slick-loading &amp; { background: #fff slick-image-url("ajax-loader.gif") center center no-repeat; } position: absolute; margin: 0 auto; } /* Icons */ @if $slick-font-family == "slick" { @font-face { font-family: "slick"; src: slick-font-url("slick.eot"); src: slick-font-url("slick.eot?#iefix") format("embedded-opentype"), slick-font-url("slick.woff") format("woff"), slick-font-url("slick.ttf") format("truetype"), slick-font-url("slick.svg#slick") format("svg"); font-weight: normal; font-style: normal; } } /* Arrows */ .slick-prev, .slick-next { position: absolute; display: block; height: 20px; width: 30px; line-height: 0px; font-size: 0px; cursor: pointer; background: transparent; color: transparent; top: 50%; margin-top: -10px; padding: 0; border: none; outline: none; &amp;:hover, &amp;:focus { outline: none; background: transparent; color: transparent; &amp;:before { opacity: $slick-opacity-on…
has answer: http://stackoverflow.com/a/41006817
score: 94
has answer: http://stackoverflow.com/a/55639362
has answer: http://stackoverflow.com/a/36871595
answer count: 18
has answer: http://stackoverflow.com/a/49543871
has answer: http://stackoverflow.com/a/30176083
downvote count: 0
has answer: http://stackoverflow.com/a/65991391
has answer: http://stackoverflow.com/a/41614765
tagged with: javascript
type: UnansweredQuestion
tagged with: jquery
has answer: http://stackoverflow.com/a/65611911
has answer: http://stackoverflow.com/a/44310685
has answer: http://stackoverflow.com/a/41894856

http://stackoverflow.com/q/29903053
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/47929183
upvote count: 2
has comment: http://stackoverflow.com/comment/47929014
has title: CSS maintain div aspect ratio given height
tagged with: css
has body: I've found many responses that answer this question given a width. For example: Maintain the aspect ratio of a div with CSS But if I need to set div{ position: absolute bottom: 10px; top: 10px; padding-right: 125%; } those solutions do not work. How can I maintain the div's aspect ratio when I have the height set as above?
has answer: http://stackoverflow.com/a/29904622
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29904622
type: Question
linked to: http://stackoverflow.com/q/1495407
has comment: http://stackoverflow.com/comment/47929011
tagged with: javascript
has comment: http://stackoverflow.com/comment/47928750
score: 2
tagged with: http://stackoverflow.com/tag/html
answer count: 1

http://stackoverflow.com/q/29913280
tagged with: html-select
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/29914419
has comment: http://stackoverflow.com/comment/47948911
has comment: http://stackoverflow.com/comment/47948764
linked to: http://stackoverflow.com/q/30046867
upvote count: 1
type: AnsweredQuestion
has title: Can't change select option item angular
has comment: http://stackoverflow.com/comment/47948781
score: 1
tagged with: http://stackoverflow.com/tag/json
type: Question
has comment: http://stackoverflow.com/comment/47948940
tagged with: angular-ngmodel
has body: I have a select option like this: &lt;select ng-init="filterSelected = getItems.data.key" ng-model="filterSelected" ng-options="data.key as data.label for data in getItems.data" &gt;&lt;/select&gt; In which i parse a json that returns me some results that shows as item in this select. This is not a problem, i can display the items but i can't change them. It it stuck on the first one and even if i try to change the value still shows the first. By the way, i have a function in my javascript: $scope.getObjects = function(){ for (var i = 0; i &lt; $scope.getItems.data.length; i++) { if($scope.filterSelected = $scope.getItems.data[i].key){ return $scope.getItems.data[i].objects; } } }; this function needs because i have to find the correct object to cycle in my json that is something like this: "data": [ { "label": "first", "objects": [ { "name": "firstObj", "attributes": [ { ----, ----, ---- }, { ----, ----, ---- } ] } ], "key": "1" }, --- --- so i can find the "object" i selected and i can find the correct attributes of that object. The problem is that is stuck. the results are correct but it shows only the first.. Maybe there is a problem with the model?
tagged with: javascript
has comment: http://stackoverflow.com/comment/47948714
has answer: http://stackoverflow.com/a/29914419
downvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/47948889
favorite count: 0

http://stackoverflow.com/a/29999438
has body: $(document).ready(function(){ $.getJSON("allServices/getBusinessDetails.php?busid=&lt;? echo $business_id; ?&gt;",function(data){ $.each(data,function(key,value){ alert(data[key].attrib1name); alert(data[key].attrib2name); console.log(value); }); }); }); Or this approach $(document).ready(function(){ $.getJSON("allServices/getBusinessDetails.php?busid=&lt;? echo $business_id; ?&gt;",function(data){ parseJsonArray(data); }); function parseJsonArray(obj) { // Do something. $.each(obj, function (idx, obj1) { if (typeof obj1 == 'object') { parseJsonArray(obj1); } else { alert(idx+":"+obj1); } }); }
type: Answer
answers question: http://stackoverflow.com/q/29999372
score: 0

http://stackoverflow.com/comment/48121979
has text: @99Sono did u try to use `$timeout` without value? like: `$timeout(function () { element[0].focus(); });`
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29999866

http://stackoverflow.com/a/29958969
upvote count: 1
type: Answer
downvote count: 0
score: 1
has body: To monitor and debug AJAX calls, use your browser's developer tools (Press F12). You'll then see a Network tab, where you can watch all traffic to the server, including parameters and the response data. In some browsers you there is an XHR sub-tab, that filters for only AJAX requests (helpful if you have a lot of images, etc).
answers question: http://stackoverflow.com/q/29958524

http://stackoverflow.com/comment/48102285
has text: Seconds or milliseconds?
comment on: http://stackoverflow.com/q/29991407
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/48005724
type: QuestionComment
type: Comment
has text: No its a completely separate javascript library working independently as a client
comment on: http://stackoverflow.com/q/29942314
score: 0

http://stackoverflow.com/q/29954040
answer count: 1
downvote count: 0
tagged with: javascript
has body: It appears that I have everything setup correctly per the documentation. I'm not receiving JavaScript errors and I can see the markup change when I interact with the DOM. However, I do notice when I hover over the thumbnail, the larger image stays positioned at 0, 0. When I remove the easyzoom.css file, the larger image will start to move along the Y axis. I'm also having a hard to getting the plugin to work properly in a demo - http://codepen.io/jurbank/pen/QbbyGv Based on the issues above, how do I get EasySlider to work as shown in the documentation. &lt;div class="easyzoom"&gt; &lt;a href="http://i-like-robots.github.io/EasyZoom/example-images/1_zoom.jpg"&gt; &lt;img src="http://i-like-robots.github.io/EasyZoom/example-images/1_standard.jpg" alt="" /&gt; &lt;/a&gt; var $easyzoom = $('.easyzoom').easyZoom(); var api = $easyzoom.data('easyZoom');
tagged with: easyslider
favorite count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29954164
upvote count: 1
tagged with: css
score: 1
type: Question
has title: EasyZoom - issues with CSS and markup context

http://stackoverflow.com/comment/48059597
has text: `$(this).data-hideafter` is also invalid. It is interpreted as `$(this).data - hideafter` (minus sign). Should be `$(this).data('hideafter')`. Also, you compare a String and a Date, can't work. `newDate()` is another bug (newDate is undefined), should be `new Date()`. Ouch! You bet your code is "not working as intended" :)
comment on: http://stackoverflow.com/q/29969717
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29861111
tagged with: javascript
answer count: 1
downvote count: 0
has answer: http://stackoverflow.com/a/29867074
favorite count: 0
upvote count: 1
has title: How to add another field in a join sails js
tagged with: nosql
type: AnsweredQuestion
score: 1
accepted answer: http://stackoverflow.com/a/29867074
has body: Hey all just getting started with Sails js and mongoDB and im a bit confused. I have two models with a many-to-many relationship: User.js module.exports = { attributes: { username: 'STRING', password: 'STRING', doors:{ collection: 'door', via: 'users', } } }; and Door.js module.exports = { attributes: { name: 'STRING', users:{ collection: 'user', via: 'doors' } } }; This works fine, I can create a user and a door and associate one with the other. However I'd like to have another field in the join, an expiry date (Say the user can only have access to a particular door until a particular date). How would I go about doing that?
type: Question
tagged with: mongodb
tagged with: sails.js

http://stackoverflow.com/a/29979991
score: 10
accepted answer of: http://stackoverflow.com/q/29979990
has comment: http://stackoverflow.com/comment/50804480
has comment: http://stackoverflow.com/comment/50199145
upvote count: 10
answers question: http://stackoverflow.com/q/29979990
has body: So this one really bugged me (I was peeking under the hood at the NPM package code to see if there really was an unexpected end of input error, but the error was my fault). The problem is in my file structure, I had an empty .bowerrc file that I generated from the terminal by typing $ touch .bowerrc. Just add { "directory": "(your bower components folder here as valid JSON)" } and... the error is gone! hope this saves someone else as much trouble as it caused me.
type: AcceptedAnswer
downvote count: 0
type: Answer

http://stackoverflow.com/q/29847563
upvote count: 1
downvote count: 1
type: Question
tagged with: angularjs-directive
has comment: http://stackoverflow.com/comment/47822224
has comment: http://stackoverflow.com/comment/47820976
tagged with: javascript
score: 0
has title: Access function from custom directive in AngularJS
has comment: http://stackoverflow.com/comment/47822131
has comment: http://stackoverflow.com/comment/47822088
has comment: http://stackoverflow.com/comment/47823874
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47821920
has comment: http://stackoverflow.com/comment/47823075
answer count: 0
has body: This is my HTML. genericsearch is a directive: &lt;genericsearch search-text="organisationSearchEvent"&gt;&lt;/genericsearch&gt; I was trying to call organisationSearchEvent but it was not getting called. How can I solve this? My directive: .directive('genericsearch', [function () { return { restrict: 'E', replace: true, scope: { objectType : '=', searchText: '=', }, link:function(scope,elem,attrs) { scope.myParam = 'tei_org'; }, controller: [ '$scope', '$element', '$rootScope', 'SearchOrg', 'MapOrgs', '$routeParams', 'DelOrgs', 'GetTemplateGroups', 'FetchOrgs', function($scope,$element,$rootScope,SearchOrg,MapOrgs,$routeParams,DelOrgs,GetTemplateGroups,FetchOrgs){ $scope.organisationSearchEvent= function(organisationSearchEvent,filter) { console.log('orglist'+JSON.stringify($scope.myParam)); console.warn('text'+JSON.stringify($scope.text)); SearchOrg().fetch({'filter':filter, 'searchType':'tei_org'}).$promise.then( function(value){ $scope.orgList = value.data; }, function(err){ }); }); $scope.getOrgs = function(data, event) { if(event.keyCode != 13){ //$scope.Participants(data); $scope.organisationSearchEvent(data); } } // console.log('orglist'+JSON.stringify($scope.orgList)); } ], templateUrl : TAPPLENT_CONFIG.HTML_ENDPOINT[0]+'home/search.html' }}])
has comment: http://stackoverflow.com/comment/47825378

http://stackoverflow.com/q/29992554
type: AnsweredQuestion
score: 1
upvote count: 1
has answer: http://stackoverflow.com/a/29992698
linked to: http://stackoverflow.com/q/13248601
type: Question
has comment: http://stackoverflow.com/comment/48104711
downvote count: 0
tagged with: javascript
has body: I am building a web application using Javascript, HTML, and CSS. I have a table called categories I am pulling from my SQLite database called Main Database. The words are in french and the problem I am seeing is that letters with accents on top get sent to the bottom of the list instead of next to the normal letter they should be with. JavaScript: function listMainSymptomsDb(tx) { var category = getUrlVars().category; tx.executeSql("SELECT Main_Symptom, max(Add_Symptom) AS `firstAddSymptom` from `Main Database` WHERE Category='" + category + "' GROUP BY `Main_Symptom`",[],txSuccessListMainSymptoms); Can anyone recommend a way I can order my letters correctly?
has title: French Language ABC Order in Javascript
tagged with: http://stackoverflow.com/tag/html
tagged with: sqlite
answer count: 1
accepted answer: http://stackoverflow.com/a/29992698
favorite count: 0
tagged with: css

http://stackoverflow.com/q/29956052
duplicate of: http://stackoverflow.com/q/22264125
answer count: 0
has title: Which JavaScript file hid my element?
type: UnansweredQuestion
score: 0
has body: Is there a way to figure out which file (and which line in that file) modified my DOM? I have numerous plugins and .js files. I can't figure out which file is hiding an element. The class names and id of the element are very generic so it's hard to pin down where it is. Is there a way to see in Chrome's console? Thanks!
upvote count: 1
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/48032930
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/48032992
favorite count: 0
linked to: http://stackoverflow.com/q/22264125

http://stackoverflow.com/q/29884688
has answer: http://stackoverflow.com/a/29884762
type: AnsweredQuestion
has body: I need this function to change the border color of a form when the mouse hovers over a button. I got the expected result, but the function affects all page forms. I would like to determine which button affects each form. How can I specify the source ID and target ID in the function? View demo A - This should effect B only B - This is neutral C - This should effect D only D - This is neutral Update: Solved! Thank you guys for the help. View solution
score: 1
upvote count: 1
accepted answer: http://stackoverflow.com/a/29884834
type: Question
possible better answer: http://stackoverflow.com/a/29884801
tagged with: mousehover
has title: How to specify a source and a target on the function using JavaScript?
has answer: http://stackoverflow.com/a/29884801
tagged with: javascript
answer count: 3
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/29884834
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47893478

http://stackoverflow.com/comment/48114295
type: Comment
comment on: http://stackoverflow.com/a/29997328
has text: Sure, `var darkForecastAPI= "https://api.forecast.io/forecast/" + currentAPIKey + "/" + locations + "," + time +"?callback=?";` It is a query string parameter.
type: AnswerComment
score: 0

http://stackoverflow.com/comment/47893223
comment on: http://stackoverflow.com/a/29884409
score: 0
has text: @TechnicalChaos I don't think I am trying to manipulate the DOM as much as making it impossible from Javascript to navigate to another page through a click event. But maybe I am just misunderstanding what you mean.
type: Comment
type: AnswerComment

http://stackoverflow.com/comment/57649171
score: 0
type: Comment
has text: @binoculars yes indeed , try swiping your facebook app from background apps , and you will still get notified , simply there is a background service ( that handles notifications ) and this service can only be stopped from app manager , if you are using cordova check this out :https://github.com/phpsa/cbsp
comment on: http://stackoverflow.com/a/30147534
type: AnswerComment

http://stackoverflow.com/q/29948016
has body: What is best pratice for referencing a local commonjs module without using a relative path as below? var custMod= require(‘customModule’); custMod(true); custMod.save(‘foo’); Is there any reference for building a module like this? If I wrote module like below, getting undefined when I call custMode.save(12); module.exports = customModule;function customModule(mode) { var mode = 1; return { save: function (value) { console.log(mode, value) }, get: function (id) { console.log(mode, id) } }
type: UnansweredQuestion
has title: Writing commonjs module and load it using require (not using relative path)
score: 1
has comment: http://stackoverflow.com/comment/48017414
type: Question
has comment: http://stackoverflow.com/comment/121359307
tagged with: commonjs
answer count: 2
has comment: http://stackoverflow.com/comment/48017344
upvote count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/48017062
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/48017088
has answer: http://stackoverflow.com/a/29948148
has comment: http://stackoverflow.com/comment/48017429
has answer: http://stackoverflow.com/a/29949614
tagged with: node.js

http://stackoverflow.com/comment/48051938
type: AnswerComment
score: 0
type: Comment
has text: is there no way that i work it with for loop because i need to set up other values as well so i need it to be in that for loop
comment on: http://stackoverflow.com/a/29966071

http://stackoverflow.com/q/29923333
tagged with: highlight
favorite count: 0
type: UnansweredQuestion
downvote count: 2
has comment: http://stackoverflow.com/comment/47968439
tagged with: overlay
upvote count: 1
has comment: http://stackoverflow.com/comment/47968324
has title: How to hightlight an element with a circle
has answer: http://stackoverflow.com/a/29923425
type: Question
tagged with: javascript
tagged with: jquery
score: -1
answer count: 1
has body: I have an element $('.li .menu).first(). I have opened a modal with overlay. I want to highlight only this element with a circle. How do I do that. Note: There is overlay below because of modal.

http://stackoverflow.com/q/30001223
type: Question
has comment: http://stackoverflow.com/comment/48121936
tagged with: slideshow
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/48126552
tagged with: image
has comment: http://stackoverflow.com/comment/48124169
score: 0
answer count: 0
type: UnansweredQuestion
has title: continuous fadein for an image shows two images
has comment: http://stackoverflow.com/comment/48123022
has body: I am making a image tour(slideshow). so I am hiding all the images and appending the last images to image container or prepending based on whether it's previous or next. $('.img-container').find('img:first').fadeIn('300'); &lt;div class="img-container"&gt; &lt;img src="/assets/v2/explore.png"&gt; &lt;img src="/assets/v2/Analyze.png"&gt; &lt;/div&gt; I use the above code to show the image. but when I do this continuously at one time there are two images in the same slide. How do I fix this?

http://stackoverflow.com/comment/48116064
has text: misunderstood, i have update the file size in the question. And I thought in the same way for the NIC cards, thats why I don't want the file download load on server
comment on: http://stackoverflow.com/q/29998231
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/a/29851592
has body: If you fix the last option this way : for(var k = 0; k &lt; autho.length; k++) { var d = document.createElement("p"); var e = document.createTextNode("Author: " + autho[k].childNodes[0].nodeValue); // fix d.appendChild(e); container.appendChild(d); } It should work. You were atempting to concatenate a string with a textNode object... But we need an XML sample too... Maybe the issue is there.
score: 0
has comment: http://stackoverflow.com/comment/47864745
type: Answer
answers question: http://stackoverflow.com/q/29851368

http://stackoverflow.com/a/29890795
has body: try below: $(function () { // add multiple select / deselect functionality $("#selectall").click(function () { $('.name').prop('checked', this.checked); if (this.checked) insertText(); }); // if all checkbox are selected, then check the select all checkbox // and viceversa $(".name").click(function () { if ($(".name").length == $(".name:checked").length) { $("#selectall").prop("checked", "checked"); } else { $("#selectall").prop("checked", false); } insertText(); }); function insertText() { var arr = []; $('.name:checked').each(function() { arr.push($(this).val()); }) $('.text').val($arr.join(',')); } });
has comment: http://stackoverflow.com/comment/47912875
has comment: http://stackoverflow.com/comment/47943124
score: 0
type: Answer
answers question: http://stackoverflow.com/q/29890679
has comment: http://stackoverflow.com/comment/47906359

http://stackoverflow.com/comment/48101488
has text: Can you clarify what functionality you're attempting to implement? You mention both 'throttle' and 'debounce' in your question; these are different actions. If I throttle an event with a time of 1s, then the event will run every 1s so long as the triggering action is occurring. If I debounce that same event, it will only execute once, 1s after the final instance of the triggering action occurs. Additionally, you mention a keydown event that isn't included in your code snippet.
score: 1
comment on: http://stackoverflow.com/q/29990977
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/48071935
has text: see if that makes a difference.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29973936

http://stackoverflow.com/q/29965778
has answer: http://stackoverflow.com/a/29966824
score: 2
type: AnsweredQuestion
has title: Expression evaluation - why parenthesis changes "this" reference?
has comment: http://stackoverflow.com/comment/48052328
favorite count: 0
possible better answer: http://stackoverflow.com/a/29967245
type: Question
has answer: http://stackoverflow.com/a/29967245
answer count: 2
downvote count: 2
has comment: http://stackoverflow.com/comment/48069174
accepted answer: http://stackoverflow.com/a/29966824
has body: Consider the example module creation, why parenthesis changes this reference? As section 11.2.2 in JavaScript specification says: The production NewExpression : new NewExpression is evaluated as follows: Let ref be the result of evaluating NewExpression. Let constructor be GetValue(ref). If Type(constructor) is not Object, throw a TypeError exception. If constructor does not implement the Construct internal method, throw a TypeError exception. Return the result of calling the Construct internal method on constructor, providing no arguments (that is, an empty list of arguments). After some investigation there are no differences (are there?) between: console.log(new (modules.getModule('foo')).method) console.log(new (modules.getModule('foo')).method()) In both samples method were executed. To be more interesting: console.log(typeof new modules.getModule('foo').method) // function console.log(typeof new (modules.getModule('foo')).method) // object What is the source of those differences? var modules = (function() { var definitions = { foo: { method: function() { this.thing = 'baz'; } } }; return { getModule: function(name) { if(name in definitions) { return definitions[name]; } } }; }()); alert('this: ' + new modules.getModule('foo').method()) // undefined alert('this: ' + new (modules.getModule('foo')).method()) // {this.thing = 'baz'}
upvote count: 4
tagged with: javascript
has comment: http://stackoverflow.com/comment/48052523

http://stackoverflow.com/q/29916515
possible better answer: http://stackoverflow.com/a/29916621
has answer: http://stackoverflow.com/a/29916725
has answer: http://stackoverflow.com/a/29916621
type: AnsweredQuestion
tagged with: local-storage
type: Question
tagged with: addeventlistener
has answer: http://stackoverflow.com/a/29916658
tagged with: javascript
has answer: http://stackoverflow.com/a/29916644
score: 0
has body: I'm attempting to simply save a string to Chrome's Local Storage, but I can't seem to do it. It could be that I've got the wrong idea about function argument implementation (after 3 years, I think I might be getting it) but any help getting this code to work would be appreciated. I wanted to make it as dynamic as possible, allowing me to take the id of any text input field I write and change the stored string appropriately. Here's the code I've got so far: function setData() { dataToStore = document.getElementById('txtStore').value; return dataToStore; } function storeData(data) { localStorage.setItem('input', data); } btnStore.addEventListener('click', storeData(setData), false); Is my implementation of function arguments a bit backwards? I really thought I had it this time..
tagged with: function
answer count: 7
has answer: http://stackoverflow.com/a/29916627
has title: Setting data in Local Storage/function usage
has answer: http://stackoverflow.com/a/29916622
has answer: http://stackoverflow.com/a/29916600
accepted answer: http://stackoverflow.com/a/29916658
has comment: http://stackoverflow.com/comment/47954365

http://stackoverflow.com/comment/47887494
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29881259
has text: That worked! ( removing code) Thanks. Dots don't look right now. Seems to show broken characters. https://dl.dropboxusercontent.com/u/46025079/Screen%20Shot%202015-04-26%20at%2019.28.46.png
type: AnswerComment

http://stackoverflow.com/q/29955054
type: Question
tagged with: arrays
tagged with: javascript
has answer: http://stackoverflow.com/a/29955119
has answer: http://stackoverflow.com/a/29955349
has answer: http://stackoverflow.com/a/29955226
possible better answer: http://stackoverflow.com/a/29955119
has answer: http://stackoverflow.com/a/29955161
downvote count: 0
answer count: 7
has answer: http://stackoverflow.com/a/29955488
has answer: http://stackoverflow.com/a/29955110
favorite count: 0
score: 6
tagged with: lodash
upvote count: 6
has title: Combine nested arrays into one?
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29955166
tagged with: underscore.js
accepted answer: http://stackoverflow.com/a/29955488
has body: Let's say I have an array of objects that look similar to this: [ { id: ..., name: "...", users: [1, 2, 3] }, ... ] Is there a way that I can easily merge the .users array of each object into one array?

http://stackoverflow.com/comment/48081177
type: QuestionComment
type: Comment
has text: @steveklein but so is `$_GET` very common and works just fine...seems like a distraction
comment on: http://stackoverflow.com/q/29980701
score: 0

http://stackoverflow.com/q/29969136
has answer: http://stackoverflow.com/a/29969822
linked to: http://stackoverflow.com/q/333537
tagged with: javascript
score: -1
upvote count: 0
answer count: 1
tagged with: jquery
accepted answer: http://stackoverflow.com/a/29969822
favorite count: 0
has body: I want to generate that kind of excel : https://i.sstatic.net/h6pm6.jpg (with border style, image, tons of merged cells, ...) Is it possible using a javascript/JQuery excel library ? It did not seem to be the case with Excel Builder, or js-xlsx ...
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/48058419
has title: Excel generation with javascript
downvote count: 1
tagged with: excel
type: Question

http://stackoverflow.com/comment/47944200
type: QuestionComment
comment on: http://stackoverflow.com/q/29910823
has text: @SergueiFedorov also make sure there are no other errors in the console
score: 0
type: Comment

http://stackoverflow.com/q/29988522
answer count: 1
type: UnansweredQuestion
has body: Currently I have thumbnails, when I click the them a large version of the pic appears in the div directly to the right of the thumbnails. What I now want to be able to do is click the larger pic in the div and then trigger a lightbox that shows an even larger version of the pic. I'm not quite sure how to do what I'm thinking is the solution so I'm gonna try and explain. I'm thinking that when i click the div to trigger the lightbox I want to take the src of the pic being click and then somehow redirect it to another src in my images folder. Example: When I click image in div I get the src of pic lets say that the source is: src="redpic.jpg" Then lets say in my images folder I have a larger version of the pic selected with the source: src="redpic_large.jpg" Would it be possible to manipulate the the src of an first image img src="redpic.jpg" by adding _large to the end and then appending this to my lightbox??? Everytime I try to do things with my images I always seem to be running into problems. say the src="redpic.jpg" when I check in the console the src goes to something like //139.0.0.1:56328/img/dotted.jpg and it seems to cause me a lot of problems
has title: Image Gallery lightbox
has comment: http://stackoverflow.com/comment/48104226
type: Question
has answer: http://stackoverflow.com/a/29988629
tagged with: javascript
tagged with: jquery
score: 0

http://stackoverflow.com/a/54248634
answers question: http://stackoverflow.com/q/29873730
has comment: http://stackoverflow.com/comment/112110830
type: Answer
score: 8
downvote count: 0
upvote count: 8
has body: Four phases of a React component lifecycle Initialization Mounting Update Unmounting Here's a quick walkthrough of the different methods of the lifeCycle of a component. You must have good understanding of the lifecycle methods to code efficiently in react. Life Cycle Phase Methods Methods in Mounting Phase: This phase begins when an instance of a component is created and when it gets rendered into the DOM. 1.constructor(props) - it is called when the component is first initialized. This method is only called once. 2.componentWillMount() - it is called when a component is about to mount. 3.render() -it is called when a component is rendered. 4.componentDidMount() - it is called when a component has finished mounting. Methods in Updating Phase: This phase begins when a component's properties (a.k.a props) or state changes. 1.componentWillReceiveProps(nextProps) - it is called when a component has updated and is receiving new props. 2.shouldComponentUpdate(nextProps, nextState) - it is called after receiving props and is about to update. If this method returns false, componentWillUpdate(), render(), and componentDidUpdate() will not execute. 3.componentWillUpdate(nextProps, nextState) - it is called when a component is about to be updated. 4.render() - called when a component is rerendered. 5.componentDidUpdate(prevProps, prevState) - it is called when a component has finished updating. Methods in Unmounting Phase: This phase begins when a component is being removed from the DOM. 1.componentWillUnmount() - it is called immediately before a component unmounts. Ref: https://hackernoon.com/reactjs-component-lifecycle-methods-a-deep-dive-38275d9d13c0

http://stackoverflow.com/a/29945419
answers question: http://stackoverflow.com/q/29944329
has comment: http://stackoverflow.com/comment/52725815
downvote count: 0
upvote count: 2
type: Answer
score: 2
has body: You can get it from the title of the page. By typing document.title and doing some regex you can get the URL. Another way I found is by using the following var data = loadTimeData.createJsEvalContext(); console.log(data.a.$top.summary.failedUrl); If you open the developer tools and search for a part of the URL in source code, you will see that Chrome creates the loadTimeData in the "not available page".
has comment: http://stackoverflow.com/comment/48015904

http://stackoverflow.com/comment/48022891
type: QuestionComment
comment on: http://stackoverflow.com/q/29950942
score: 2
has text: define "breaking the browser". It shouldn't be possible to crash the browser using javascript, and your code shouldn't even cause an infinite loop.
type: Comment

http://stackoverflow.com/comment/47923676
type: Comment
comment on: http://stackoverflow.com/q/29900359
type: QuestionComment
score: 1
has text: Move script.js below socket stream script then, as with it above it ss hasnt been defined yet. Scripts are retrieved and executed in order (unless they have async or defer attributes). So if one script needs to use something in another script, that script has to come before it

http://stackoverflow.com/a/32595087
score: 2
answers question: http://stackoverflow.com/q/29974616
downvote count: 0
has body: I had faced the same issue with the tsc transpiler (since it compiles a source code from one format to another) not generating the ".js" file. Workaround: Try executing the following command in your Windows Command Prompt (cmd.exe - Run as Administrator): tsc test.ts Ensure that you are in the right folder path or else provide the absolute path for the ".ts" file Hopefully, it should generate the ".js" file in the same folder as the ".ts" file. Now that the ".js" file is generated, inorder to avoid executing the above command everytime you make a change, you can execute an auto-transpilation watch command in tsc. To perform an auto-transpilation for the ".ts" file, try running the following command: tsc test.ts --watch Now if you go back to your ".ts" file and make changes and hit Save, it will perform an auto-transpilation and update your ".js" file instantly. Remember to keep the command prompt running. I am yet to explore the reason as to why the tsc transpiler is not working on Visual Studio Code's Ctrl + Shift + B keypress, but my best guess would be an issue with the tsc version used by my Visual Studio Code installation or the environment PATH variables defined or npm installed a different tsc version.. reasons could be multiple. Output: But for those who want to get things done quickly, i hope this workaround helps.
upvote count: 2
type: Answer

http://stackoverflow.com/comment/47957656
type: QuestionComment
comment on: http://stackoverflow.com/q/29918246
score: 1
has text: There is no difference, it's just a matter of convenience and convention. In an online example it is easier to show the javascript inline with the HTML. Where as in a big project the convention of having javascript in files helps maintainability and expansion.
type: Comment

http://stackoverflow.com/comment/139701469
comment on: http://stackoverflow.com/a/66582207
type: AnswerComment
has text: Thx so much!! You're the MVP!
type: Comment
score: 1

http://stackoverflow.com/q/29932685
answer count: 1
type: UnansweredQuestion
has body: I need to search a JSON set for 2 elements of an array. If a match is found for these 2 elements, I need the index of this position. And once I have this index, I can use this to access a different property in this same array position. Below is sample of what I have. If you look at line 22, I am hard-coding the array position to 1. This is the value I dynamically need depending on what I pass into my getModelID() function. http://codepen.io/bdang/pen/pJvmox/?editors=101 function getModelID(extClr, intClr) { var colorLockDatesAr = lockDates.Models[0].Colors, colorLockDatesCount = colorLockDatesAr.length; for(var i = 0; i &lt; colorLockDatesCount; i++) { if(colorLockDatesAr[i].ExtColorCd == extClr &amp;&amp; colorLockDatesAr[i].IntColorCd == intClr) { $('#modelID').html(colorLockDatesAr[1].ModelID); } } } getModelID('BK', 'BK'); // should return Model 1 getModelID('BK', 'WH'); // should return Model 2 getModelID('WH', 'BK'); // should return Model 3 I have looked through various forums and many issues I've found are related issues but none specific to what I need. Any help with this would be greatly appreciated.
has title: JavaScript array search to return index position for 2 element search
has answer: http://stackoverflow.com/a/29932726
type: Question
tagged with: arrays
tagged with: javascript
tagged with: jquery
score: 0

http://stackoverflow.com/q/29963074
type: Question
tagged with: aurelia
tagged with: javascript
has body: I have a very simple binding which isn't working as I'd expect it to: app.js: export class PupilsViewer { pupilsInfo = [ { name: 'John' }, { name: 'Eric' }, { name: 'Martin' }, { name: 'Simon' } ]; } app.html: pupil.js: import {bindable} from 'aurelia-framework'; export class Pupil { @bindable info = { name: 'unknown' }; } pupil.html: Name: ${info.name} This results in the following output: Name: unknown Name: unknown Name: unknown Name: unknown whilst I'd have expected: Name: John Name: Eric Name: Martin Name: Simon
upvote count: 1
answer count: 1
has title: Aurelia simple binding is not working
has answer: http://stackoverflow.com/a/29966042
accepted answer: http://stackoverflow.com/a/29966042
favorite count: 0
type: AnsweredQuestion
downvote count: 0
score: 1

http://stackoverflow.com/comment/125133254
score: 0
type: AnswerComment
has text: The base class that you want to use, for example if in your framework you need to compose ClassTwoMixin and ClassOneMixin to a component it wold be like: class Example extends ClassTwoMixin(ClassOneMixin(componment))
type: Comment
comment on: http://stackoverflow.com/a/69767958

http://stackoverflow.com/comment/64349200
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29991836
has text: Note sure how that is. There's no allocation within the loop, except not sure if pre-allocating the array length might help. Also, keep in mind this was a simple answer for the OP trying the find "some way" and his is "some way", though perhaps not the best way, but the goal is not for a game engine, so take it easy. ;) In fact, I was trying to be more illustrative for teaching purposes.
type: AnswerComment

http://stackoverflow.com/comment/47926192
has text: Can you provide us a bit more of what you have tried?
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29901790

http://stackoverflow.com/a/29900643
upvote count: 1
has body: Just use the first element of your array. The variable data is already formatted correctly. The new format you want is not valid JSON. var data = [[{"path":"path2","value":"kkk"},{"path":"path0","value":"uuu"},{"path":"path1","value":"ppp"}]]; data = data[0];
has comment: http://stackoverflow.com/comment/47924245
type: Answer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/29900404

http://stackoverflow.com/comment/48069072
has text: You just can't see it in solution explorer, or it's not producing at all?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29974616

webrtc
tags question: http://stackoverflow.com/q/29900450
tags question: http://stackoverflow.com/q/29885939
tags question: http://stackoverflow.com/q/29862997
tags question: http://stackoverflow.com/q/29867226
type: Tag
tag name: webrtc
tags question: http://stackoverflow.com/q/29908926
tags question: http://stackoverflow.com/q/29993892
tags question: http://stackoverflow.com/q/29860787

http://stackoverflow.com/q/29962318
downvote count: 0
has comment: http://stackoverflow.com/comment/48045156
has comment: http://stackoverflow.com/comment/48044873
has comment: http://stackoverflow.com/comment/48044897
has body: I have four divs in a main container. After a javascript click event, display: none is added to them to hide. So I want to do something when no elements are visible. if ($('#boxes').children(':visible').length == 0) The above code does not seem to be working because it counts the number of visible elements before the click event (even if all the classes have display: none it gives the count 4). I'm using change(); function for select to toggle the display property. Demo: http://jsfiddle.net/wnzavyom/1/
has comment: http://stackoverflow.com/comment/48044921
type: Question
score: 3
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29962766
upvote count: 3
answer count: 3
tagged with: jquery
has comment: http://stackoverflow.com/comment/48044972
has answer: http://stackoverflow.com/a/29962766
favorite count: 0
possible better answer: http://stackoverflow.com/a/29962754
has comment: http://stackoverflow.com/comment/48045031
has answer: http://stackoverflow.com/a/29962754
has comment: http://stackoverflow.com/comment/48045015
has comment: http://stackoverflow.com/comment/48044896
has comment: http://stackoverflow.com/comment/48045147
tagged with: http://stackoverflow.com/tag/html
has title: Detect elements' visibility after adding Display:none using javascript
tagged with: css
has answer: http://stackoverflow.com/a/29962559
has comment: http://stackoverflow.com/comment/48045550
type: AnsweredQuestion

http://stackoverflow.com/a/30002248
has body: Parse User class is special class that you can query via the below query construction; var query = new Parse.Query(Parse.User); Also, if you are dealing with a unique user you can use the getFirst method.One suggestion for operation like updates more than 1 record you can use Parse saveAll method. Hope this helps. Regards.
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/30001813
upvote count: 1
type: Answer

http://stackoverflow.com/comment/47910244
comment on: http://stackoverflow.com/q/29893661
has text: sort the elements based on what
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/48097682
comment on: http://stackoverflow.com/a/29984421
score: 0
type: Comment
has text: Thanks Jake! Where do I put this? helper, controller, router? and how does this update my template? If this is in a helper, I do not know where I would put the return (I think the helper needs to return something). If this in a controller, I do not know how I would set the property.
type: AnswerComment

http://stackoverflow.com/comment/48000149
comment on: http://stackoverflow.com/a/29939098
has text: GHugo this is what I'm doing now, I have the if statement with the html code inside the loop which reads each element and creates a variable with the html code. The problem is that is hard to maintain the html code, because the requirements are changing, therefore I'm looking a better way to handle the rendering method of the data that are coming from the AJAX request
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/48081393
type: Comment
type: QuestionComment
has text: Got an idea where to look for tutorial on callback functions?
comment on: http://stackoverflow.com/q/29980772
score: 0

http://stackoverflow.com/a/29922450
answers question: http://stackoverflow.com/q/29917030
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29917030
type: Answer
has body: XMLHttpRequest's default response type is text, but here one is actually dealing with binary data. Eric Bidelman describes how to work with it. The solution to the problem is to read the data as a Blob, then to extract the data from the blob and plug it into hash.update(..., 'binary'): var xhr = new XMLHttpRequest(); xhr.open('GET', details.url, true); xhr.responseType = 'blob'; xhr.onload = function() { if (this.status === 200) { var a = new FileReader(); a.readAsBinaryString(this.response); a.onloadend = function() { var hash = crypto.createHash('sha1'); hash.update(a.result, 'binary'); console.log(hash.digest('hex')); }; } }; xhr.send(null);
score: 5
upvote count: 5
downvote count: 0

http://stackoverflow.com/comment/48009317
comment on: http://stackoverflow.com/a/29943330
score: 0
type: AnswerComment
has text: Thanks for your suggestion, I got the solution anyways :)
type: Comment

http://stackoverflow.com/a/29847107
answers question: http://stackoverflow.com/q/29846702
score: 0
type: Answer
has body: Turak Vladyslav below code will work you can check it once var Lis = $('#test').find('li'); var dataArray = [] for(var i=0;i<Lis.length;i++){ dataArray.push($(Lis[i]).attr('data-target')) } var maxDatatTarget = Math.max.apply(null, dataArray) alert("max data target value"+maxDatatTarget) 1 2 3 4 5 6 7 8 9 10

http://stackoverflow.com/q/29993725
possible better answer: http://stackoverflow.com/a/29995004
tagged with: http://stackoverflow.com/tag/html
score: 2
type: AnsweredQuestion
upvote count: 2
has comment: http://stackoverflow.com/comment/48107158
has comment: http://stackoverflow.com/comment/48106958
has body: I've tried many different methods, and even tried searching on SO. No answer was what I was looking for. What I want is to have two input buttons that do some things in pure javascript. Button one: Have it say "Add" when the page loads. When clicked, the value changes to "Cancel." Also, when it's clicked, have it display a form with three fields. When it's clicked again, have the form disappear. One named 'name', the second named 'location', the third named 'type'. I want the user to be able to submit these three things and have them be stored in the code. Button two: Take the user input from the form and each time the user clicks, it displays all three information values, but have the button act as random generator. Let's say the code has 5 separate entries, I want them to be randomly selected and displayed when the button is clicked. Like I said, I tried to make this work, but couldn't quite get over the top of where I wanted to go with it. If you want to see my original code, just ask, but I doubt it will be of any assistance. Thanks in advance. EDIT: Added the code. function GetValue() { var myarray = []; var random = myarray[Math.floor(Math.random() * myarray.length)]; document.getElementById("message").innerHTML = random; } var testObject = { 'name': BWW, 'location': "Sesame Street", 'type': Bar }; localStorage.setItem('testObject', JSON.stringify(testObject)); var retrievedObject = localStorage.getItem('testObject'); function change() { var elem = document.getElementById("btnAdd1"); if (elem.value == "Add Spot") { elem.value = "Cancel"; } else elem.value = "Add Spot"; } window.onload = function() { var button = document.getElementById('btnAdd1'); button.onclick = function show() { var div = document.getElementById('order'); if (div.style.display !== 'none') { div.style.display = 'none'; } else { div.style.display = 'block'; } }; }; &lt;section&gt; &lt;input type="button" id="btnChoose" value="Random Spot" onclick="GetValue();" /&gt; &lt;p id="message"&gt;&lt;…
has comment: http://stackoverflow.com/comment/48106993
has comment: http://stackoverflow.com/comment/48107200
type: Question
has answer: http://stackoverflow.com/a/29995004
accepted answer: http://stackoverflow.com/a/29994320
has comment: http://stackoverflow.com/comment/48106828
tagged with: forms
has comment: http://stackoverflow.com/comment/48106798
answer count: 2
has answer: http://stackoverflow.com/a/29994320
downvote count: 0
tagged with: javascript
has title: Creating a dynamic form with input buttons
favorite count: 0
has comment: http://stackoverflow.com/comment/48107083

http://stackoverflow.com/a/29909610
upvote count: 5
type: Answer
has body: https://facebook.github.io/react/docs/reconciliation.html#keys If you specify a key, React is now able to find insertion, deletion, substitution and moves in O(n) using a hash table. It's just a simple hash table (of siblings) lookup, and makes React try to reuse components that have the same key. A rough explanation, without keys: [1] [2] [3] [2] [3] [4] list-wise diff, [updateAttributes x3] with keys: [1] [2] [3] nil nil [2] [3] [4] list of [2] [3] [4], [2] has key matching with [2] no changes, [3] has key ... [3] no changes, [4] has no key and no more nodes in original list so insert, [1] will be destroyed
downvote count: 0
score: 5
answers question: http://stackoverflow.com/q/29909473

http://stackoverflow.com/q/29925948
has title: Building a promise chain recursively in javascript - memory considerations
has answer: http://stackoverflow.com/a/38331858
favorite count: 0
accepted answer: http://stackoverflow.com/a/29931657
tagged with: promise
linked to: http://stackoverflow.com/q/23803743
answer count: 5
score: 58
has comment: http://stackoverflow.com/comment/93637733
has answer: http://stackoverflow.com/a/45267855
has answer: http://stackoverflow.com/a/29931657
has comment: http://stackoverflow.com/comment/47973706
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/28107460
has answer: http://stackoverflow.com/a/29926059
upvote count: 61
has comment: http://stackoverflow.com/comment/47973610
type: Question
tagged with: recursion
linked to: http://stackoverflow.com/q/24660096
possible better answer: http://stackoverflow.com/a/29926059
has comment: http://stackoverflow.com/comment/47973712
tagged with: javascript
has answer: http://stackoverflow.com/a/36615426
has comment: http://stackoverflow.com/comment/84392538
downvote count: 3
has comment: http://stackoverflow.com/comment/47973617
linked to: http://stackoverflow.com/q/29904445
has body: In this answer, a promise chain is built recursively. Simplified slightly, we have : function foo() { function doo() { // always return a promise if (/* more to do */) { return doSomethingAsync().then(doo); } else { return Promise.resolve(); } } return doo(); // returns a promise } Presumably this would give rise to a call stack and a promise chain - ie "deep" and "wide". I would anticipate a memory spike larger than either performing a recursion or building a promise chain alone. Is this so? Has anyone considered the memory issues of building a chain in this way? Would memory consumption differ between promise libs?

http://stackoverflow.com/q/29943196
has comment: http://stackoverflow.com/comment/48007140
has comment: http://stackoverflow.com/comment/48007040
tagged with: javascript
possible better answer: http://stackoverflow.com/a/29943307
has title: comparing 2 dates with javascript
has answer: http://stackoverflow.com/a/29943307
downvote count: 4
answer count: 2
upvote count: 0
has answer: http://stackoverflow.com/a/29943268
has comment: http://stackoverflow.com/comment/48007063
favorite count: 0
linked to: http://stackoverflow.com/q/492994
accepted answer: http://stackoverflow.com/a/29943268
type: AnsweredQuestion
has body: I want to compare 2 dates in the following format shown below in variables a and b . I want to check if a is greater than b but the code below isnt working since its not a regular number var a = "4/29/2015"; var b = "4/10/2015"; if(a &gt; b){ alert("working"); }
has comment: http://stackoverflow.com/comment/48007062
score: -4
has comment: http://stackoverflow.com/comment/48007097
type: Question

http://stackoverflow.com/q/29973936
accepted answer: http://stackoverflow.com/a/30036315
answer count: 3
possible better answer: http://stackoverflow.com/a/29976034
has comment: http://stackoverflow.com/comment/48071935
tagged with: angularjs
has comment: http://stackoverflow.com/comment/48071059
has comment: http://stackoverflow.com/comment/48070184
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29976034
has answer: http://stackoverflow.com/a/59406037
type: Question
has comment: http://stackoverflow.com/comment/48071359
has comment: http://stackoverflow.com/comment/48071456
has body: I'm trying to enable a select2 field only when another combobox is selected. This works fine with textbox, normal input or even simple select elements, but when I try to use ng-disabled with a select2 that uses an Ajax call, it doesn't work. Here is part of my code: {{tipo.NM_TIPO_PARTICIPANTE}} I want to keep the second element (id="select_novo_usuario") disabled until the previous one is selected. The textarea using ng-disabled works just fine. Here is my ajax call: $("#select_novo_usuario").select2({ minimumInputLength: 4, allowClear: true, placeholder: localize.localizeText('tooltip_select_interessado'), ajax: { url: BACKEND_URL + 'usuario_interessado', dataType: 'json', type: "GET", quietMillis: 50, data: function (term) { var filter = 'NM_USUARIO,like,' + term; return { filters: filter, filter_id_interessado: 'ID_USUARIO,notin,teste.teste' }; }, results: function (data) { return { results: $.map(data, function (item) { return { text: item.NM_USUARIO, slug: item.NM_USUARIO, id: item.ID_USUARIO } }) }; }, }, }); $("#select_novo_usuario").on("select2-selecting", function(e) { $timeout(function(){ $scope.$evalAsync(function() { $scope.filtros.F_ID_USUARIO.Valor = e.val; }); }); }); How can I get it working?
has title: Using ng-disabled with input select2
tagged with: javascript
has comment: http://stackoverflow.com/comment/48070738
tagged with: ajax
has answer: http://stackoverflow.com/a/30036315
score: 0

http://stackoverflow.com/comment/47963381
comment on: http://stackoverflow.com/q/29920737
has text: I know. the `@` made me think of C#
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/a/29919781
has comment: http://stackoverflow.com/comment/47962853
has body: I don't know bootstrap form builder but you can do this easily using onkeyup event on every input. When user press a key, look keycode and if you don't like this key, remove the last character. Or on every onkeyup use regexp to replace bad character.
answers question: http://stackoverflow.com/q/29919558
score: 0
type: Answer

http://stackoverflow.com/comment/48060787
score: 3
comment on: http://stackoverflow.com/q/29970544
type: Comment
has text: Text inputs can't contain images, only text. They can have a background image however.
type: QuestionComment

http://stackoverflow.com/q/29849041
favorite count: 0
tagged with: google-maps-api-3
has answer: http://stackoverflow.com/a/33407156
tagged with: asynchronous
linked to: http://stackoverflow.com/q/30453526
possible better answer: http://stackoverflow.com/a/33407156
has answer: http://stackoverflow.com/a/29849042
accepted answer: http://stackoverflow.com/a/29849042
type: AnsweredQuestion
downvote count: 0
score: 1
has title: Google maps async load: It isn't possible to write into a document from an asynchronously-loaded external script unless it is explicitly opened
type: Question
has body: This one just sents me troubleshooting for a bit, so I thought it may be worth a Q&amp;A format. Q: I'm trying to asynchronously load google maps via API (something similar to this) But google maps loader complains Execute write on doc: It isn't possible to write into a document from an asynchronously-loaded external script unless it is explicitly opened
answer count: 2
upvote count: 1
tagged with: javascript

http://stackoverflow.com/comment/48059877
type: Comment
has text: how can i guarantee that this is done when the button 'Save' is clicked ?
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/29970010

http://stackoverflow.com/a/29885533
score: 8
accepted answer of: http://stackoverflow.com/q/29885030
type: Answer
answers question: http://stackoverflow.com/q/29885030
downvote count: 0
upvote count: 8
has body: See the API for List.map and the API for Iterable (which it returns). You can get the nth element from the iterable using .elementAt(n) or the first element using .first. var list = [{'id':3, 'name':'third'},{'id':4, 'name':'fourth'}]; var result = list.map((x) =&gt; x['id']).first; You can also turn it back into a List using .toList(): var resultList = list.map((x) =&gt; x['id']).toList();
type: AcceptedAnswer

http://stackoverflow.com/q/29894587
tagged with: node.js
score: 3
upvote count: 3
type: Question
tagged with: i18n-node
tagged with: javascript
has answer: http://stackoverflow.com/a/29895363
has title: Paths in nodejs
answer count: 1
downvote count: 0
favorite count: 0
type: UnansweredQuestion
has body: I'm facing a problem with paths in nodeJs, I route the user to the index page when he specifies the language in the url like this : app.all('/:locale?/index',function(req,res,next){ if(!req.params.locale){ console.log('no param'); res.render('index'); } else { var language = req.params.locale; i18n.setLocale(language); res.render('index'); } }); However, in my index.html page the source of images are specified this way : ./images/img1.png , when I route the user, my index.html shows image not found because it considers the path " lang/images/img1.png , it considers the languge in my URL, could you please help? Thank you

http://stackoverflow.com/q/29891360
tagged with: eclipse-plugin
favorite count: 0
has answer: http://stackoverflow.com/a/30018298
has comment: http://stackoverflow.com/comment/47908287
type: UnansweredQuestion
tagged with: refactoring
tagged with: java
tagged with: eclipse
downvote count: 1
type: Question
upvote count: 0
has title: method renaming code in java eclipse for code refactoring
has comment: http://stackoverflow.com/comment/47906765
tagged with: javascript
has comment: http://stackoverflow.com/comment/57436256
score: -1
has comment: http://stackoverflow.com/comment/47906832
linked to: http://stackoverflow.com/q/9129689
has body: Is there any code could get for renaming method in java eclipse plugin for code re-factoring? For instance, if want to change method name at one place , it may get changed at all other places. visit http://pdplab.it.uom.gr/teaching/sunjava/eclipse-java.html
has comment: http://stackoverflow.com/comment/47906288
answer count: 1

http://stackoverflow.com/q/29880598
has answer: http://stackoverflow.com/a/29880898
downvote count: 0
has body: I've got a list of items: Toggle #1 Toggle #2 Toggle #3 Toggle #4 If you click one of the items (i.e. "Toggle #1"), I want the class name of all other items to change from visible to invisible. If you click another item now, I want the class name of this item to change to visible (with no effect to all other class names, they should remain as they are) Simple example: You first clicked "Toggle #4", then "Toggle #1". Result should be: Toggle #1 Toggle #2 Toggle #3 Toggle #4 I tried to write a js function but the behavior is different from what I expected: var firstrun = true; function toggle_class(id) { var thisElem = document.getElementById(id); var invisible = "invisible"; var visible = "visible"; if (thisElem.className == 'invisible' && !firstrun) { thisElem.className = thisElem.className.replace(invisible, visible); } else { thisElem.className = thisElem.className.replace(visible, invisible); } if (firstrun) { var children = document.getElementsByClassName('visible'); for (var i = 0; i < children.length; i++) { if (children[i].id != id) { children[i].className = thisElem.className.replace(visible, invisible); } } } firstrun = false; } On first click, the selected item changes its class to invisible, and so does every second item in the list. I don't understand why this happens. What do I need to change in the code to make it work?
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29880818
type: Question
has answer: http://stackoverflow.com/a/29881123
score: 1
favorite count: 0
answer count: 6
upvote count: 1
has title: Toggle class name
has answer: http://stackoverflow.com/a/29881134
tagged with: javascript
has answer: http://stackoverflow.com/a/29880971
has answer: http://stackoverflow.com/a/29880890
tagged with: css

http://stackoverflow.com/a/29943328
has comment: http://stackoverflow.com/comment/48010784
has body: This will not be possible. An option tag is not permitted to have other tags as content, only "Normal character data". This does mean you can use entities, e.g. &amp;#8482; or &amp;trade; (which renders as "&trade;"), which should work for your specific example. For completeness sake, for the Knockout part, if you were to try what you're after, you have two options: utilize the foreach binding and create your own option elements with html bound contents (as opposed to text bound contents) utilize the optionsAfterRender binding to tweak the rendered option elements (thanks to @CaseyWebb for noting this option in the comments)
type: Answer
score: 2
upvote count: 2
has comment: http://stackoverflow.com/comment/48007585
answers question: http://stackoverflow.com/q/29942763
accepted answer of: http://stackoverflow.com/q/29942763
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/47983092
type: QuestionComment
type: Comment
has text: I'm going to have to recreate something to test this unless you can provide the code. This seems it should be easier than the way you're doing it; i.e. `when the function $scope.removeSlip(slip) is call, also I need to call $scope.addLineToBetSlip(line, row, type)` you add and then remove? That doesn't make sense
score: 0
comment on: http://stackoverflow.com/q/29930092

http://stackoverflow.com/q/29903659
linked to: http://stackoverflow.com/q/22180765
favorite count: 0
has body: I have been wrestling with rendering an animation that fires a projectile accurately from an "enemy" node to a "player" node in a 2D 11:11 grid (0:0 = top-left) in JS/Canvas. After a lot of reading up I've managed to get the shots close, but not quite bang on. I think my velocity function is a little out but I really don't know why. This is the trigonometric function: this.getVelocityComponents = function(speed){ // loc (location of enemy actor) = array(2) [X_coord, Y_coord] // des (destination (ie. player in this instance)) = array(2) [X_coord, Y_coord] var i, sum, hyp, output = [], dis = []; var higher = false; for (i in loc) { sum = 0; if (loc[i] &gt; des[i]) sum = loc[i] - des[i]; if (loc[i] &lt; des[i]) sum = des[i] - loc[i]; dis.push(sum); } hyp = Math.sqrt(Math.pow(dis[X], 2) + Math.pow(dis[Y], 2)); if (dis[X] &gt; dis[Y]) { output[X] = (speed * Math.cos(dis[X]/hyp)) output[Y] = (speed * Math.sin(dis[Y]/hyp)) } else if (dis[X] &lt; dis[Y]) { output[X] = (speed * Math.cos(dis[Y]/hyp)) output[Y] = (speed * Math.sin(dis[X]/hyp)) } return output; } and this is the instruction that tells the X and the Y of the projectile frame to advance: var distance = []; for (i in loc) { var sum = 0; if (loc[i] &gt; des[i]) sum = loc[i] - des[i]; if (loc[i] &lt; des[i]) sum = des[i] - loc[i]; distance.push(sum); } if (distance[X] &gt; distance[Y]) { frm[X] += (loc[X] &lt; des[X]) ? v[X] : -v[X]; frm[Y] += (loc[Y] &lt; des[Y]) ? v[Y] : -v[Y]; } else { frm[Y] += (loc[Y] &lt; des[Y]) ? v[X] : -v[X]; frm[X] += (loc[X] &lt; des[X]) ? v[Y] : -v[Y]; } Below is a screenshot. Blue is player, pink enemy and the yellow circles are projectiles as you can see, it's almost on the mark. Have I done something wrong? what do I need to do?
tagged with: trigonometry
has answer: http://stackoverflow.com/a/29914152
has comment: http://stackoverflow.com/comment/47937636
possible better answer: http://stackoverflow.com/a/29914096
has comment: http://stackoverflow.com/comment/47950170
upvote count: 1
has answer: http://stackoverflow.com/a/29914096
type: Question
type: AnsweredQuestion
score: 1
accepted answer: http://stackoverflow.com/a/29914152
answer count: 2
tagged with: canvas
has title: Returning precise vector components in js canvas
tagged with: html5-canvas
downvote count: 0
tagged with: javascript

http://stackoverflow.com/q/29853809
has answer: http://stackoverflow.com/a/29871071
upvote count: 2
type: UnansweredQuestion
tagged with: acrobat
tagged with: vector-graphics
type: Question
tagged with: javascript
has title: JavaScript to convert vector graphics to raster, but not text, for Acrobat
tagged with: rasterizing
score: 2
has body: Looking for a way to convert vector graphics – but not text objects – to rasters in PDFs using the javascript tool in Adobe Acrobat. In one use case, a page has over 70k vector objects, which renders too slowly on screen. The answers to this question do not suffice: Replacing vector images in a PDF with raster images. The html rendering tool created an SVG and preserved the vectors. It did not rasterize it. Imagemagick does not preserve text. Thanks!
downvote count: 0
answer count: 1
linked to: http://stackoverflow.com/q/9607687
favorite count: 0

http://stackoverflow.com/q/29892338
accepted answer: http://stackoverflow.com/a/29892414
tagged with: regex
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/29906887
score: 0
has answer: http://stackoverflow.com/a/29906887
has body: I was testing this snippet in my browser and with some online JavaScript testers: var s = "testing \u0123 one two three"; s = s.replace(/\u[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]/g,''); alert (s); I would expect the result in alert to be just "testing one two three" but a funny character appears where the \u0123 is. My question is why doesn't the replace strip that out? I know it's not the most elegant regular expression. But isn't it correct? I'm stripping out the backlash character followed by exactly 4 hexidecimal characters. Or trying to anyway.
type: Question
answer count: 2
has title: This JavaScript snippet appears to not strip out Unicode escape characters in JavaScript - why?
has answer: http://stackoverflow.com/a/29892414
tagged with: javascript
tagged with: unicode

http://stackoverflow.com/comment/48123871
score: 1
comment on: http://stackoverflow.com/q/30002591
has text: imagine naming your dog **"where is"**, whenever you ask anyone where is where is, you think they will understand you? no they wont. and javascript wont understand you either if you name a function function.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29999549
tagged with: javascript
has answer: http://stackoverflow.com/a/29999582
score: 0
has body: I'm having a problem with printing a text string to a input tag. The javascript: imgDiv.innerHTML += "&lt;input type='text' value=" + text[i].firstChild.data + "&gt;"; The generated html looks like this: &lt;input type="text" fjäril="" svart="" och="" orange="" value="En"&gt; Does anyone have a suggestion on what is causing this problem?
tagged with: http://stackoverflow.com/tag/html
has title: Printing a value to input tag with innerHTML
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29999582
type: Question
answer count: 1

http://stackoverflow.com/comment/47901939
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29888923
has text: Ok can you try to put everything from "MQA.EventUtil.observe(window, 'load', function() {" to "callBackHnadler" function
score: 0

http://stackoverflow.com/comment/47828696
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29851113
has text: @AbdulAhmad The point is the data is completely irrelevant to the problem at hand.

http://stackoverflow.com/comment/47840393
type: AnswerComment
comment on: http://stackoverflow.com/a/29856401
type: Comment
has text: Hm, when I use this code, the same thing happens that I described at Sterling Archer's solution, but faster. There is no hang, my progress bar is at 100% when I click the button. Using Archer's solution, it takes ~1 second. Hmm.
score: 0

http://stackoverflow.com/q/29999372
score: 0
has body: I get the json on console as [Object] 0: Object address: "soham" region: "soham" relevanceScore: "4" startDate: "2015-05-10" subscriptionType: "1" verificationStatus: "1" __proto__: Object length: 1 __proto__: Array[0] and my ajax call $(document).ready(function() { ($.ajax({ url:"allServices/getBusinessDetails.php?busid=&lt;? echo $business_id; ?&gt;", dataType: "json", success: function (jsondata) { var allval=jsondata; console.log(allval); } })); }); but when i try to take the value out of it as allval.address it gives me undefined. How to parse the object
upvote count: 1
downvote count: 1
type: AnsweredQuestion
has title: Json Parsing in ajax
has answer: http://stackoverflow.com/a/29999471
has comment: http://stackoverflow.com/comment/48117984
tagged with: http://stackoverflow.com/tag/json
tagged with: javascript
type: Question
has answer: http://stackoverflow.com/a/29999391
has answer: http://stackoverflow.com/a/29999438
has comment: http://stackoverflow.com/comment/48117870
tagged with: jquery
accepted answer: http://stackoverflow.com/a/29999391
favorite count: 0
has comment: http://stackoverflow.com/comment/48117868
has answer: http://stackoverflow.com/a/29999443
tagged with: ajax
answer count: 5
possible better answer: http://stackoverflow.com/a/29999446
has answer: http://stackoverflow.com/a/29999446

http://stackoverflow.com/a/29859309
accepted answer of: http://stackoverflow.com/q/29858565
answers question: http://stackoverflow.com/q/29858565
type: Answer
has body: Don't trigger the next request until after you've processed the previous one, to prevent a large backlog from building up. function pollInputs(){ $('#hiddenDataDiv').load(document.URL + " #hiddenDataDiv", function(result) { if (numberOfDivs &gt; 0){ for (i = 0; i &lt; numberOfDivs; i++) { radioResult[i] = $('#data'+i).text(); } } setTimeout('pollInputs()', 1000); }); if (radioResult[0] != undefined){ if (numberOfDivs &gt; 0){ for (i = 0; i &lt; numberOfDivs; i++) { document.getElementById("input"+i).innerHTML = radioResult[i]; } } } }
has comment: http://stackoverflow.com/comment/47932078
has comment: http://stackoverflow.com/comment/47844622
has comment: http://stackoverflow.com/comment/47932196
score: 0
type: AcceptedAnswer

http://stackoverflow.com/comment/47980500
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29928717
has text: I just cast to string :$this->description = (string)$description; to solve my problem, and remove the htmlspecialchars
type: Comment

http://stackoverflow.com/comment/48087176
score: 0
type: Comment
has text: Yes, thanks a lot! Insane but the fact is JSFiddle suggested me to add that semicolon :) Anyway now it's perfectly working, thanks again and have a great day man!
type: AnswerComment
comment on: http://stackoverflow.com/a/29983925

http://stackoverflow.com/q/29992561
has comment: http://stackoverflow.com/comment/48107396
has comment: http://stackoverflow.com/comment/48105955
has comment: http://stackoverflow.com/comment/48106091
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/48109245
has comment: http://stackoverflow.com/comment/48122564
tagged with: ajax
has comment: http://stackoverflow.com/comment/48106619
score: 0
has comment: http://stackoverflow.com/comment/48123331
has comment: http://stackoverflow.com/comment/48106406
tagged with: android
has body: When I click a button an animation runs but the ajax is skipped. This is only a problem on the smartphone screen and not on my computer. Jquery: Button: Create Html Create <input type="input" style="float:right; display:none;" id="create2" value="<?php echo $_GET['user']?>"> Result.php <?php if( $_REQUEST["name"] ) { $name = $_REQUEST['name']; $name1_preg = preg_replace('/\s+/', '-', $name); $name2 = $_RsEQUEST['name2']; $content = 'Click to edit me, press the save button to save'; session_start(); try { $pdo = new PDO('mysql:host=localhost;dbname=cms', 'root', 'root'); } catch (PDOException $e) { } $query123 = $pdo-> prepare("INSERT INTO post (head, user, content) VALUES (?, ?, ?)"); $query123-> bindValue(1, $name1_preg); $query123-> bindValue(2, $name2); $query123-> bindValue(3, $content); $query123-> execute(); } ?>
has comment: http://stackoverflow.com/comment/48104606
answer count: 0
has comment: http://stackoverflow.com/comment/48106289
type: UnansweredQuestion
has title: Jquery ajax doesent run from smartphone screen
has comment: http://stackoverflow.com/comment/48106136
has comment: http://stackoverflow.com/comment/48136114
has comment: http://stackoverflow.com/comment/48106534
has comment: http://stackoverflow.com/comment/48106856
has comment: http://stackoverflow.com/comment/48106778
has comment: http://stackoverflow.com/comment/48119051
type: Question
has comment: http://stackoverflow.com/comment/48105920

http://stackoverflow.com/a/30153223
score: 0
answers question: http://stackoverflow.com/q/29936237
type: Answer
has body: If the website has an iframe breakout, there's nothing you can do.

momentjs
tags question: http://stackoverflow.com/q/29947655
tags question: http://stackoverflow.com/q/29861699
tags question: http://stackoverflow.com/q/29878693
tags question: http://stackoverflow.com/q/29908184
tags question: http://stackoverflow.com/q/30000706
tags question: http://stackoverflow.com/q/29877791
tags question: http://stackoverflow.com/q/29909459
tags question: http://stackoverflow.com/q/29896722
tag name: momentjs
tags question: http://stackoverflow.com/q/29947468
type: Tag
tags question: http://stackoverflow.com/q/29976561
tags question: http://stackoverflow.com/q/29896492
tags question: http://stackoverflow.com/q/29870991

http://stackoverflow.com/q/29924182
score: 1
tagged with: wordpress
tagged with: youtube-api
type: Question
accepted answer: http://stackoverflow.com/a/29925237
answer count: 1
has body: I have a videos page we created using the youtube API and Javascript in order to play our videos on an embedded player when you click the thumbnails. It works fine here: http://www.securitycameraking.com/videos.php However, On wordpress, I tried to use similar code, but when you click on the thumbs, I'm getting a javascript error. I tried changing all of the $ to JQUERY and vice versa, but it's still not working correctly here: http://www.techprosecurity.com/videos/ I can't seem to find exactly where the conflict is. I really appreciate any help you can give me.
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47970112
has title: Youtube API / JS issues with selecting videos to play
has comment: http://stackoverflow.com/comment/47971860
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/29925237
upvote count: 1
tagged with: youtube
type: AnsweredQuestion

http://stackoverflow.com/comment/47976007
has text: Have you tried increasing `post_max_size`?
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29926718

http://stackoverflow.com/a/29910736
has body: Try using autocomplete="off". Not sure if every browser supports it, though. Add this for the field in change password view. Update: You can try this. $('#Password').attr("autocomplete", "off"); setTimeout('$("#Password").val("");', 2000);
upvote count: 1
accepted answer of: http://stackoverflow.com/q/29910678
answers question: http://stackoverflow.com/q/29910678
downvote count: 1
type: AcceptedAnswer
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/47943672

http://stackoverflow.com/comment/47820393
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29846632
has text: just call this function from your jsp code
score: 0

http://stackoverflow.com/a/29976756
has body: Add .innerHTML - should work, get rid of the complicated mapping functions that are meant to work with multiple &lt;pre&gt; tags at once. var attData = document.getElementById(attName).getElementsByTagName('pre')[0].innerHTML; alert(attData);
type: Answer
score: 2
downvote count: 0
upvote count: 2
answers question: http://stackoverflow.com/q/29975813

http://stackoverflow.com/q/29863572
has title: Get attributes value of dropped element in Meteor
has comment: http://stackoverflow.com/comment/47852501
tagged with: javascript
tagged with: jquery
linked to: http://stackoverflow.com/q/5562853
score: 0
tagged with: drag-and-drop
tagged with: http://stackoverflow.com/tag/html
tagged with: meteor
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47852458
type: Question
has body: I have 2 meteor templates, each one contains data from another collection. I'm using the ui-dropped-event package, which allows me to use the "dropped" event, which is very essential. However, I want to get value of attributes from the dropped element instead the one I dragged the element to. I'm trying to achieve this like this: This is the dragged object: Hey there ...which is being dropped to this element: test And my JS code goes like this: 'dropped .droptome' : function(evt, tmp) { console.log($(evt.target).attr("class")); } This prints the "droptome" class instead of the "dragme" class. I need to reach the dragged element attributes.
has comment: http://stackoverflow.com/comment/47852527

http://stackoverflow.com/q/29907127
has body: I have a component with a data-icon attribute. The value of this attribute should be, for instance, &amp;#xf00f so that css can render it via content: attr( data-icon );. However, whatever I try: React keeps escaping to &amp;amp;. Even when I provide the proper unicode character \u0026#xf00f. Is there some way to stop React from messing with that value? Besides dangerously setting inner html, as I do not want to add another wrapper. Component define( [ 'react', 'util' ], function( React, Util ) { return React.createClass( { render: function() { //var amp = '\u0026', var amp = String.fromCharCode( 38 ), // Util.icons[x] returns a String, such as "f00f" code = amp + '#x' + Util.icons[this.props.name] + ';'; return ( &lt;i data-icon={code}&gt; {this.props.children ? &lt;span&gt;{this.props.children}&lt;/span&gt; : null} &lt;/i&gt; ); } } ); } ); Usage &lt;Widget.Icon name="add" /&gt; Output &lt;i data-icon="&amp;amp;#xf0fb;" data-reactid=".170lse36465.7.0"&gt;&lt;/i&gt;
answer count: 1
upvote count: 17
has comment: http://stackoverflow.com/comment/47938220
favorite count: 0
has title: React keeps escaping the amp character (&) in attributes
has comment: http://stackoverflow.com/comment/47962155
has comment: http://stackoverflow.com/comment/47961461
has comment: http://stackoverflow.com/comment/47944792
tagged with: css
tagged with: escaping
has comment: http://stackoverflow.com/comment/47962695
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47960018
downvote count: 0
score: 17
accepted answer: http://stackoverflow.com/a/29928024
type: Question
tagged with: reactjs
tagged with: javascript
has answer: http://stackoverflow.com/a/29928024

http://stackoverflow.com/q/29906926
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29921759
tagged with: http://stackoverflow.com/tag/json
type: Question
answer count: 1
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29921759
has title: Set values after creating a JSON object Angular.js
has comment: http://stackoverflow.com/comment/47964778
has comment: http://stackoverflow.com/comment/47939432
has body: I am having some trouble setting some values for a widget I am making. I am using Ozone widget framework, but that part is negligible to this discussion. Here us the html where I am trying to set the variable (for now just focus on {{user.user}} part. User: {{user.user}} # Model Score Date {{$index+1}} {{item.model}} {{item.score}} {{item.date}} And here is the Angular / owf to go with it: angular.module('myapp', ['cgOwf']) .controller('MainCtrl', function($scope, $http, owf) { var records; $scope.selectPost = ''; $scope.searchText = ''; console.debug("before IT HERE!!!"); owf.ready(function(){ console.debug("MADE IT HERE!!!"); owf.Eventing.subscribe('user-status', function(sender, msg, channel) { console.debug('[%s] - received message %o', channel, msg); $scope.user = msg; }); }); $scope.search = function() { //clear the select, go here http://jsonplaceholder.typicode.com/comments //and display/filter emails based on the search input $scope.selectPost = ""; $scope.selectedItem = null; $http.get('https://api.myjson.com/bins/1jvst').success(function(data2) { $scope.records = []; data2.forEach(function(r) { if (r && r.user && r.user.toLowerCase().indexOf($scope.searchText.toLowerCase()) !== -1) { $scope.records.push(r); } }); }); }; }); The part I am having trouble with is $scope.user = msg;. At that point in the code, msg is a JSON object, and I am sure of that because it checks out in the js debugger in chrome. AFAIK that is how I would set the object so I could access it in the html, though something clearly doesn't work.
has comment: http://stackoverflow.com/comment/47937228
has comment: http://stackoverflow.com/comment/47964484
has comment: http://stackoverflow.com/comment/47936646
has comment: http://stackoverflow.com/comment/47936534
tagged with: angularjs
score: 0
has comment: http://stackoverflow.com/comment/47936935

http://stackoverflow.com/comment/47836156
comment on: http://stackoverflow.com/q/29854109
has text: @Claies your intuition was correct and maybe it is just a formulation problem but your answer was misleading and some statements were not true, hope you understand
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29971887
tagged with: debugging
tagged with: typescript
has comment: http://stackoverflow.com/comment/48070725
score: 1
has body: I am writing a SPA application with JavaScript files generated with typescript. When I put a break point in typescript code and start debugging the application, if the JavaScript was loaded with the main page, the debugging works perfectly and the execution stops in my typescript code. But if the part of the view is loaded with Ajax (for example with $.get jQuery command), and that partial view contains a reference to JavaScript file, the loaded code gets executed, but the breakpoint is not hit. I am using Typescript 1.4, Internet Explorer 11, VS Ultimate 2013 with Update 4 and WebEssentials 2013 ver 2.5.3 I created a simplest test application do check if something else in my code could cause this behaviour, but I still got the same result (I can share the code if required) Is there any way to debug the dynamically loaded js files (putting 'debugger' in the code stops the execution, but I would like to be able to do it from VS and to break in typescript code, not js)?
has comment: http://stackoverflow.com/comment/54351557
upvote count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/48068682
answer count: 0
type: UnansweredQuestion
has title: Debugging dynamically loaded JavaScript generated by Typescript
type: Question

http://stackoverflow.com/comment/48036756
type: QuestionComment
has text: Btw, you can completely omit that IEFE and its `return`, just assign `window.raf = … || … || function(cb){…};`
score: 1
comment on: http://stackoverflow.com/q/29957819
type: Comment

http://stackoverflow.com/q/29941286
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/48006452
score: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29942573
has answer: http://stackoverflow.com/a/29941526
has body: There are about 16 posts in the front page and there is a filter with 4 drop-downs showing post categories. I have added category names as classes to the post div and I'm hiding them with javascript. Used the following code to filter posts. $('#filter select').change(function () { var upper = $('#upper').val(); //these are IDs of select. var sole = $('#sole').val(); var toe = $('#toe').val(); var midsole = $('#midsole').val(); var classes = '.' + [upper, sole, toe, midsole].join('.'); $('.box').hide().filter(classes,toeall).show(); }); .box is the class of the post container. this works perfectly. The first option in each dropdown is "ALL" and I want to make it work. For example, if I select ALL in "TOE" dropdown, it has to keep the existing results and and also show those posts which has one of the TOE categories as class. Using the following code I tried to find all the values of TOE dropdown and show the posts with those classes too. var toeall = new Array(); $('#toe option').each(function() { toeall.push('.'+$(this).val()); }); if(toe=="all") { $('.box').hide().filter(classes&amp;&amp;toeall).show(); } I know the code above is incorrect but can someone explain how to do it? UPDATE: http://jsfiddle.net/kd3ybnnx/1/ &lt;- Demo after answer from madalin ivascu
type: Question
has title: Want to keep "ALL" option in Javascript-CSS filter
has answer: http://stackoverflow.com/a/29942383
has comment: http://stackoverflow.com/comment/48005260
accepted answer: http://stackoverflow.com/a/29941526
possible better answer: http://stackoverflow.com/a/29942383
answer count: 3
has comment: http://stackoverflow.com/comment/48005716

http://stackoverflow.com/a/29908381
type: Answer
accepted answer of: http://stackoverflow.com/q/29907383
answers question: http://stackoverflow.com/q/29907383
has body: zip.useWebWorkers = false; and including statically fixes the problem
type: AcceptedAnswer
score: 0

d3.js
tags question: http://stackoverflow.com/q/29892267
tags question: http://stackoverflow.com/q/29988298
tags question: http://stackoverflow.com/q/29901628
tags question: http://stackoverflow.com/q/29855452
tags question: http://stackoverflow.com/q/29979140
tags question: http://stackoverflow.com/q/29965643
tags question: http://stackoverflow.com/q/29961236
tags question: http://stackoverflow.com/q/29899269
tags question: http://stackoverflow.com/q/29929742
tags question: http://stackoverflow.com/q/29893190
tags question: http://stackoverflow.com/q/29974874
tags question: http://stackoverflow.com/q/29989223
tags question: http://stackoverflow.com/q/29971905
tags question: http://stackoverflow.com/q/29967173
tags question: http://stackoverflow.com/q/29989147
tags question: http://stackoverflow.com/q/29850914
tags question: http://stackoverflow.com/q/29910194
tags question: http://stackoverflow.com/q/29873947
tags question: http://stackoverflow.com/q/29995682
tags question: http://stackoverflow.com/q/29884995
tags question: http://stackoverflow.com/q/29926679
tags question: http://stackoverflow.com/q/29851397
tags question: http://stackoverflow.com/q/29917665
tags question: http://stackoverflow.com/q/29920851
tags question: http://stackoverflow.com/q/29933893
tags question: http://stackoverflow.com/q/29875764
tags question: http://stackoverflow.com/q/29857022
tags question: http://stackoverflow.com/q/29901898
tags question: http://stackoverflow.com/q/29881371
tags question: http://stackoverflow.com/q/29939367
tags question: http://stackoverflow.com/q/29994139
tags question: http://stackoverflow.com/q/29952268
tags question: http://stackoverflow.com/q/29969538
tags question: http://stackoverflow.com/q/29895717
tags question: http://stackoverflow.com/q/29994121
type: Tag
tags question: http://stackoverflow.com/q/29973650
tags question: http://stackoverflow.com/q/29909895
tags question: http://stackoverflow.com/q/29967546
tags question: http://stackoverflow.com/q/29903981
tags question: http://stackoverflow.com/q/29997605
tags question: http://stackoverflow.com/q/29903478
tags question: http://stackoverflow.com/q/29973399
tags question: http://stackoverflow.com/q/29945181
tags question: http://stackoverflow.com/q/29875534
tags question: http://stackoverflow.com/q/29858864
tags question: http://stackoverflow.com/q/29962826
tags question: http://stackoverflow.com/q/29869603
tags question: http://stackoverflow.com/q/29992354
tags question: http://stackoverflow.com/q/29992119
tags question: http://stackoverflow.com/q/29972635
tags question: http://stackoverflow.com/q/29866010
tags question: http://stackoverflow.com/q/29928807
tags question: http://stackoverflow.com/q/29999805
tags question: http://stackoverflow.com/q/29926987
tags question: http://stackoverflow.com/q/29852536
tags question: http://stackoverflow.com/q/29948457
tags question: http://stackoverflow.com/q/29996839
tag name: d3.js
tags question: http://stackoverflow.com/q/29951605
tags question: http://stackoverflow.com/q/29854056
tags question: http://stackoverflow.com/q/29980323
tags question: http://stackoverflow.com/q/29975264
tags question: http://stackoverflow.com/q/29978957
tags question: http://stackoverflow.com/q/29943584
tags question: http://stackoverflow.com/q/29857894
tags question: http://stackoverflow.com/q/29896755
tags question: http://stackoverflow.com/q/29970786
tags question: http://stackoverflow.com/q/29997493
tags question: http://stackoverflow.com/q/29941188
tags question: http://stackoverflow.com/q/29904102
tags question: http://stackoverflow.com/q/29855158
tags question: http://stackoverflow.com/q/29945809
tags question: http://stackoverflow.com/q/29988843
tags question: http://stackoverflow.com/q/29956789
tags question: http://stackoverflow.com/q/30000590
tags question: http://stackoverflow.com/q/29939472
tags question: http://stackoverflow.com/q/29893970
tags question: http://stackoverflow.com/q/29927158
tags question: http://stackoverflow.com/q/29914580

http://stackoverflow.com/comment/47923911
has text: @David like, ["kkk", "uuu", "ppp"]
comment on: http://stackoverflow.com/q/29900404
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/48039748
type: AnswerComment
score: 0
type: Comment
has text: @Ejay I updated question details and tried to make it as clear as possible. Thanks.
comment on: http://stackoverflow.com/a/29949262

http://stackoverflow.com/comment/47861881
type: AnswerComment
has text: Try to read the documentation first.
comment on: http://stackoverflow.com/a/29867917
type: Comment
score: 0

http://stackoverflow.com/a/29854352
has comment: http://stackoverflow.com/comment/47864025
has comment: http://stackoverflow.com/comment/47914368
score: 0
has comment: http://stackoverflow.com/comment/47860238
has comment: http://stackoverflow.com/comment/47835594
answers question: http://stackoverflow.com/q/29854063
type: Answer
has comment: http://stackoverflow.com/comment/47913368
has body: By replacing response.write by f.write, you can save the file on server instead of sending file to the browser, Where f is createTextFile Object: <% dim fs,f set fs=Server.CreateObject("Scripting.FileSystemObject") set f=fs.CreateTextFile("c:\test.txt",true) f.write("Your current html and asp codes goes here considering syntax which connects html strings and asp codes in classic asp") f.close set f=nothing set fs=nothing %> if you want to save your current page into server by a human action, you can get entire you html content using (javascript) jquery and send it to an ASP file to save it in a file. So you have to add a javascript function and a form which sends the content: Save the page by clicking here and this would be the source of asp page naming savefile.asp : <% dim fs,f set fs=Server.CreateObject("Scripting.FileSystemObject") set f=fs.CreateTextFile (server.mapath("test.txt"),true) dim body body=request.form("body") body=replace(body,chr(34),chr(34)&chr(34)) 'To escpase double quotes f.write (body) f.close set f=nothing set fs=nothing %>
has comment: http://stackoverflow.com/comment/47912977
has comment: http://stackoverflow.com/comment/47918100
has comment: http://stackoverflow.com/comment/47837810

http://stackoverflow.com/q/29952791
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29954013
has comment: http://stackoverflow.com/comment/48027578
type: Question
has body: I have this template event: 'click .edit_user_button': function(ev){ ev.preventDefault(); var id = this._id; var children = $("'#" + id + "'"); console.log(children); children.css('display', 'inline-block'); } That I want to target this input: &lt;input class='user_input form-control edit_fields' id='username_field {{_id}}' type="text" name='username' placeholder="username"&gt; but I can't get it to work. The template has scope, and this._id matches {{_id}} in the template.
tagged with: javascript
tagged with: jquery
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/29953329
has title: Template helper to dynamically set div id, Meteor
tagged with: meteor

http://stackoverflow.com/q/29911623
type: Question
tagged with: object
has answer: http://stackoverflow.com/a/29911688
has body: In object literal we should be able to access the methods using this.name, but in my case below I'm using this.init() to trigger a method but gave me undefined function instead. However if I refer to allTabAnimation.init() it works, why is that ? var allTabAnimation = { desktopClick: function (){ $('.allForms .investorOptions .investorOptions-wrapper .select-options input+label').click(function (e){ $this = $(this), $thisHookNumber = $(this).data("hook"), $allTab = $(".tab-content"), $selectedTab = $(".tab-content[data-hook="+$thisHookNumber+"]"), this.init(); // doesn't work // allTabAnimation.init(); // this work }); }, init: function (){ this.condition($selectedTab, $allTab); },
tagged with: javascript
answer count: 2
has title: Unable to access method in object literal
tagged with: function
downvote count: 0
score: 1
favorite count: 0
accepted answer: http://stackoverflow.com/a/29911688
has comment: http://stackoverflow.com/comment/47945349
possible better answer: http://stackoverflow.com/a/29911727
has answer: http://stackoverflow.com/a/29911727
has comment: http://stackoverflow.com/comment/47945314
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/4616202
upvote count: 1
tagged with: methods
tagged with: literals

http://stackoverflow.com/q/29939101
favorite count: 0
score: -1
tagged with: backbone.js
type: Question
downvote count: 2
has title: Check whether all rest requests got response or not in backbone js
upvote count: 1
answer count: 1
has answer: http://stackoverflow.com/a/29942361
has body: I want a callback function which will get called after all rest requests got response from server in backbone js. Function will execute after only all requests got response, not for each response. I know about success, error, and complete methods but, these methods are executes for each response. Please tell me about any other functions are present or get called after all response received from server. I posted code below to fetch data from server. fetchNextPage : function( successCallback, errorCallback, completeCallback, context ) { this.requestNextPage({ remove : false, success : function( collection, response, options ) { if ( typeof successCallback === "function" ) { successCallback.apply( context, [ collection, response, options ]); } }, error : function( collection, response, options ) { if ( typeof errorCallback === "function" ) { errorCallback.apply( context, [ collection, response, options ]); } }, complete: function( xhr, status ){ if ( typeof completeCallback === "function" ) { completeCallback.apply( context, [ xhr, status ]); } } }); }
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/29942361
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/7638847

http://stackoverflow.com/comment/47968274
type: QuestionComment
comment on: http://stackoverflow.com/q/29921073
has text: @jwatts1980 also, you'll notice that there are custom classes like QuoteRequest and QuoteResponse. is it possible to create instances of those from jQuery? Even if that is possible, I do not think it is a good idea to do that. I'd rather have any server side processing done on server side, but again, I run into the issue of preventing a PostBack
score: 0
type: Comment

http://stackoverflow.com/a/55169611
answers question: http://stackoverflow.com/q/29979564
upvote count: 1
score: 1
has body: array.get(index) actually works. index can be either an integer or a string. It also works for array-properties, ie. this.get('myArray.1') will return the second element in the myArray property.
has comment: http://stackoverflow.com/comment/100807045
has comment: http://stackoverflow.com/comment/100816308
downvote count: 0
type: Answer

http://stackoverflow.com/comment/48105291
has text: Thanks for the input Thomas, give me a moment, and I will get back with you and tell you if it works.
type: Comment
score: 1
comment on: http://stackoverflow.com/a/29992956
type: AnswerComment

http://stackoverflow.com/comment/48115356
type: Comment
type: QuestionComment
has text: So you want an array looking just like that, with those numbers, right? Or is that just a clever way to try and show that you want an array with the actual users split by some number, or ... ?
score: 0
comment on: http://stackoverflow.com/q/29997940

http://stackoverflow.com/q/29949732
score: -2
tagged with: javascript
has comment: http://stackoverflow.com/comment/48020306
downvote count: 2
has title: Animate function not working on DIV
answer count: 1
has answer: http://stackoverflow.com/a/29949796
accepted answer: http://stackoverflow.com/a/29949796
tagged with: jquery
favorite count: 0
has body: I'm trying to let a div move from off the screen to on the screen... The div should come from up to down. I've tried some stuff, but unfortunately nothing happens :(. Am I right that the div has to be position: absolute;? Please Help. HTML + JQUERY 1 2 3 4 5 Text Text CSS body { background-image: url("http://static.tumblr.com/97f4b171db68d6ef1836c8fcb9a1c1a3/oi8jcug/xIcn5vql3/tumblr_static_aajc47nn2ds8c0k004gskoo0c.jpg"); background-repeat: no-repeat; background-size: cover; padding: 0px; margin: 0px; } a { outline: none; } #nav { height: 50px; line-height: 50px; background-color: #1C1C1C; font-size: 0px; text-decoration: none; width: 100%; text-align: center; font-family: sans-serif; margin-bottom: none; } #nav span { display: inline-block; font-size: 25px; padding-left: 10px; padding-right: 10px; text-align: center; border-right: 1px solid white; height: 50px; } #nav span:first-child { border-left: 1px solid white; } #nav span:hover { border-bottom: 2px solid white; } #nav a { color: white; text-decoration: none; margin: 0px; padding: 0px; } #hidden { width: 100%; height: 200px; padding-left: 30px; background-color: #1C1C1C; color: red; font-size: 10px; top: -250px; position: absolute; } Thank You, HydraCles
tagged with: animation
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion
upvote count: 0
has comment: http://stackoverflow.com/comment/48020517
type: Question

http://stackoverflow.com/comment/47947634
type: Comment
score: 2
has text: @Arbaaz: Glad this helped. I'd remove the server-side code from the question and post a *new* question saying "How can I make this code return an array for `data.d` rather than a string?" (including the JSON it currently returns). Best,
type: AnswerComment
comment on: http://stackoverflow.com/a/29912316

http://stackoverflow.com/a/29898081
has comment: http://stackoverflow.com/comment/47918881
has body: you could simply just parse the Int. javascript str = parseInt(str, 10); php str = (int)$str;
score: 0
answers question: http://stackoverflow.com/q/29898008
type: Answer

http://stackoverflow.com/q/29906167
has answer: http://stackoverflow.com/a/29906262
has title: AJAX call not acting as expected
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47935206
has comment: http://stackoverflow.com/comment/47935396
has comment: http://stackoverflow.com/comment/47935168
tagged with: asp.net-mvc
has comment: http://stackoverflow.com/comment/47935602
has comment: http://stackoverflow.com/comment/47935191
type: Question
answer count: 1
tagged with: javascript
tagged with: jquery
tagged with: ajax
has body: I am attempting to use an AJAX call to render a partial view when a radio button is selected. I have searched and have tried what appears to be the best approach via comments on Stack. When I click the radio button, I have no result, in debug, I get a Status Code: 500 Internal Server Error? Any assistance would be great. Partial View Names: _BOA.cshtml _TA.cshtml _MNB.cshtml View: &lt;td class="radio-inline"&gt; @Html.RadioButton("bankSelect", "MNBConvert", false, new { @class = "radioMNB" }) MNB Conversion @Html.RadioButton("bankSelect", "BOAConvert", false, new { @class = "radioBOA" }) BOA Conversion @Html.RadioButton("bankSelect", "TAConvert", false, new { @class = "radioTA" }) TA Conversion &lt;/td&gt; Javascript: &lt;script src="~/Scripts/jquery-1.9.0.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(function () { $("[name=bankSelect]").on('change', function () { // var $radio = $(this); var checked = $("input[name='bankSelect']:checked").val(); $.ajax({ url: '@Url.Action("GetBankToConvert", "Home")', data: checked, type: 'GET', success: function (data) { $("#renderPartialView").html(data); } }); }); }); &lt;/script&gt; Controller: [HttpGet] public ActionResult GetBankToConvert(string bankSelect) { if (bankSelect == "MNBConvert") { return PartialView("_MNB"); } else if (bankSelect == "BOAConvert") { return PartialView("_BOA"); } else { return PartialView("_TA"); } }
score: 0

http://stackoverflow.com/comment/47998063
comment on: http://stackoverflow.com/a/29937623
type: Comment
has text: And to force it to make a js request, you can add format to your link_to `votes_path(:vote => {:post_id => post.id, :up => false}, :format => :js)`
score: 0
type: AnswerComment

http://stackoverflow.com/comment/76858104
score: 0
type: AnswerComment
type: Comment
has text: @Liverpool - did you figured out how to do it ? I also want to do the samething
comment on: http://stackoverflow.com/a/39242515

http://stackoverflow.com/q/29923192
tagged with: file-io
has answer: http://stackoverflow.com/a/62253255
accepted answer: http://stackoverflow.com/a/62253255
upvote count: 17
possible better answer: http://stackoverflow.com/a/29924103
favorite count: 0
answer count: 4
tagged with: node.js
type: AnsweredQuestion
has title: How NOT to stop reading file when meeting EOF?
has body: I'm trying to implement a routine for Node.js that would allow one to open a file, that is being appended to by some other process at this very time, and then return chunks of data immediately as they are appended to file. It can be thought as similar to tail -f UNIX command, however acting immediately as chunks are available, instead of polling for changes over time. Alternatively, one can think of it as of working with a file as you do with socket — expecting on('data') to trigger from time to time until a file is closed explicitly. In C land, if I were to implement this, I would just open the file, feed its file descriptor to select() (or any alternative function with similar designation), and then just read chunks as file descriptor is marked "readable". So, when there is nothing to be read, it won't be readable, and when something is appended to file, it's readable again. I somewhat expected this kind of behavior for following code sample in Javascript: function readThatFile(filename) { const stream = fs.createReadStream(filename, { flags: 'r', encoding: 'utf8', autoClose: false // I thought this would prevent file closing on EOF too }); stream.on('error', function(err) { // handle error }); stream.on('open', function(fd) { // save fd, so I can close it later }); stream.on('data', function(chunk) { // process chunk // fs.close() if I no longer need this file }); } However, this code sample just bails out when EOF is encountered, so I can't wait for new chunk to arrive. Of course, I could reimplement this using fs.open and fs.read, but that somewhat defeats Node.js purpose. Alternatively, I could fs.watch() file for changes, but it won't work over network, and I don't like an idea of reopening file all the time instead of just keeping it open. I've tried to do this: const fd = fs.openSync(filename, 'r'); // sync for readability' sake const stream = net.Socket({ fd: fd, readable: true, writable: false }); But had no luck — net.Socket isn't happy and throws TypeEr…
downvote count: 0
score: 17
has answer: http://stackoverflow.com/a/29924103
has answer: http://stackoverflow.com/a/31328488
type: Question
linked to: http://stackoverflow.com/q/11225001
tagged with: javascript
has answer: http://stackoverflow.com/a/31394491

http://stackoverflow.com/q/29874599
has body: I just started using bookshelfJS, and I couldn't find a clear answer on how to do the following. Consider I have the following tables: product -------- id product_account -------- id product_id account_id collection -------- id collection_product_account -------- collection_id product_account_id There can be many products to a collection. I want to do the following SELECT pa.*, p.* FROM product_account pa INNER JOIN collection_product_account cp ON cp.product_account_id = pa.id INNER JOIN product p ON p.product_account_id = pa.product_id WHERE cp.collection_id = ? How would I be able to pass in a collection id, and return a whole list of product_accounts, and then get products from that? For reference, I am doing this if I were querying with a product_account_id new productAccountModel() .where({account_id: 1}) .fetchAll({withRelated: ['product']}) .then(function(productAccounts) { return productAccounts.toJSON()); });
answer count: 1
has title: Bookshelfjs where clause on join
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/29875628
accepted answer: http://stackoverflow.com/a/29875628
favorite count: 0
upvote count: 1
tagged with: knex.js
type: AnsweredQuestion
tagged with: bookshelf.js
score: 1
type: Question

http://stackoverflow.com/a/29956944
has comment: http://stackoverflow.com/comment/48038042
type: Answer
accepted answer of: http://stackoverflow.com/q/29953740
score: 10
answers question: http://stackoverflow.com/q/29953740
upvote count: 10
has comment: http://stackoverflow.com/comment/48055794
has comment: http://stackoverflow.com/comment/48059604
type: AcceptedAnswer
downvote count: 0
has body: To abide by the rule, you'll just need to rewrite event.wheelDelta / 120 and the following line so that the / sticks to the following expression: event.wheelDelta /120. if ( event.wheelDelta ) delta = event.wheelDelta /120; else if ( event.detail ) delta = -event.detail /3; The disallowSpaceAfterBinaryOperators: true line is causing this. You can see the docs here: disallowSpaceAfterBinaryOperators.

http://stackoverflow.com/q/29870983
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47866897
tagged with: conditional-statements
possible better answer: http://stackoverflow.com/a/29871032
tagged with: javascript
score: 0
answer count: 3
has comment: http://stackoverflow.com/comment/47866934
has comment: http://stackoverflow.com/comment/47867112
linked to: http://stackoverflow.com/q/337878
has answer: http://stackoverflow.com/a/29871042
has body: This may be a novice question but I am trying to create a function that returns true. However, this is based on what happens within several other functions inside. function checkGeo(){ // CHECK FOR GEOLOCATION if( "geolocation" in navigator ) { navigator.geolocation.getCurrentPosition( function(position){ sessionStorage.pinlat = position.coords.latitude; sessionStorage.pinlon = position.coords.longitude; // position object is set! }); // position is not defined if ( position.coords.latitude &amp;&amp; position.coords.longitude ){ return true; } } } This is the order I want things to happen with my geolocation check but I'm a bit surprised that the nested if is tested before the getCurrentPosition method finishes. Putting this condition within the getCurrentPosition success function and returning true from there does not make checkGeo return true. How do I check if this asyncronous function has ended and therefore check its results in order to return true?
has answer: http://stackoverflow.com/a/29871032
has title: Best way to 'return true' based on conditions from nested functions
has answer: http://stackoverflow.com/a/29871057
accepted answer: http://stackoverflow.com/a/29871057
tagged with: return-value
type: Question

http://stackoverflow.com/q/29978584
possible better answer: http://stackoverflow.com/a/29978788
upvote count: 1
has answer: http://stackoverflow.com/a/29978788
type: Question
accepted answer: http://stackoverflow.com/a/29978624
tagged with: javascript
answer count: 3
has answer: http://stackoverflow.com/a/29978934
downvote count: 0
favorite count: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/29978624
has body: How can i optimise the duplicate code here angular.module('myApp') .controller('LogsController', function ($scope, LogsService) { $scope.updatingLogs = true; $scope.loggers = {}; LogsService.findAll().$promise.then(function(data) { $scope.loggers = data; $scope.updatingLogs = false; }); $scope.changeLevel = function (name, level) { LogsService.changeLevel({name: name, level: level}, function () { $scope.updatingLogs = true; LogsService.findAll().$promise.then(function(data) { $scope.loggers = data; $scope.updatingLogs = false; }); }); }; });
type: AnsweredQuestion
score: 1
tagged with: angularjs-controller
has title: optimise angular duplicate code

http://stackoverflow.com/q/29871280
type: Question
has comment: http://stackoverflow.com/comment/47867500
has comment: http://stackoverflow.com/comment/47867524
has comment: http://stackoverflow.com/comment/47867581
tagged with: timezone
score: 0
answer count: 1
has body: I want to show the time from the timezone chosen by me on my webpage. I found the way to show the current time as it's presented here http://www.webestools.com/ftp/ybouane/scripts_tutorials/javascript/date_time/date_time.html : Display Date and Time in Javascript and JS: function date_time(id) { date = new Date; year = date.getFullYear(); month = date.getMonth(); months = new Array('January', 'February', 'March', 'April', 'May', 'June', 'Jully', 'August', 'September', 'October', 'November', 'December'); d = date.getDate(); day = date.getDay(); days = new Array('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'); h = date.getHours(); if(h<10) { h = "0"+h; } m = date.getMinutes(); if(m<10) { m = "0"+m; } s = date.getSeconds(); if(s<10) { s = "0"+s; } result = ''+days[day]+' '+months[month]+' '+d+' '+year+' '+h+':'+m+':'+s; document.getElementById(id).innerHTML = result; setTimeout('date_time("'+id+'");','1000'); return true; } but if I understand it correctly - it always shows the current time from the timezone of the viewer of the page. So when someone logs in there from e.g. Australia - he will see his result, and the guy from Poland will see sth completely different. I would like to present on the webpage the current time in fixed timezone, let's say e.g. in New York. How should I modify this script to get the expected results? Thanks!
linked to: http://stackoverflow.com/q/15141762
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/29754334
has title: How can I show the current time from a different timezone on my webpage?
has answer: http://stackoverflow.com/a/29871337
has comment: http://stackoverflow.com/comment/47867534
tagged with: javascript
has comment: http://stackoverflow.com/comment/47869260

http://stackoverflow.com/q/29887107
has comment: http://stackoverflow.com/comment/48163342
score: 0
has body: I am reading a bout $http service in a book. There is a sample that I do understand the whole sample except the url part. I do not understand where is the url? or how can I find it? module.factory('memberDataStoreService', function ($http) { var memberDataStore = {}; memberDataStore.doRegistration = function (theData) { var promise = $http({method: 'POST', url: 'memberservices/register', data: theData}); return promise; } return memberDataStore; even in my error promise , I try to see what kind of status my error has , I just get zero promise.error(function (data, status) { $scope.showErrorMessage = true; $scope.wrong = status; }); this is my code for printing the error message &lt;div class="error" ng-show="showErrorMessage"&gt; There appears to have been a problem with your registration.&lt;br/&gt; {{wrong}} &lt;br/&gt; &lt;/div&gt; I get this error when I try to debug it Failed to load resource: net::ERR_EMPTY_RESPONSE http://localhost:8383/CustomService/memberservices/register Failed to load resource: net::ERR_EMPTY_RESPONSE
has comment: http://stackoverflow.com/comment/48163194
has comment: http://stackoverflow.com/comment/48163134
answer count: 1
has comment: http://stackoverflow.com/comment/48162906
has comment: http://stackoverflow.com/comment/48163418
has comment: http://stackoverflow.com/comment/48162919
has title: Meaning URL in $http service
tagged with: angularjs
has comment: http://stackoverflow.com/comment/48163014
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47898137
has comment: http://stackoverflow.com/comment/48163413
has comment: http://stackoverflow.com/comment/48163286
has answer: http://stackoverflow.com/a/30022970
type: Question
has comment: http://stackoverflow.com/comment/48163103
has comment: http://stackoverflow.com/comment/48162993
tagged with: javascript

http://stackoverflow.com/q/29901178
type: AnsweredQuestion
upvote count: 3
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/29901277
type: Question
score: 3
tagged with: autocomplete
tagged with: javascript
has body: This scripts are used, https://www.devbridge.com/sourcery/components/jquery-autocomplete/ I am using jQuery Autocomplete for searching users from my DB. Below is controller which returns Json: public function searchusers1() { if ($_GET) { $query = $this -&gt; input -&gt; get('query'); $searcharray = $this -&gt; model_usermanage -&gt; searchuser($query); $a_json = array(); $a_json_row = array(); foreach($searcharray as $row) { //$user_firstname = htmlentities(stripslashes($row['user_firstname'])); //$user_lastname = htmlentities(stripslashes($row['user_lastname'])); $user_email = htmlentities(stripslashes($row['user_email'])); //$a_json_row["user_firstname"] = $user_firstname; $a_json_row["user_email"] = $user_email; array_push($a_json, $a_json_row); } echo json_encode($a_json); } } Below is my jQuery: $('#reply_bcc').autocomplete({ serviceUrl: '&lt;?php echo base_url(); ?&gt;index.php/hi/test/searchusers1', minChars: 3, onSelect: function (suggestion) { console.log('You selected: ' + suggestion.data + ', ' + suggestion.data); } }); Here is my JSON response: [{"user_email":"hi@test.com"},{"user_email":"hello@au.com"},{"user_email":"testing@123.com"},] My HTML: &lt;div class="col-md-10"&gt; &lt;input type="text" name="reply_bcc" id="reply_bcc" autocomplete="off" class="form-control"&gt; &lt;/div&gt; My PROBLEM is: I am getting below error in console and I can not see this searched values as dropdown in my html input: Uncaught TypeError: Cannot read property 'length' of undefined What's going wrong with this? Thanks!
answer count: 2
accepted answer: http://stackoverflow.com/a/29901277
downvote count: 0
possible better answer: http://stackoverflow.com/a/53201912
tagged with: jquery
has answer: http://stackoverflow.com/a/53201912
favorite count: 0
has title: Uncaught TypeError: Cannot read property 'length' of undefined JQUERY autocomplete
has comment: http://stackoverflow.com/comment/47925143

http://stackoverflow.com/comment/47881568
type: AnswerComment
score: 0
type: Comment
has text: It's a good practice to place Javascript libraries (jquery.min.js, bootstrap.min,js etc.) just before the closing body tag ` `. If you are making calls to any functions in those libraries, place it after you have linked them, again just before the closing ` ` tag
comment on: http://stackoverflow.com/a/29878656

http://stackoverflow.com/q/29872725
answer count: 3
has answer: http://stackoverflow.com/a/29880507
has answer: http://stackoverflow.com/a/29872823
score: 2
has comment: http://stackoverflow.com/comment/47881022
has comment: http://stackoverflow.com/comment/47870543
has body: So basically the problem is that Q swallows my exceptions that are not meant to reject the promises, but to crash the application as early as possible, so that I know what exactly is broken. I know that I can (and probably should) use the done method at the end of the chain, but it's really a pain in a butt to keep track of the chain ends. And it doesn't help much because it doesn't prevent Q from catching it and once cached the exception looses it's stack trace. Is there a way to crash early when the exception is thrown rather than propagate the rejection up the chain hoping there is done at the end of it?
downvote count: 0
tagged with: javascript
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/q
has comment: http://stackoverflow.com/comment/47878688
has answer: http://stackoverflow.com/a/29872762
favorite count: 0
has title: Crashing the application from within a Q promise instead of propagate a rejection through a chain of promises?
has comment: http://stackoverflow.com/comment/47880503
tagged with: promise
has comment: http://stackoverflow.com/comment/47870587
type: Question
upvote count: 2
has comment: http://stackoverflow.com/comment/47872481
has comment: http://stackoverflow.com/comment/47877837

http://stackoverflow.com/comment/48052933
has text: Seems like it's not working in Firefox though.
comment on: http://stackoverflow.com/q/29966208
type: QuestionComment
type: Comment
score: 0

http://stackoverflow.com/comment/48090286
type: Comment
comment on: http://stackoverflow.com/a/29981624
type: AnswerComment
score: 0
has text: The loop is must be something like this also: `['1/05/2015', 80]` So the date and then the count of the IP-adressess that day. It needs to loop that, not everything inside an array. So: `['1/05/2015', 80], ['2/05/2015', 852]` etc...

http://stackoverflow.com/comment/47892296
score: 0
type: AnswerComment
has text: @ThisClark I borrowed adeneo's punctuation string. It should work for that now.
type: Comment
comment on: http://stackoverflow.com/a/29884092

http://stackoverflow.com/q/29861597
possible better answer: http://stackoverflow.com/a/29964759
has answer: http://stackoverflow.com/a/29964759
has body: I am new to jQuery and I have been trying to look up the Bootstrap transition.js (line 50) code and figure out how it works in there. I have stumbled across the following: $.event.special.bsTransitionEnd = { bindType: $.support.transition.end, delegateType: $.support.transition.end, handle: function (e) { if ($(e.target).is(this)) return e.handleObj.handler.apply(this, arguments) } I have read the documentation, but couldn't really understand much except the following: bindType: // the event you want to bind with delegateType: // the event you want to delegate with After some research I have found the following: Those are the special attributes for the transition end event that are made available for later use in transition.js. I am trying to figure out things by reading this article, but all I want to know is: what is $.event.special, what is the use of this line? What is it's common usage? P.S.: I read this question but it has more external links than the answer itself. Is there a clear canonical Q&amp;A about the most basic use of $.event.special?
has title: What is “jQuery.event.special”?
accepted answer: http://stackoverflow.com/a/29867037
downvote count: 2
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47849294
has comment: http://stackoverflow.com/comment/47849230
type: Question
answer count: 2
upvote count: 20
score: 18
tagged with: javascript
has answer: http://stackoverflow.com/a/29867037
tagged with: jquery
favorite count: 0
linked to: http://stackoverflow.com/q/8919620

http://stackoverflow.com/q/29893190
has title: Plot d3 chart on to Leaflet / Mapbox map
score: 4
tagged with: http://stackoverflow.com/tag/svg
tagged with: mapbox
tagged with: d3.js
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29897887
tagged with: leaflet
type: Question
upvote count: 4
has body: I have a radial d3 chart that I would like to plot / overlay on to a Leaflet / Mapbox map at lat,long co-ordinates. I have looked around and the solutions all seem to be plotting circles onto the map using cx, cy positions, which is not what I need. Can I add the SVG surrounding the chart to the map? Below is the code and a link to the radial chart (which may or may not be of any use for this question as I just want to know how to plot an SVG on to the map) CODE FOR D3 CHART var width = 300; var height = 300; var twoPi = 2 * Math.PI; // Full circle var formatPercent = d3.format(".0%"); var data = [{ "range": "0-20", "count": 20 }, { "range": "21-40", "count": 10 }, { "range": "41-60", "count": 17 }, { "range": "61-80", "count": 49 }, { "range": "81-100", "count": 90 }]; var max = d3.max(data, function(d) { return +d.count; }); var percent = d3.max(data, function(d) { return +d.count / 10; }); var radiusBackground = .25; var radiusForeground = .25; var gap = 28; var maxCount = max + percent; var svg = d3.select(map.getPanes().overlayPane).append("svg") .attr("width", 1000) .attr("height", 1000) .attr("transform", "translate(" + map.latLngToLayerPoint(latLng).x + "," + map.latLngToLayerPoint(latLng).y + ")"); var g = svg.append("g") .attr("transform", "translate(" + width / 10 + "," + height / 10 + ")") .attr("class", "leaflet-zoom-hide"); var background = g.selectAll(".twoPi") .data(data).enter() .append("path") .attr("class", "twoPi") .each(full); var foreground = g.selectAll(".outerPath") .data(data).enter() .append("path") .attr("class", "outerPath") .each(drawArc); map.on("viewreset", update); update(); function update() { foreground.attr("transform", function(d) { return "translate("+ map.latLngToLayerPoint(latLng).x/10000 +","+ map.latLngToLayerPoint(latLng).y/10000 +")"; } ) background.attr("transform", function(d) { return "translate("+ map.latLngToLayerPoint(latLng).x/10000 +","+ map.latLngToLayerPoint(latLng).y/10000 +")"; } ) } function full() { var arc = …
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0

http://stackoverflow.com/q/29900541
tagged with: spacebars
has answer: http://stackoverflow.com/a/40602195
possible better answer: http://stackoverflow.com/a/33972738
type: AnsweredQuestion
score: 3
has answer: http://stackoverflow.com/a/33972738
has title: How Do I Properly Scope Nested #each Spacebars Iterators When Using Meteor?
has answer: http://stackoverflow.com/a/29900738
type: Question
has body: I have these nested iterators: {{#each detailsCollection}} {{detail}} x {{#each messagesCollection}} {{#if isMessageForThisDetail}} {{message.message}} {{/if}} {{/each}} {{/each}} And I understand that I can access parent attributes from child template via handlebars path, from docs: {{./name}} or {{this/name}} or {{this.name}} But I need my helper isMessageForThisDetail to compare an attribute of the currently iterated messageCollection to the currently iterated parent detailsCollection. My helper for that looks like this: isMessageForThisDetail: function(){ var message = messagesCollection.findOne({detailId: this._id}); if(message != undefined){ return this._id == message._id; } else { console.log('there is no message for this detail'); } } But the context of this._id is the message, not the _id of the detail I want to compare a field of the message to.
downvote count: 0
tagged with: javascript
tagged with: meteor
favorite count: 0
answer count: 3
accepted answer: http://stackoverflow.com/a/29900738
upvote count: 3

http://stackoverflow.com/q/29887513
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29887551
has answer: http://stackoverflow.com/a/29887577
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
type: UnansweredQuestion
has title: jquery ui dialog box not opening in html on click of a link
tagged with: css
downvote count: 0
score: 1
type: Question
answer count: 2
tagged with: jquery-ui
has body: I am trying to open a dialog box in html page on click of a link but its showing me an error like-Object doesn't support property or method 'dialog' on click in ie. Please check my code below source files Dialog code $("#link").click(function(c){ e.preventDefault(); var dialog = $(' Are you sure? ').dialog({ buttons: { "Yes": function() {alert('you chose yes');}, "No": function() {alert('you chose no');}, "Cancel": function() { dialog.dialog('close'); } } }); }); });

http://stackoverflow.com/comment/47958225
comment on: http://stackoverflow.com/a/29913550
type: Comment
score: 0
has text: I am glad that my answer helps you. I am the very newbie. Please, accept and promote up the answer.
type: AnswerComment

http://stackoverflow.com/a/29893305
has comment: http://stackoverflow.com/comment/47910040
answers question: http://stackoverflow.com/q/29893259
has comment: http://stackoverflow.com/comment/47909985
has comment: http://stackoverflow.com/comment/47909804
has comment: http://stackoverflow.com/comment/47910355
upvote count: 4
has body: You can tweak your markup/CSS and achieve this by using the below approach (updated with some of your code), which I wrote some time back. Note that this also wraps your inputs within a more semantic fieldset structure, as well as better UI in terms of currently hovered / currently selected items. If part of a form, the relevant value will also be correctly submitted. $('.rating input').change( function() { $('#choice').text(this.value + ' stars'); } ) .rating { float: left; border: none; } .rating:not(:checked) > input { position: absolute; top: -9999px; clip: rect(0, 0, 0, 0); } .rating:not(:checked) > label { float: right; width: 1em; padding: 0 .1em; overflow: hidden; white-space: nowrap; cursor: pointer; font-size: 200%; line-height: 1.2; color: #ddd; } .rating:not(:checked) > label:before { content: '★ '; } .rating > input:checked ~ label { color: #f70; } .rating:not(:checked) > label:hover, .rating:not(:checked) > label:hover ~ label { color: gold; } .rating > input:checked + label:hover, .rating > input:checked + label:hover ~ label, .rating > input:checked ~ label:hover, .rating > input:checked ~ label:hover ~ label, .rating > label:hover ~ input:checked ~ label { color: #ea0; } .rating > label:active { position: relative; } 5 stars 4 stars 3 stars 2 stars 1 star
downvote count: 0
score: 4
type: Answer

http://stackoverflow.com/q/29895541
favorite count: 0
type: UnansweredQuestion
score: 6
upvote count: 6
tagged with: java
tagged with: hibernate
type: Question
has title: Hibernate and Thymeleaf infinite recursion
tagged with: javascript
tagged with: thymeleaf
has body: I have 2 classes with one atribute mapped with OneToMany/ManyToOne relation. The problem is that when i do the select and pass to te view, i want to parse the object to javascript with Thymeleaf, but it loop infinite cause of the relation. My to classes: Class Player: @Entity @Table(name = "player") public class Player { @Id @Column(name = "id") @GeneratedValue private int id; @Column(name = "level") private int level; @Column(name = "experience") private int experience; @OneToMany(mappedBy="player", cascade = CascadeType.ALL) private List&lt;InventoryItem&gt; inventory; // Constructor public Player() { } // Getters &amp; Setters... } Class InventoryItem: @Entity @Table(name = "inventory_item") public class InventoryItem { @Id @GeneratedValue @Column(name = "id") private int id; @ManyToOne @JoinColumn(name="id_player") private Player player; public InventoryItem() { } //Getters and Setters... } Then i pass the Player object to the view and console.log it with javascript: &lt;script th:inline="javascript"&gt; /*&lt;![CDATA[*/ console.log([[${player}]]); /*]]&gt;*/ &lt;/script&gt; And this is the error: How can i prevent the bi-directional relation when parsing to javascript, something like ignore the Player atrubute from all the InventoryItems?
has answer: http://stackoverflow.com/a/31911109
downvote count: 0
answer count: 1

http://stackoverflow.com/q/29875703
downvote count: 0
tagged with: javascript
possible better answer: http://stackoverflow.com/a/29875819
score: 4
has comment: http://stackoverflow.com/comment/47875846
favorite count: 0
has answer: http://stackoverflow.com/a/29875819
tagged with: rest
has answer: http://stackoverflow.com/a/29875774
answer count: 3
tagged with: angularjs-http
has comment: http://stackoverflow.com/comment/47884430
tagged with: angularjs
has answer: http://stackoverflow.com/a/29875798
has body: My purpose is to consume a REST web service in AngularJS and I am making some trials right now. Below code is not working and throwing following exception. Can you help me identifty the problem? Thanks in advance. function getUsersFromLocal($scope,$http) { $http.get('http://localhost:8080/people'). success(function(data) { $scope.data = data; }); return data; } Error is: TypeError: Cannot read property 'get' of undefined at getUsersFromLocal. The service is accessible and I tested it through some REST clients.
accepted answer: http://stackoverflow.com/a/29875774
type: AnsweredQuestion
type: Question
upvote count: 4
has title: Angularjs $http.get does not work

http://stackoverflow.com/q/29913013
type: UnansweredQuestion
has body: So I'm trying to read data and then pass that to another function so I can draw a path. The data is fine, it's all working and I can view it in the console. The normal drawing (Using the onMouseEvent) functions work fine. The only way I can get it to draw using a different function, is if I declare the path at the top of the JS file: var reloadPath = new Path(); The problem with this, is that when I call reloadPath, it automatically connects the lines (even if the user has clicked elsewhere) which is what I don't want. I've tried var reloadPath; at the start of the file, and then this function reloadDrawing(data) { reloadPath = new Path(); reloadPath.strokeColor = 'black'; reloadPath.add(data); view.draw(); } But this just doesn't draw anything. Thanks. edit: Tried the amendments but they didn't work. I'm using Jade instead of HTML (using node.js) so theres really nothing in my html: using socket.io as well JS: This does all the dynamic drawing stuff io.on( 'reloadDrawing', function( data ) { console.log("fired"); endDrawing(data); startDrawing(data); }); function endDrawing(data){ reloadPath.add(data); view.draw(); reloadPath = new Path(); } function startDrawing(data) { reloadPath = new Path(); reloadPath.strokeColor = 'black'; reloadPath.add(data); view.draw(); }
has title: Paper.JS create another function to draw a path
has answer: http://stackoverflow.com/a/29913110
score: 0
type: Question
tagged with: javascript
answer count: 1
tagged with: paperjs

http://stackoverflow.com/a/29845340
score: 1
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/29845295
has body: When using jQuery 1.9+ the attr('checked') gets the initial state of the checkbox when its state changes you need to use the prop() function. $('#true').prop('checked');
accepted answer of: http://stackoverflow.com/q/29845295
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/29947665
has comment: http://stackoverflow.com/comment/48132856
has comment: http://stackoverflow.com/comment/48104037
downvote count: 0
answer count: 1
tagged with: javascript
score: 15
has comment: http://stackoverflow.com/comment/48102753
has answer: http://stackoverflow.com/a/29992995
has comment: http://stackoverflow.com/comment/48102487
tagged with: file-upload
has comment: http://stackoverflow.com/comment/48188741
favorite count: 0
has comment: http://stackoverflow.com/comment/48133087
has comment: http://stackoverflow.com/comment/48102567
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/48102982
has comment: http://stackoverflow.com/comment/48133046
has body: I have a generic file up loader which looks like this: &lt;span class="input-group-btn"&gt; &lt;span class="btn btn-default btn-fill btn-file"&gt; Browse&lt;input type="file" id="fileInputs" multiple accept="image/*" onclick="resetprogresss()"&gt; &lt;/span&gt; &lt;/span&gt; I can upload multiple files with my Desktop no problems, but When I try and use the same functionality on a mobile device, I cannot seem to select multiple files. here is the javascript: var Filenames; function generateUUID() { var d = new Date().getTime(); var uuid = 'xxxxxxxxxxx'.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; }; var MainPath = generateUUID(); var Names = []; function UploadFiles() { var SetDir = MainPath; var fileInputs = document.getElementById("fileInputs"); if ('files' in fileInputs) { if (fileInputs.files.length == 0) { alert("Please select a file"); return; } else { var file = fileInputs.files[0]; var ar = $("#AutoResumeBoxs").is(":checked"); var chunksize = 20000; var name = SetDir; /* Arguments: username name used to create subfolders on the server. files files object from the file input tag. uploadStartFunction function that receives a file object just before uploading. progressFunction function that accepts a percent-complete integer value. doneFunction function called when file is uploaded. errorFunction function called when an error occurs. chunkSize size in bytes of each chunk uploaded. autoResume bool to control auto resuming. */ CFUpload(name, fileInputs.files, uploadStarts, progresss, dones, errors, chunksize, ar); } } } function uploadStarts(thisfile) { Names.push(thisfile.name); } function progresss(percent) { var p = percent + "%"; $("#lblUPs").text(p); $("#progressbars").width(p); $("#progressbars").attr("data-appear-progress-animation", p); $("#ProgressTabs").text(p); } function resetprogresss() { progresss(0); } function dones() { …
has comment: http://stackoverflow.com/comment/48102171
has title: Input file upload multiple files not working on Mobile device
type: Question
has comment: http://stackoverflow.com/comment/48102279
upvote count: 15

http://stackoverflow.com/a/29950973
has comment: http://stackoverflow.com/comment/48078084
has comment: http://stackoverflow.com/comment/48185608
score: 18
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/99522946
has comment: http://stackoverflow.com/comment/48184018
accepted answer of: http://stackoverflow.com/q/29949331
has comment: http://stackoverflow.com/comment/48071000
upvote count: 18
type: Answer
answers question: http://stackoverflow.com/q/29949331
has comment: http://stackoverflow.com/comment/48023858
has comment: http://stackoverflow.com/comment/99530194
downvote count: 0
has comment: http://stackoverflow.com/comment/48069043
has comment: http://stackoverflow.com/comment/48185842
has comment: http://stackoverflow.com/comment/48069297
has body: Well this is not converting the jQuery code to javascript, but rather doing it in plain javascript. It can be achieved in different ways. Here are two that comes to my mind: HTML: SlideToggle Some context 1. Using javascript's setInterval : Having a boolean value to keep track of whether we need to slideUp or slideDown (toggle) and using setInterval to increase/decrease the height. jsfiddle DEMO Javascript: var slideOpen = true; var heightChecked = false; var initHeight = 0; var intval = null; function slideToggle() { window.clearInterval(intval); var mdiv = document.getElementById('mdiv'); if(!heightChecked) { initHeight = mdiv.offsetHeight; heightChecked = true; } if(slideOpen) { var h = initHeight; slideOpen = false; intval = setInterval(function(){ h--; mdiv.style.height = h + 'px'; if(h <= 0) window.clearInterval(intval); }, 1 ); } else { var h = 0; slideOpen = true; intval = setInterval(function(){ h++; mdiv.style.height = h + 'px'; if(h >= initHeight) window.clearInterval(intval); }, 1 ); } } 2. Using CSS3 transition: Getting help from CSS3 transition to go along with javascript which will make it a lot easier to achieve the slide effect. Then we'll only need to change the height in javascript and the rest is done. jsfiddle DEMO CSS: #mdiv { /* other styles */ -webkit-transition: all 1s ease-in-out; transition: all 1s ease-in-out; } Javascript: var slideOpen = true; var heightChecked = false; var initHeight = 0; function slideToggle() { var mdiv = document.getElementById('mdiv'); if(!heightChecked) { initHeight = mdiv.offsetHeight; heightChecked = true; } if(slideOpen) { slideOpen = false; mdiv.style.height = '0px'; } else { slideOpen = true; mdiv.style.height = initHeight + 'px'; } } EDIT: If we want the starting height to be 0, then we'll need a few changes: var slideOpen = false; //var heightChecked = false; var initHeight = 120; //height of the element when it's fully open And we need to comment this bit out: /* if(!heightChecked) { initHeight = mdiv.offs…
has comment: http://stackoverflow.com/comment/48180416

http://stackoverflow.com/a/29963970
has comment: http://stackoverflow.com/comment/48048247
has comment: http://stackoverflow.com/comment/48048484
type: Answer
has body: instead of this line $event.currentTarget.slideToggle() Try using this way, angular.element($event.currentTarget).slideToggle(); angular.element is an alias of jQuery in angularjs If jQuery is available, angular.element is an alias for the jQuery function. If jQuery is not available, angular.element delegates to Angular's built-in subset of jQuery, called "jQuery lite" or "jqLite."
score: 4
answers question: http://stackoverflow.com/q/29963905
accepted answer of: http://stackoverflow.com/q/29963905
upvote count: 4
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/48048365

http://stackoverflow.com/comment/48108490
score: 0
comment on: http://stackoverflow.com/a/29993913
type: Comment
has text: Spot on, thanks a lot. Knew I was close to getting it, I had also tried that! But just hadn't used speech marks around it.
type: AnswerComment

http://stackoverflow.com/q/29997381
has answer: http://stackoverflow.com/a/29997973
type: Question
answer count: 2
tagged with: algorithm
has comment: http://stackoverflow.com/comment/48114549
has comment: http://stackoverflow.com/comment/48114520
tagged with: javascript
tagged with: date
has answer: http://stackoverflow.com/a/29998044
score: 0
has body: I am doing some enhancements of a date library which already returns differences in date units as expressed in the title of this question. I want it to return relative units. I've written some code, but it feels like I am working from the wrong end of the math. Note: Forget about leap years and other DateTime intricacies. This is for a non-exacting application. Here is the code under consideration. // get ms between UTC dates and make into "difference" date var iDiffMS = dt2.valueOf() - dt1.valueOf(); var dtDiff = new Date(iDiffMS); // calc various diffs var nYears = dt2.getUTCFullYear() - dt1.getUTCFullYear(); var nMonths = dt2.getUTCMonth() - dt1.getUTCMonth() + (nYears!=0 ? nYears*12 : 0); var nQuarters = parseInt(nMonths / 3); //&lt;&lt;-- different than VBScript, which watches rollover not completion // these are in absolute terms, ie totals of unit differences, 1/2/1981 - 1/1/1980 = 1y 366d var nMilliseconds = iDiffMS; var nSeconds = parseInt(iDiffMS / 1000); var nMinutes = parseInt(nSeconds / 60); var nHours = parseInt(nMinutes / 60); var nDays = parseInt(nHours / 24); // &lt;-- now fixed for DST switch days var nWeeks = parseInt(nDays / 7); // save absolutes var nYears0=nYears; var nMonths0=nMonths; var nQuarters0=nQuarters; var nWeeks0=nWeeks; var nDays0=nDays; var nHours0=nHours; var nMinutes0=nMinutes; var nSeconds0=nSeconds; // HERE! go from absolute to relative, 1/2/1981 - 1/1/1980 = 1y 1d etc, not 1y 366d etc nQuarters -=nYears0*4; nMonths -=nYears0*12; nWeeks -=parseInt((nYears0*52)+(nMonths0*(365.25/52))); nCalWeeks -=parseInt((nYears0*52)+(nMonths0*(365.25/52))); nQuarters -=nYears0*4; nDays -=parseInt((nYears0*365.25) +(nMonths*(365.25/12))); nHours -=parseInt((nYears0*365.25*24) +(nMonths*(365.25/12*24)) +(nDays*24)); nMinutes -=parseInt((nYears0*365.25*24*60) +(nMonths*(365.25/12*24*60)) +(nDays*24*60) +(nHours*60)); nSeconds -=parseInt((nYears0*365.25*24*60*60) +(nMonths*(365.25/12*24*60*60)) +(nDays*24*60*60) +(nHours*60*60) +(nMinutes*60)); nM…
has title: Relative Date: 1/1/1981 01:01:01 - 1/1/1980 = 1y 366d ect, want 1y 1d etc
tagged with: time
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/48114903
tagged with: datetime

http://stackoverflow.com/q/29985018
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/48089443
type: Question
has body: I've faced with problem: When I set overflow:hidden style to html tag, my page scrolls to top on my laptop(windows 8.1, chrome 42.0.2311.135m - last), but in IE and all browsers on my mac - everything is ok. Here an example:https://jsfiddle.net/thrr35ee/1/; $('document').ready(function(){ $(document).scroll(function(){ var b = $(document).scrollTop(); if(b &gt; 400){ $('html').css('overflow','hidden'); } }); }); Why it happens? How to fix it? I tried to save position before setting overflow and after it scroll to position, but it works only if I do it after 1 second. UPD: It happens when I scroll the page while holding the mouse on the scrollbar, if I scroll by keys(up and down) - everything is ok.
has comment: http://stackoverflow.com/comment/48089796
has comment: http://stackoverflow.com/comment/48089953
tagged with: javascript
has comment: http://stackoverflow.com/comment/48089505
score: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has title: Browser automatically scrolls to top when set overflow=hidden to html tag
answer count: 0

python
tags question: http://stackoverflow.com/q/29845531
tags question: http://stackoverflow.com/q/29974743
tags question: http://stackoverflow.com/q/29935066
tags question: http://stackoverflow.com/q/29882805
tags question: http://stackoverflow.com/q/29962014
tags question: http://stackoverflow.com/q/29982072
tags question: http://stackoverflow.com/q/29977261
tag name: python
tags question: http://stackoverflow.com/q/29864178
tags question: http://stackoverflow.com/q/29944754
tags question: http://stackoverflow.com/q/29950445
tags question: http://stackoverflow.com/q/29920677
tags question: http://stackoverflow.com/q/29976625
tags question: http://stackoverflow.com/q/29928117
tags question: http://stackoverflow.com/q/29966204
tags question: http://stackoverflow.com/q/29861229
tags question: http://stackoverflow.com/q/29993882
tags question: http://stackoverflow.com/q/29997475
type: Tag
tags question: http://stackoverflow.com/q/29932729
tags question: http://stackoverflow.com/q/29868301
tags question: http://stackoverflow.com/q/29848141
tags question: http://stackoverflow.com/q/29999482
tags question: http://stackoverflow.com/q/29858565
tags question: http://stackoverflow.com/q/29987323
tags question: http://stackoverflow.com/q/29982172
tags question: http://stackoverflow.com/q/29845275
tags question: http://stackoverflow.com/q/29934729
tags question: http://stackoverflow.com/q/29886348
tags question: http://stackoverflow.com/q/29957684

http://stackoverflow.com/q/29860884
has body: I have below regular expression for email validation but I want to customize this regular for user can input number from zero to nine. Example: heng18374sopheak@yahoo.com, 12948sopheak@yahoo.com, sopheak876@gmail.com Here is email validation which let user input character only can't input number This is Email validation Regular Expression which avoid user input number (0-9) But I want my user can input that number(0-9).So How could I customize this below regular expression? /(^[a-z]([a-z_\.]*)@([a-z_\.]*)([.][a-z]{3})$)|(^[a-z]([a-z_\.]*)@([a-z_\.]*)(\.[a-z]{3})(\.[a-z]{2})*$)/i But I want to customize those code which let user could input number from zero to nine. Thanks for help
favorite count: 0
possible better answer: http://stackoverflow.com/a/29861028
accepted answer: http://stackoverflow.com/a/29860949
tagged with: regex
has comment: http://stackoverflow.com/comment/47847726
has title: How to customize regular expression which let user can input number from zero to nine?
downvote count: 1
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47847630
has comment: http://stackoverflow.com/comment/47847651
score: -1
has answer: http://stackoverflow.com/a/29860949
has comment: http://stackoverflow.com/comment/47847628
type: Question
answer count: 2
upvote count: 0
has answer: http://stackoverflow.com/a/29861028
tagged with: javascript

http://stackoverflow.com/a/29999661
type: Answer
has body: Not sure I fully understood the question, how about: {{#each ../../Flight.LegsOut}} {{/each}}
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29999536
accepted answer of: http://stackoverflow.com/q/29999536
score: 0

http://stackoverflow.com/comment/47864873
comment on: http://stackoverflow.com/a/29868214
score: 0
type: AnswerComment
has text: What is better, use `React.createClass` or ES6 classes?
type: Comment

http://stackoverflow.com/q/29951567
type: AnsweredQuestion
has title: Sinon, nested stubbing
type: Question
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/29959606
score: 0
tagged with: sinon
has body: I am trying to stub out a module and the return inside of it and having a little trouble. Here is what I have var CrowdControlGet = sinon.stub(); var CrowdControl = sinon.stub().returns({ get: CrowdControlGet }); this does not seem to work, but when I just have var CrowdControl = testHelpers.stub() it works fine, how do i get it to return a get inside which is also a stub? Thanks!
accepted answer: http://stackoverflow.com/a/29959606

http://stackoverflow.com/comment/48116671
type: Comment
type: QuestionComment
has text: Sorry guys, im using gulp to combine all the ng .js files into /app.js
comment on: http://stackoverflow.com/q/29998462
score: 0

http://stackoverflow.com/comment/47999441
type: QuestionComment
comment on: http://stackoverflow.com/q/29939170
has text: You're asigning data to local variable pots, try assigning it to $scope.pots in the callback
score: 3
type: Comment

http://stackoverflow.com/q/29986037
has title: cant access element in dialog title
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
type: Question
has answer: http://stackoverflow.com/a/29986207
tagged with: web
has body: I can't seem to get a reference to the on click events of buttons in the titlebar but if they are in the regular content area of the dialog I can click them. Can anyone point me in the right direction to be able to register click events from the buttons in the title bar? // Define the player details window dialog var dialog = $(".graph-container").dialog({ autoOpen: false, modal: true, show: { effect: "clip", duration: 1000 }, hide: { effect: "explode", duration: 2000, complete: function () { console.log('complete'); } }, width: modalWindow.width, height: modalWindow.height, resizable: false, beforeClose: function (event, ui) { console.log('before close function'); }, position: { my: 'center', at: 'center', of: window } }); // Override the undocumented _title property to allow HTML in the title // More info: http://stackoverflow.com/questions/4103964/icons-in-jquery-ui-dialog-title dialog.data("uiDialog")._title = function (title) { title.html(this.options.title); }; dialog.dialog('option', 'title', 'Stats for ' + player.PlayerName + ' - Last ' + $scope.gameFilter + ' games' + ' ' + ' 5 ' + ' 25 ' + ' 100 ' + ' '); $(".graph-container").dialog("open"); $('.dateButton').click(function () { var btn = this; console.log('Date button clicked'); });
answer count: 1
tagged with: jquery-ui
linked to: http://stackoverflow.com/q/4103964
score: 0

http://stackoverflow.com/a/29864811
score: 1
type: Answer
accepted answer of: http://stackoverflow.com/q/29860387
answers question: http://stackoverflow.com/q/29860387
has body: The main thing you have to do is ensure that promises are pushed onto the array synchronously. With deferreds.push(...) burried inside a done callback, the push() is asynchronous and the array is guaranteed still to be empty when $.when.apply(...) is executed. Some other issues can also be fixed : code repetition around ext.$classIns.prepare(obj) can be avoided by rearrangement. the cumbersome outer var ret can be avoided by exploiting promise rejection. With some other minor tidying, I ended up with this (untested) : myFunc: function(cmd, obj) { var requireRes = this.reqInst; var promises = $.map(this.map[cmd], function(key, ext) { var p; // p for promise if(ext.$classIns) { p = $.when(ext.$classIns); } else { p = requireRes(ext).then(function() { var cls = $.toFunction(ext.$jscls); if(cls) { ext.$classIns = new cls(); } return ext.$classIns || null; }); } /* At this point, `p` is a promise resolved with either a previously created `cls()` object or a freshly created one */ // As we are inside `$.map(...)`, `return p.then(...)` causes the promise delivered by `p.then(...)` to be pushed onto the `promises` array. return p.then(function($classIns) { if($classIns &amp;&amp; $classIns.prepare) { return $classIns.prepare(obj).then(function(satisfied) { if(!satisfied) { // Here, returning a rejected promise is equivalent to setting the original `ret` irrevocably to `false`. return $.Deferred().reject(new Error(".prepare() not satisfied")); } }); } else { // You may want also to reject if `$classIns` or `$classIns.prepare` doesn't exist. // If not, then delete this else{} clause. return $.Deferred().reject(new Error(".prepare() could not be called")); } }); }); /* At this point, `promises` is an array of promises - some or all resolved, some or all pending */ // Here, instead of the boolean `ret`, you can exploit the joined promise's success/error paths : // * success path is equivalent to ret == true. // * error path is equivalent to ret == false, or any unpredicted erro…
upvote count: 1
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/29858026
type: AnsweredQuestion
score: 0
possible better answer: http://stackoverflow.com/a/29858132
has answer: http://stackoverflow.com/a/29858132
type: Question
has answer: http://stackoverflow.com/a/29858206
tagged with: javascript
tagged with: show
answer count: 3
has answer: http://stackoverflow.com/a/29858163
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47842105
accepted answer: http://stackoverflow.com/a/29858206
has body: I am trying to make a div tag appear when I select a "show more" link. So far, the div appears when the page loads, which I don't want. Then when I select the "Show" link, the div disappears. I need the opposite to happen, and then make the div disappear when I select the link again. Here's my HTML: Credits Directed By: Link One Edited By: Link Two Show Credit: Link Three Credit: Link Four Here's my .js file: $('#hideshow') .click(function() { $('#hideshow') .text('Hide'); $('#message') .show(); }, function() { $('#hideshow').text('Show'); $('#message') .hide(); }); I feel like I just have some of the code in the wrong place. Here is the page where I am trying to get the code to work: http://www.kingdombrand.com/Film/Alek/Films/TestFilm
has title: Show More / Show Less JavaScript not working properly

http://stackoverflow.com/a/29938235
accepted answer of: http://stackoverflow.com/q/29916878
has comment: http://stackoverflow.com/comment/55660766
answers question: http://stackoverflow.com/q/29916878
type: Answer
score: 1
upvote count: 1
type: AcceptedAnswer
downvote count: 0
has body: I made changes in url. Before changes my url was url: "https://www.yammer.com/api/v1/messages.json" Now my url is url: "https://api.yammer.com/api/v1/messages.json" It is working fine Only three characters took my 2 days....

http://stackoverflow.com/comment/55690636
score: 0
type: Comment
has text: Had to give you a plus one for sheer volume and detail.
comment on: http://stackoverflow.com/a/30000591
type: AnswerComment

http://stackoverflow.com/q/29929066
accepted answer: http://stackoverflow.com/a/29930022
tagged with: underscore.js
score: 1
type: Question
has body: I get an array of objects with image locations via API and I can't manage to render it. I managed to get my array into chuncks of 4 using underscore, but I can't get my head around how to massage my data into correct form so I could render it out through mustache. The code currently looks like this: var template = " {{#images}} {{location}} {{/images}} "; var data = [ {"location":"gallery\/Baar_Toit_5.jpg"}, {"location":"gallery\/Baar_Toit_7.jpg"}, {"location":"gallery\/Baar_Toit_8.jpg"}, {"location":"gallery\/Baar_Int_1.jpg"}, {"location":"gallery\/Baar_Int_2.jpg"}, {"location":"gallery\/Baar_Int_3.jpg"}, {"location":"gallery\/Baar_Int_4.jpg"}, {"location":"gallery\/Baar_Uus_01.jpg"}, {"location":"gallery\/Baar_Uus_02.jpg"}, {"location":"gallery\/Baar_Uus_03.jpg"}, {"location":"gallery\/Baar_Uus_04.jpg"}, {"location":"gallery\/Baar_Uus_05.jpg"}, {"location":"gallery\/Baar_Uus_06.jpg"}, {"location":"gallery\/Baar_Uus_07.jpg"} ]; var n = 4; var imgs = _.groupBy(data, function(element, index){ return Math.floor(index/n); }); console.log(imgs); Mustache.parse(template); var rendered = Mustache.render(template, { imgs: JSON.parse(imgs) }); $('#gallery').html(rendered); I created a small sandbox for testing purposes, feel free to play around with it: http://jsfiddle.net/qK5NT/149/ My desired output is: img/1.jpg img/2.jpg img/3.jpg img/4.jpg img/5.jpg img/6.jpg img/5.jpg img/6.jpg img/5.jpg img/6.jpg img/5.jpg img/6.jpg img/5.jpg img/6.jpg Any help will be appreciated!
tagged with: javascript
linked to: http://stackoverflow.com/q/8566667
has title: How to render array into specific form for mustache to render
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
tagged with: mustache
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29930022
downvote count: 0

http://stackoverflow.com/comment/47971095
has text: Where are you guys? After editing the questions no replies?
comment on: http://stackoverflow.com/q/29923043
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29850653
type: AnsweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/47833677
has comment: http://stackoverflow.com/comment/47837324
tagged with: javascript
has title: Calling .getTimeStamp on objectID
score: 0
tagged with: mongodb
has answer: http://stackoverflow.com/a/29850883
answer count: 1
has body: I've called the .getTimeStamp method on an _id coming from mongodb and it outputs as follows &lt;td&gt;&lt;%= items[i]._id.getTimestamp() %&gt;&lt;/td&gt; Fri Apr 24 2015 15:28:34 GMT+0100 (GMT Daylight Time) Can I format the output to just display the first three params? I thought I may be able to format it by passing parameters but can't find anything online.
accepted answer: http://stackoverflow.com/a/29850883

http://stackoverflow.com/comment/48059885
has text: Welcome to SO @saifharbia. Please take some time to read through http://stackoverflow.com/tags/jquery/info to help you get the most out of SO.
comment on: http://stackoverflow.com/q/29969800
type: Comment
score: 2
type: QuestionComment

http://stackoverflow.com/a/29892629
score: 0
type: Answer
has body: I can see you are having two "click" event handler on same class. Instead of it, you can merge it as well. Here is the optimized version of your code : JavaScript : $(document).ready(function (){ $('.button-fill').on("click", function() { //Only one click event handler var $this = $(this); var i=$this.parent().index(); var $trSibling = $this.closest("tr").siblings(); $this.toggle($trSibling.find("td:eq("+i+")").addClass("active").text() != ""); //adds the class as well and check the text as well. }) $(".button-fill").trigger("click"); // explicitly clicking on button to make sure that initially button should not be shown if column text is not empty }); JSFiddle link : http://jsfiddle.net/ujw0u6au/1/ Is this the same what you want?
answers question: http://stackoverflow.com/q/29892006

http://stackoverflow.com/q/29893006
tagged with: javascript
score: -1
answer count: 1
favorite count: 0
has title: Regular expression in Javascript to find specific value
type: UnansweredQuestion
tagged with: regex
has comment: http://stackoverflow.com/comment/47909176
has comment: http://stackoverflow.com/comment/47909161
has body: I have a Javascript variable: var Mytemp = “&lt;”span class="ic_evt30" “&gt;” "&lt;"/span"&gt;" "&lt;"img rc="/zenius61\images\com\btn_tab_root.gif" "&gt;" I need a javascript regular expression which will return the '30' in "ic_evt30"
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/29894896
upvote count: 0

http://stackoverflow.com/q/29897723
type: Question
score: 0
answer count: 2
tagged with: javascript
has title: Java Script Class.create() says class not defined
has comment: http://stackoverflow.com/comment/47918343
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/1114024
has answer: http://stackoverflow.com/a/29897883
has answer: http://stackoverflow.com/a/29897874
has body: I am new to java script and I went through the following link to learn about classes. http://prototypejs.org/learn/class-inheritance. I tried running the below code in google chrome and it says "Uncaught: Reference Error: Class not defined" and I don't know why it says so. Can anyone help me through this. here is the code, I copy pasted it from the above link: var Person = Class.create(); Person.prototype = { initialize: function(name) { this.name = name; }, say: function(message) { return this.name + ': ' + message; } }; var guy = new Person('Miro'); guy.say('hi'); // -&gt; "Miro: hi" var Pirate = Class.create(); // inherit from Person class: Pirate.prototype = Object.extend(new Person(), { // redefine the speak method say: function(message) { return this.name + ': ' + message + ', yarr!'; } }); var john = new Pirate('Long John'); john.say('ahoy matey');
has comment: http://stackoverflow.com/comment/47918160

http://stackoverflow.com/comment/48024536
comment on: http://stackoverflow.com/q/29930885
score: 0
has text: I'm trying to just save the test case thats utilizing the user-extension.
type: QuestionComment
type: Comment

http://stackoverflow.com/a/29936934
has body: You could create a custom filter which would return a selected value id, for that you need pass two parameters to filter 1st parameter will perform check, if it is true then 2nd parameter property array will be return from the filter. Markup &lt;body ng-app="app"&gt; &lt;div ng-controller="movieController"&gt; {{(Movies | returnPropertyWhenCheckedTrue: 'checked' :'MovieID')}} &lt;ul&gt; &lt;li ng-repeat="m in Movies"&gt; &lt;input id="chkBox-{{ m.MovieID }}" type="checkbox" ng-model="m.checked"/&gt; &lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/body&gt; Filter app.filter('returnPropertyWhenCheckedTrue', function() { return function(array, propertyToChecked, property) { var returnArray = []; angular.forEach(array, function(value, index) { if (value[propertyToChecked]) returnArray.push(value[property]); }); return returnArray; } }); Working Plunkr
has comment: http://stackoverflow.com/comment/48044476
has comment: http://stackoverflow.com/comment/48044524
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/48001124
has comment: http://stackoverflow.com/comment/48001171
has comment: http://stackoverflow.com/comment/47996025
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/48005461
has comment: http://stackoverflow.com/comment/47996120
accepted answer of: http://stackoverflow.com/q/29936688
answers question: http://stackoverflow.com/q/29936688

http://stackoverflow.com/a/29893663
score: 1
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29893566
has comment: http://stackoverflow.com/comment/47910714
has comment: http://stackoverflow.com/comment/47910392
has comment: http://stackoverflow.com/comment/47910563
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29893566
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/47910332
has body: $scope.author is an Object so you don't need to specify index in brackets here &lt;h1&gt;{{author.name}}&lt;/h1&gt; &lt;p&gt;{{author.title+ ', '+author.company}} updated fiddle

http://stackoverflow.com/comment/47884970
score: 0
has text: I think it could help http://stackoverflow.com/questions/29868003/refresh-events-in-angular-calendar-ui-fullcalendar-with-laravel-as-a-backend/29868502#29868502
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29880280

http://stackoverflow.com/q/29915700
has comment: http://stackoverflow.com/comment/47953198
favorite count: 0
has comment: http://stackoverflow.com/comment/47952859
has body: I have a requirement where I have to open a URL in several windows with window.open in for loop. But the next window has to open only after previous one is loaded. I have this code: for(i=0; i&lt;5; i++){ window.open("http://myurl.com"); } Which opens 5 windows with 5 URLs. But not sure how to delay opening of next window until the previous one is completely loaded.
has comment: http://stackoverflow.com/comment/47953060
score: -10
has title: window.open in a loop with each window opening only after first one is completely loaded?
has comment: http://stackoverflow.com/comment/47952839
has comment: http://stackoverflow.com/comment/47953090
downvote count: 11
has comment: http://stackoverflow.com/comment/47953128
type: UnansweredQuestion
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/29916001
has comment: http://stackoverflow.com/comment/47953767
linked to: http://stackoverflow.com/q/3030859
has comment: http://stackoverflow.com/comment/47952874
has comment: http://stackoverflow.com/comment/47953253
answer count: 1
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/47898065
score: 1
has text: please explain, what you need exactly?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29887084

http://stackoverflow.com/a/29957627
has comment: http://stackoverflow.com/comment/76648801
has body: An alternate way of phrasing this: json.reduce(function(sums,entry){ sums[entry.city] = (sums[entry.city] || 0) + 1; return sums; },{}); Array.reduce() calls a callback on each element of the array, passing the return of the previous call in as the first parameter in the next. (The {} at the end is the initial value, passed into the first call) So this is doing exactly what you did - creating an empty object, iterating through the array, and accumulating totals inside the object. It's just doing it tersely.
answers question: http://stackoverflow.com/q/29957390
has comment: http://stackoverflow.com/comment/48036130
accepted answer of: http://stackoverflow.com/q/29957390
score: 12
has comment: http://stackoverflow.com/comment/76647177
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 12

http://stackoverflow.com/comment/47847249
type: Comment
type: QuestionComment
score: 0
has text: I have something like this http://jsfiddle.net/oe8d2og1/7/ After the third date field has been added, it updates back the first date field. The subsequent rows are ok
comment on: http://stackoverflow.com/q/29859935

http://stackoverflow.com/comment/47984193
score: 0
comment on: http://stackoverflow.com/q/29930910
type: Comment
has text: Insert oops, I'll edit.
type: QuestionComment

http://stackoverflow.com/comment/47946731
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29912286
has text: Should `href="<%=host %>/common/css/test.css"` be `href="<%=host %>/common.war/web/css/test.css"` maybe?

http://stackoverflow.com/q/29879131
answer count: 2
has answer: http://stackoverflow.com/a/29879292
tagged with: angularjs
has answer: http://stackoverflow.com/a/29879283
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47882545
has title: filter user input in angularjs
type: Question
has body: I built something in angular using ng-repeat {{e.user}} {{e.created_at}} {{e.post}} Delete This is to display the inputs by users. However i did not htmlentities to encode the user input but directly insert the user input into database such as Hack However i notice when i display this message using above code. it will still display the message as Hack instead of display a "hack" link. can i say in this case angular will auto sanitize the input? Should i still need to use "ng-bind-html"?
tagged with: javascript
score: 0

http://stackoverflow.com/comment/48021794
has text: So far there isn't any issue with performance in my code. I've just been reading on the trade-offs of different patterns and this idea came to me as a very simple way of getting the best of both worlds. If it legitimately was faster than the regular prototype pattern but still kept the memory usage down, I don't think the extra line of code is a big eye-sore and actually it might make it easier to read as you would see all the functions of the "class" in the constructor function.
comment on: http://stackoverflow.com/q/29931421
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29873487
downvote count: 0
possible better answer: http://stackoverflow.com/a/38428810
tagged with: jquery
has comment: http://stackoverflow.com/comment/47872145
has answer: http://stackoverflow.com/a/38428810
favorite count: 0
has comment: http://stackoverflow.com/comment/47873891
has body: I am trying to test that when a user clicks in my form the existing error message will go away. For some reason the last test is failing and i'm not sure why. I'm fairly new to jQuery and Qunit. test.html Javascript tests Error text list.js jQuery(document).ready(function ($) { $('input[name="text"]').on('keypress', function() { $('.has-error').hide(); }); $('input[name="text"]').on('click', function() { $('.has-error').hide(); }); })
accepted answer: http://stackoverflow.com/a/29873851
tagged with: qunit
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47872715
score: 1
has comment: http://stackoverflow.com/comment/47872581
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/47871994
has comment: http://stackoverflow.com/comment/47874412
has comment: http://stackoverflow.com/comment/47872067
has title: Triggering JavaScript events in Qunit tests
has answer: http://stackoverflow.com/a/29873851
tagged with: javascript
has comment: http://stackoverflow.com/comment/47874420
has comment: http://stackoverflow.com/comment/47872155
has comment: http://stackoverflow.com/comment/47872116
answer count: 2
has comment: http://stackoverflow.com/comment/47872244

http://stackoverflow.com/q/29942848
possible better answer: http://stackoverflow.com/a/29943094
type: Question
has answer: http://stackoverflow.com/a/29943094
has body: I am trying to replace quote (') with \' so as to escape escape quote or double quote in string Set Link function setlink(){ var data = { playerID : 102458, playername: "Real Madrid's cristiano Ronalado" } listring= " "+ data.playername +" "; $("#list").append(listring); } Here is fiddle: fiddle The desired output should be: Real Madrid's cristiano Ronalado
has title: How to escape single or double quote in JavaScript?
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/29942970
has comment: http://stackoverflow.com/comment/48006834
tagged with: escaping
has comment: http://stackoverflow.com/comment/48008162
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29942970
has comment: http://stackoverflow.com/comment/48006458
tagged with: javascript

http://stackoverflow.com/q/29865355
upvote count: 2
type: UnansweredQuestion
has title: Is there any way to close Magnific when a Vimeo video has finished playing?
score: 2
has body: Hoping you can help me. I have a Magnific iframe popup that plays a Vimeo video. However, once it is finished, I'd like to automatically close the popup. Is this even possible via this plugin? My current (working code): $vimeo.magnificPopup({ closeBtnInside: false, showCloseBtn: false, disableOn: 0, type: 'iframe', mainClass: 'mfp-fade', removalDelay: 0, preloader: true, fixedContentPos: false, callbacks: { beforeOpen: function() { cache.$main.addClass('playing'); }, open: function() { $(this.currItem.el).closest('.project__item').toggleClass('playing'); }, close: function() { $('.project__item').removeClass('playing'); }, afterClose: function() { cache.$main.removeClass('playing'); } } }); I have searched the web and the official Magnific API documentation to no success. Any help or a nod in the right direction appreciated. Many thanks, Mikey.
type: Question
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29865431
downvote count: 0
answer count: 1
favorite count: 0
tagged with: magnific-popup

http://stackoverflow.com/comment/47870758
type: Comment
comment on: http://stackoverflow.com/q/29872783
has text: Thanks for the quick comment. Yes, correct. I hoped there is a way to use matching groups. Sadly my experience with regex hits a wall here. The problem lies in a huge and volatile dataset of unstructured data for which regex is much much more efficient to use for string manipulation than a functional approach.
score: 0
type: QuestionComment

http://stackoverflow.com/q/29936333
answer count: 2
has title: How can I make toggleClass("hover") fade in?
downvote count: 0
tagged with: javascript
score: 1
tagged with: jquery
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/47994641
has body: I've been googling to no success. I would like a part of my page to fade in when I hover over it. Here's my css: .status .admin { display: none; } .status.hover .admin { display: inline; } Here's my .coffee script: $('.status').hover (event) -&gt; $(this).toggleClass("hover")
has answer: http://stackoverflow.com/a/29936498
has answer: http://stackoverflow.com/a/29936921
tagged with: coffeescript
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/47994741
has comment: http://stackoverflow.com/comment/47994486

http://stackoverflow.com/q/29909555
has comment: http://stackoverflow.com/comment/47941611
has body: Is it possible to have jQuery find the text of an object and then find the link before it and then click it? I have this example where I want jQuery to click on either of the 2 links below: 1234 Account 1234 5678 Account 5678 Here is my jQuery that I'm using currently and it works but what happens if the order of the accounts above gets sorted differently then it will click on the wrong link for the wrong account: if(account_id == '1234'){ jQuery(".float-left b a")[0].click(); //click on first href } else { jQuery(".float-left b a")[1].click(); //click on second href } So is it possible for jQuery to do something like this: if(account_id == '1234'){ //find span class='fullaccnum' where span equals 1234 //found match, go back up the tree and click href jQuery(".float-left b a").click(); //goes to 'url-example-1.html' } else { //find span class='fullaccnum' where span equals 5678 //found match, go back up the tree and click href jQuery(".float-left b a").click(); //goes to '/url-example-2.html' }
has answer: http://stackoverflow.com/a/29909627
favorite count: 0
upvote count: 2
answer count: 5
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has answer: http://stackoverflow.com/a/29909801
score: 2
has answer: http://stackoverflow.com/a/29909839
has answer: http://stackoverflow.com/a/29911047
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/29909843
tagged with: jquery
has title: jQuery - Click link based on css class and name of link
downvote count: 0

http://stackoverflow.com/comment/47831479
comment on: http://stackoverflow.com/q/29852165
has text: @CrimsonChris Fully agree. Keep the more lengthy/complex logic out of the bindings. I suggest this in my answer.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/48048134
has text: With your current function setup, I don't think you can.. I might be wrong.
comment on: http://stackoverflow.com/q/29963690
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29993703
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/29993228
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: This is because var map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions); Is most likely erring out. map_canvas doesn't exist, so the next line is never reached. If you comment it out, then the second view works as expected. When calling document.getElementById(), make sure the element exists FIRST before creating a map. BTW: That also means that map_canvas1 does't exist on your first view either, so be careful there as well. Try this: var map_canvas = document.getElementById("map_canvas"); if (map_canvas) var map = new google.maps.Map(map_canvas, mapOptions); var map_canvas1 = document.getElementById("map_canvas1"); if (map_canvas1) var map2 = new google.maps.Map(map_canvas1, mapOptions2);
accepted answer of: http://stackoverflow.com/q/29993228

http://stackoverflow.com/q/29930978
answer count: 5
has title: Node.js imagemin on CentOS
has answer: http://stackoverflow.com/a/45567290
score: 6
has answer: http://stackoverflow.com/a/29954266
accepted answer: http://stackoverflow.com/a/29954266
tagged with: node.js
has body: I am trying to use Node.js imagemin to compress a lot of images on my server. I like using imagemin because I know how to point it at specific directories. I am using CentOS 6 and when I run my file, I get the error: node_modules/imagemin/node_modules/imagemin-pngquant/node_modules/pngquant-bin/vendor/pngquant: /lib64/libc.so.6: version `GLIBC_2.14' not found Also, when I installed imagemin with npm install imagemin, I got an error that said: Error: pngquant failed to build, make sure that libpng-dev is installed Any ideas on what I can do to solve this?
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47987571
downvote count: 0
possible better answer: http://stackoverflow.com/a/45567290
has comment: http://stackoverflow.com/comment/47984429
tagged with: libpng
type: Question
upvote count: 6
tagged with: javascript
tagged with: centos6
tagged with: imagemin
has answer: http://stackoverflow.com/a/52696728
has answer: http://stackoverflow.com/a/49427522
has answer: http://stackoverflow.com/a/56239707
favorite count: 0

http://stackoverflow.com/a/61003099
type: Answer
has body: Maybe I'm missing the point here - but why do the existing suggestions involve resizing the canvas from within the animation loop? You'd want your animation loop to do as little as possible, as it will ideally be repeated 30+ times a second, and should be optimized to run as efficiently as possible - affording the maximum fps to the slowest system running it. I think there's no harm in calling the resize function from within the resize event listener - much like Meindert Stijfhals suggested below. Something like this: var container = renderer.domElement.parentElement; container.addEventListener('resize', onContainerResize); function onContainerResize() { var box = container.getBoundingClientRect(); renderer.setSize(box.width, box.height); camera.aspect = box.width/box.height camera.updateProjectionMatrix() // optional animate/renderloop call put here for render-on-changes } If you have some kind of render-only-on-changes set up, you can call the render function at the end of the resize function. Otherwise the next time the render loop does fire it should just render with the new settings.
score: 2
upvote count: 3
downvote count: 1
answers question: http://stackoverflow.com/q/29884485

http://stackoverflow.com/comment/47825963
type: AnswerComment
has text: Search for the error on the net.i am on mobile so cant be able to help much. However my answer will perfectly work for file upload validation.
type: Comment
comment on: http://stackoverflow.com/a/29848968
score: 0

http://stackoverflow.com/q/29920263
tagged with: asp.net
has comment: http://stackoverflow.com/comment/47962297
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47962384
has comment: http://stackoverflow.com/comment/47962073
linked to: http://stackoverflow.com/q/10929644
has comment: http://stackoverflow.com/comment/47961749
type: Question
tagged with: c#
linked to: http://stackoverflow.com/q/1106199
has comment: http://stackoverflow.com/comment/47962500
has body: I have a function in server side which fills a dropdownlist. I call this function with a button click on client side using PageMethods in Javascript like this: &lt;asp:ScriptManager ID="smMain" runat="server" EnablePageMethods="true" /&gt; &lt;asp:Button runat="server" ID="SearchButton" Text="Search" OnClientClick="SearchButtonClick();return false;"/&gt; &lt;asp:DropDownList runat="server" ID="SearchCityDropDownList" Width="100px"/&gt; And function SearchButtonClick() { PageMethods.SearchSearchButtonActivity(onSucess, onError); } function onSucess(result) { alert(result); } function onError(result) { alert('Cannot process your request at the moment, please try later.'); } Server side function: [WebMethod] public static string SearchButtonActivity() { string result = "Everything is OK!"; foreach (string value in getCityList()) { SearchCityDropDownList.Items.Add(new ListItem(value)); } return result; } When I run this code and click on the button it just shows the "Everything is OK!" alert and dropdownlist still empty. Please help me to solve this problem, I think this is a post back problem because when I debug the code, items of dropdownlist are full but they don't show up in the dropdown. Thank you
tagged with: .net
answer count: 1
has comment: http://stackoverflow.com/comment/47962077
has comment: http://stackoverflow.com/comment/47962066
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/47961938
has comment: http://stackoverflow.com/comment/47961754
has answer: http://stackoverflow.com/a/29920670
has title: How to call C# server side function from Javascript in ASP.net
tagged with: pagemethods

http://stackoverflow.com/q/29875000
upvote count: 1
tagged with: node.js
downvote count: 3
has title: Ajax send data to Node.js client then send to Node.js server
type: Question
score: -2
tagged with: javascript
has answer: http://stackoverflow.com/a/29875035
has comment: http://stackoverflow.com/comment/47874756
has body: Is it possible that jquery.Ajax will send data to Node.js client,then after it receive the data will be send to Node.js server ?. Is this possible ? myajax $.ajax({ type:'post' data:{data:hello}, url: '' //here I don't know how to point to node.js client success:function(data){ } }); servarapp.js var net = require('net'); var clients = []; var server = net.createServer(function (socket) { clients.push(socket); }); server.listen(1337,'localhost',function(){ console.log("server is listening in port 1337"); }); client.js var net = require('net'); var client = new net.Socket(); client.connect(1337, '127.0.0.1', function() { console.log('Connected'); client.write('Hello, server!); }); client.on('data', function(data) { console.log('Received: ' + data); client.destroy(); }); client.on('close', function() { console.log('Connection closed'); }); Thank you in advance.
answer count: 1
has comment: http://stackoverflow.com/comment/47874625
favorite count: 0
type: UnansweredQuestion

http://stackoverflow.com/q/29916886
downvote count: 2
has title: Three js Add plane to the scene
upvote count: 7
type: Question
score: 5
tagged with: javascript
answer count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/29917553
type: UnansweredQuestion
tagged with: three.js
has body: I am trying to add a plane to the scene but if I check children's scene nothing is added. var plane = new THREE.Mesh( new THREE.PlaneGeometry( 2000, 2000, 8, 8 ), new THREE.MeshBasicMaterial( { color: 0xffff00, opacity: 0.25 } ) ); plane.visible = true; this.scene.add( plane );

http://stackoverflow.com/comment/47960297
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29919346
has text: My web page is used to create JavaScript code, I want to be able to debug the javascript code created by my web-page, using the integrated debugger will enable debugging of my online dev environment and not the script I have created with it
type: AnswerComment

http://stackoverflow.com/q/29858927
type: UnansweredQuestion
has body: I am trying to display a json data in Wicket DataView. If i want to display the json with indentation, how i can achieve this using java script? I could find many sources to pretty format the json but they are using java script. How we can call a function to javascript from inside dataview populateItem method to format the json as described in the link http://jsfiddle.net/unLSJ/ Html Name Value My Java: dataView = new ListView<DataForTable>("notificationDetails",dataForTableList) { private static final long serialVersionUID = 1L; @Override protected void populateItem(final ListItem<DataForTable> item) { item.setDefaultModel(new CompoundPropertyModel<DataForTable>(item.getModel())); item.add(new Label("name")); item.add(new Label("value")); } }; I have also tried to use Jackson object mapper to format the json before adding to Label, but it does not help. The wicket page displays like this mapper.defaultPrettyPrintingWriter().writeValueAsString(value); The wicket page displays like this {\r\n \"action\" : \"add\",\r\n \"schedule\"... Can you please help to resolve the issue?
tagged with: java
tagged with: wicket-6
type: Question
tagged with: apache
tagged with: javascript
has title: How to format json in wicket dataview using javascript
has answer: http://stackoverflow.com/a/29871453
score: 0
answer count: 1

http://stackoverflow.com/q/29965562
tagged with: css
upvote count: 6
has comment: http://stackoverflow.com/comment/69073773
has answer: http://stackoverflow.com/a/40930240
has comment: http://stackoverflow.com/comment/48051757
has title: CSS: Performance wise, better to use calc or position absolute
has answer: http://stackoverflow.com/a/40931399
type: Question
has comment: http://stackoverflow.com/comment/48059594
tagged with: javascript
tagged with: jquery
answer count: 2
has comment: http://stackoverflow.com/comment/48053693
has comment: http://stackoverflow.com/comment/48050975
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
has body: I have a container div with fixed height. Inside two divs, the top height: 50px and the other one must fill the empty space but allowing internal scroll. Now I have two options: #up{ height: 50px; } #down{ position: absolute; top: 50px; bottom: 0; } or: #up{ height: 50px; } #down{ height: calc(100% - 50px); } If I have many of these cases inside my window, which one is the best to use performance wise? This Fiddle ps. I don't care about old browser support.
favorite count: 0
has comment: http://stackoverflow.com/comment/48059296
type: UnansweredQuestion
score: 6

http://stackoverflow.com/a/29995833
answers question: http://stackoverflow.com/q/29995614
has body: In jQuery you can do it like below. You could even shorten down the code, using classes to show/hide a bigger scope, but this is fine. function showForm() { $('#myform').show(); $('#myClose').show(); $("#info").hide(); } function hideForm() { $('#myform').hide(); $('#myClose').hide(); $("#info").show(); } $(function() { $('#info').click(function() { showForm(); }); $('#myClose').click(function() { hideForm(); }); hideForm(); }); &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"&gt;&lt;/script&gt; &lt;div class="container"&gt; &lt;div id="myDiv"&gt; &lt;button id="myClose" type="button" class="close" data-dismiss="myDiv" aria-label="Close"&gt;&lt;span aria-hidden="true"&gt;&amp;times;&lt;/span&gt; &lt;/button&gt; &lt;p id="q"&gt;QUESTION&lt;/p&gt; &lt;form action="https://chat.rbb.bg/ccp/chat/form/100000" id="myform" method="post" target="_blank" onsubmit="return window.confirm(&amp;quot;You are submitting information to an external page.\nAre you sure?&amp;quot;);"&gt; &lt;span class="box1"&gt;Theme&lt;/span&gt; &lt;input type="text" name="extensionField_Title" id="box1"&gt; &lt;br&gt; &lt;span class="box2"&gt;Name&lt;/span&gt; &lt;input type="text" name="extensionField_Name" id="box2"&gt; &lt;br&gt; &lt;span class="box3"&gt;Теlephone&lt;/span&gt; &lt;input type="text" name="extensionField_PhoneNumber" id="box3"&gt; &lt;br&gt; &lt;span class="boxinfo"&gt;About&lt;/span&gt; &lt;select name="extensionField_ccxqueuetag" id="boxinfo"&gt; &lt;br&gt; &lt;option value="Chat_Csq23"&gt;&lt;/option&gt; &lt;/select&gt; &lt;br&gt; &lt;input type="submit" value="SUBMIT" id="boxbuton"&gt; &lt;input type="hidden" name="author" value="Customer"&gt; &lt;br&gt; &lt;/form&gt; &lt;/div&gt; &lt;input id="info" type="button" value="QUESTION?" class="switchbuton"&gt; &lt;/div&gt;
score: 0
type: Answer

http://stackoverflow.com/comment/121484012
type: Comment
has text: Yeah this is 100% true when there is active selection cursor will be nowhere, so focus wont work. Above code worked for me thanks @sigmawf, for brief
score: 2
comment on: http://stackoverflow.com/a/66833098
type: AnswerComment

http://stackoverflow.com/comment/47942496
score: 0
has text: The pictures will all end up as earthrise.jpg because you're setting each image to that picture explicitly in the last conditional of every image*x* var.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29910073

http://stackoverflow.com/comment/47950006
type: Comment
type: QuestionComment
has text: You are missing the point, `disabled` element do not trigger events. Test it yourself http://jsfiddle.net/ym34ud8j/
comment on: http://stackoverflow.com/q/29913997
score: 0

http://stackoverflow.com/q/29906637
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29994360
has comment: http://stackoverflow.com/comment/48133104
has comment: http://stackoverflow.com/comment/47937003
score: 17
has body: In some Node.js scripts that I have written, I notice that even if the last line is a synchronous call, sometimes it doesn't complete before Node.js exits. I have never seen a console.log statement fail to run/complete before exiting, but I have seen some other statements fail to complete before exiting, and I believe they are all synchronous. I could see why the callback of an async function would fail to fire of course in this case. The code in question is a ZeroMQ .send() call like so: var zmq = require('zmq'); var pub = zmq.socket('pub'); pub.bindSync('tcp://127.0.0.1:5555'); setInterval(function(){ pub.send('polyglot'); },500); The above code works as expected...but if I remove setInterval() and just call it like this: var zmq = require('zmq'); var pub = zmq.socket('pub'); pub.bindSync('tcp://127.0.0.1:5555'); pub.send('polyglot'); //this message does not get delivered before exit process.exit(0); ...Then the message will not get delivered - the program will apparently exit before the pub.send() call completes. What is the best way to ensure a statement completes before exiting in Node.js ? Shutdown hooks would work here, but I am afraid that would just be masking the problem since you can't put everything that you need to ensure runs in a shutdown hook. This problem can also be demonstrated this way: if (typeof messageHandler[nameOfHandlerFunction] == 'function') { reply.send('Success'); messageHandler[nameOfHandlerFunction](null, args); } else { reply.send('Failure'); //***this call might not complete before the error is thrown below.*** throw new Error('SmartConnect error: no handler for ZMQ message sent from Redis CSV uploader.'); } I believe this is a legit/serious problem because a lot of programs just need to publish messages and then die, but how can we effectively ensure all messages get sent (though not necessarily received)? EDIT: One (potential) way to fix this is to do: socket.send('xyz'); socket.close(); // supposedly this will block until the abo…
upvote count: 17
type: Question
has comment: http://stackoverflow.com/comment/48327118
has comment: http://stackoverflow.com/comment/47936065
tagged with: zeromq
tagged with: javascript
has comment: http://stackoverflow.com/comment/47936870
has comment: http://stackoverflow.com/comment/48155315
has title: Node.js socket.send( ) functions failing to complete before exit
answer count: 2
has answer: http://stackoverflow.com/a/29994360
has comment: http://stackoverflow.com/comment/48117000
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/30201244
has comment: http://stackoverflow.com/comment/47935989
has comment: http://stackoverflow.com/comment/47937020
has comment: http://stackoverflow.com/comment/47935970
has comment: http://stackoverflow.com/comment/48158295
possible better answer: http://stackoverflow.com/a/30201244
tagged with: node.js

http://stackoverflow.com/a/29885509
has comment: http://stackoverflow.com/comment/129969410
downvote count: 0
has comment: http://stackoverflow.com/comment/114305518
has comment: http://stackoverflow.com/comment/114305478
has comment: http://stackoverflow.com/comment/47895762
has comment: http://stackoverflow.com/comment/129969535
has comment: http://stackoverflow.com/comment/116661921
has body: There is nothing in the syntax that tells you your callback is executed asynchronously. Callbacks can be asynchronous, such as: setTimeout(function(){ console.log("this is async"); }, 100); or it can be synchronous, such as: an_array.forEach(function(x){ console.log("this is sync"); }); So, how can you know if a function will invoke the callback synchronously or asynchronously? The only reliable way is to read the documentation. You can also write a test to find out if documentation is not available: var t = "this is async"; some_function(function(){ t = "this is sync"; }); console.log(t); How asynchronous code work Javascript, per se, doesn't have any feature to make functions asynchronous. If you want to write an asynchronous function you have two options: Use another asynchronous function such as setTimeout or web workers to execute your logic. Write it in C. As for how the C coded functions (such as setTimeout) implement asynchronous execution? It all has to do with the event loop (or mostly). The Event Loop Inside the web browser there is this piece of code that is used for networking. Originally, the networking code could only download one thing: the HTML page itself. When Mosaic invented the &lt;img&gt; tag the networking code evolved to download multiple resources. Then Netscape implemented progressive rendering of images, they had to make the networking code asynchronous so that they can draw the page before all images are loaded and update each image progressively and individually. This is the origin of the event loop. In the heart of the browser there is an event loop that evolved from asynchronous networking code. So it's not surprising that it uses an I/O primitive as its core: select() (or something similar such as poll, epoll etc. depending on OS). The select() function in C allows you to wait for multiple I/O operations in a single thread without needing to spawn additional threads. select() looks something like: select (max, readlist, writelist, err…
upvote count: 32
has comment: http://stackoverflow.com/comment/116662319
accepted answer of: http://stackoverflow.com/q/29883525
answers question: http://stackoverflow.com/q/29883525
has comment: http://stackoverflow.com/comment/129969286
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/129969357
has comment: http://stackoverflow.com/comment/129969502
has comment: http://stackoverflow.com/comment/129969465
has comment: http://stackoverflow.com/comment/129951969
has comment: http://stackoverflow.com/comment/129951939
has comment: http://stackoverflow.com/comment/114305389
has comment: http://stackoverflow.com/comment/129969416
score: 32
type: Answer
has comment: http://stackoverflow.com/comment/129951992
has comment: http://stackoverflow.com/comment/76810107

http://stackoverflow.com/q/29853526
type: Question
has answer: http://stackoverflow.com/a/29853627
tagged with: javascript
score: 0
answer count: 2
tagged with: http://stackoverflow.com/tag/html
has body: Hi im using AngularJS to get a JSON objects like this one "_embedded": { "incidents": [ { "id": 1, "name": "Golpe", "description": "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.", "timestamp": "2015-01-01T00:00:00-0700", "upload_date": "-0001-11-30T00:00:00-0700", "archived": false, "_links": { "self": { "href": "http://incidents-core/app_dev.php/incidents/1" }, "attachments": { "href": "http://incidents-core/app_dev.php/incidents/1/attachments" }, "comments": { "href": "http://incidents-core/app_dev.php/incidents/1/comments" }, "thumbnail": { "href": "http://incidents-core/app_dev.php/attachments/33/download" } }, "_embedded": { "device": "Samsung 300", "employee": "Juan Lopez", "incident_type": "Golpe", "profile": "PruebaUpdate", "attachmentsCount": 7, "commentsCount": 15 } }, now i use Bootstrap modal window to show all the objects, and i made this methods for Next and Previous object.(this works but, for some reason , when i click on next, works fine , but when i click on previous , starts in 2 less, when im in the object in position [0], in code is [-2]) $scope.incidentSelected = []; $scope.selectIncident = function (index) { $scope.incidentSelected = $scope.incidents[index]; $scope.nextIndex = index + 1; $scope.prevIndex = index - 1; $scope.nextIncident = function () { $scope.selectIncident($scope.nextIndex); console.log($scope.nextIndex); }; $scope.prevIncident = function () { $scope.selectIncident($scope.prevIndex); console.log($scope.prev…
has answer: http://stackoverflow.com/a/29853594
has comment: http://stackoverflow.com/comment/47833040
accepted answer: http://stackoverflow.com/a/29853594
tagged with: angularjs
tagged with: css
type: AnsweredQuestion
has title: How can i disable next and prev buttons if JSON array is empty?
possible better answer: http://stackoverflow.com/a/29853627

http://stackoverflow.com/comment/47961127
type: Comment
comment on: http://stackoverflow.com/a/29919650
has text: Shouldn't it be `templateUrl: "some/html/file.html"` instead of `template: "some/html/file.html"`?
type: AnswerComment
score: 0

http://stackoverflow.com/a/29964572
has body: https://api.jquery.com/load/ $('#tourniquet').load('file.txt', function(response, status, xhr) { if (status === 'error') { console.error(xhr.statusText); } });
upvote count: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29964410
answers question: http://stackoverflow.com/q/29964410
type: Answer
downvote count: 0
score: 1

http://stackoverflow.com/a/29931475
upvote count: 2
type: Answer
score: 2
answers question: http://stackoverflow.com/q/29931446
has body: The this keyword is necessary when the context object must be referenced explicitly. Your functions are not really good examples, because you've used the same names for the object properties as you did for the function parameters. If you made them different, it might be more clear: function Foo(pjim, pjam){ this.jim = pjim; this.jam = pjam; function log(){ console.log('jim:',jim,'jam:',jam); } return log; } That version will basically not work - the names "jim" and "jam" won't correspond to anything in the log function.
downvote count: 0

http://stackoverflow.com/q/29982542
has comment: http://stackoverflow.com/comment/48084674
has body: I am getting XSS vulnerability on using location.hash in my code. location.hash='val/' + id; When I scan through fortify, it is pointing out this as critical issue. Also, I am using location.hash at several places, but fortify is not reporting it. Can anyone help on this how to fix the issue?
has title: Method sends unvalidated data to browser
has comment: http://stackoverflow.com/comment/48084545
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/48084472
type: Question
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/48084475

http://stackoverflow.com/comment/48066496
has text: Is this similar to the layout you're after? http://codepen.io/anon/pen/EjjmQj
score: 1
comment on: http://stackoverflow.com/q/29971322
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29979066
has answer: http://stackoverflow.com/a/29979105
tagged with: list
has answer: http://stackoverflow.com/a/29979118
type: Question
tagged with: for-loop
tagged with: arrays
tagged with: javascript
has body: var months = ["January", "February", "March", "April", "May", "June", "July","August", "September", "October","November", "December"]; // For Loop for (var i = 0; i = months.slice(4, 8); i++) { alert(a); I'm trying to loop through this array and alert the values in a specific range, May - August. I can't seem to figure this out. Thanks!
has comment: http://stackoverflow.com/comment/48077898
score: 0
answer count: 3
has title: Loop through an array and print a specific range of values?
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29979108
has comment: http://stackoverflow.com/comment/48078037

http://stackoverflow.com/comment/48104993
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29980754
has text: I think you can do this with `window.location.href=window.location.href`.
type: Comment

http://stackoverflow.com/q/29931378
type: UnansweredQuestion
has title: Why might my custom soundcloud player not make sound on an iPhone
score: 2
upvote count: 2
has body: I have this testing area here: http://codepen.io/sheriffderek/pen/RPbpQZ Besides needing a bunch of js refactoring, now that I've been playing with the API, I'm happy with what is going on. It works great in CodePen on my laptop, but on my phone, it is silent. It's not auto play. Just a click event. I've tried in debug mode --- and a few other CodePen options... in case it's an origin thing... any ideas? The code is just basic stuff, so I think it's something else. SC.stream("/tracks/293", function(sound){ sound.play(); });
type: Question
has answer: http://stackoverflow.com/a/30006888
tagged with: soundcloud
tagged with: iphone
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: soundmanager2

http://stackoverflow.com/q/29971890
has title: Add braces around digits with a regex?
has answer: http://stackoverflow.com/a/29971922
type: AnsweredQuestion
has body: I want to convert a string like this var string = "3*v0-v1/v12" to one like this using only one regex: var result = "3*v[0]-v[1]*v[12]" The tricky part is to add the numbers when adding the braces, something like: var result = string.replace(/v\d{1,2}/g, /REGEX HERE/)
type: Question
accepted answer: http://stackoverflow.com/a/29971922
answer count: 1
tagged with: javascript
score: 0
tagged with: regex

http://stackoverflow.com/comment/48054070
score: 0
type: Comment
has text: Yes exactly, `{{outlet 'modal'}}`
type: AnswerComment
comment on: http://stackoverflow.com/a/29963784

http://stackoverflow.com/q/29900625
has answer: http://stackoverflow.com/a/29915486
tagged with: selenium
has comment: http://stackoverflow.com/comment/47927845
type: Question
tagged with: testing
tagged with: protractor
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29915486
score: 0
has title: NoSuchElementError when element is actually there
answer count: 1
has body: I have this line in one of my angular tests: element(by.id('male')).click(); And the test is failing with this message: NoSuchElementError: No element found using locator: By.id("male") But when I add browser.sleep() to the test I can see that there's #male element on the page. So I tried adding explicit wait and it didn't help. What could be wrong?
tagged with: angularjs
has comment: http://stackoverflow.com/comment/47927903
type: AnsweredQuestion

http://stackoverflow.com/a/29857210
answers question: http://stackoverflow.com/q/29856541
score: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29856541
has comment: http://stackoverflow.com/comment/47840360
type: Answer
has comment: http://stackoverflow.com/comment/47840744
has body: The following will find all elements which have both the timeSegment class as well as the selected class: $('.timeSegment.selected') So, using the above you can retrieve the values of the data-value attributes like this: $('.timeSegment.selected').each(function(index) { console.log($(this).data('value')); }); Update Finding out which parent belongs to $(this) can be done using: parent() or you could use find() on a certain element. Option 1: Using parent(): $('.timeSegment.selected').each(function(index) { var parent = $(this).parent(); console.log(parent.attr('id')); console.log($(this).data('value')); }); The above will retrieve the id of the parent element, so that could be schedMonthsContainer or one of your other containers. Option 2: Using find() on a specific element: $('#schedMonthsContainer').find('.timeSegment.selected').each(function(index) { console.log($(this).data('value')); }); The above will only retrieve the elements with both the timeSegment and selected classes within the months container.

http://stackoverflow.com/a/31394491
has comment: http://stackoverflow.com/comment/50769462
score: 0
has comment: http://stackoverflow.com/comment/50785309
has body: Previous answers have mentioned tail-stream's approach which uses fs.watch, fs.read and fs.stat together to create the effect of streaming the contents of the file. You can see that code in action here. Another, perhaps hackier, approach might be to just use tail by spawning a child process with it. This of course comes with the limitation that tail must exist on the target platform, but one of node's strengths is using it to do asynchronous systems development via spawn and even on windows, you can execute node in an alternate shell like msysgit or cygwin to get access to the tail utility. The code for this: var spawn = require('child_process').spawn; var child = spawn('tail', ['-f', 'my.log']); child.stdout.on('data', function (data) { console.log('tail output: ' + data); } ); child.stderr.on('data', function (data) { console.log('err data: ' + data); } );
answers question: http://stackoverflow.com/q/29923192
type: Answer

http://stackoverflow.com/comment/47818209
type: Comment
comment on: http://stackoverflow.com/a/29846256
type: AnswerComment
has text: Thanks for the answer. The values don't always stay the same. Some times it is from 1 to 5 or 8-13. And also it can be that there are missing values in between.
score: 0

http://stackoverflow.com/q/29955687
score: 0
has comment: http://stackoverflow.com/comment/48032516
has answer: http://stackoverflow.com/a/29955771
answer count: 1
has comment: http://stackoverflow.com/comment/48032257
tagged with: jquery
has comment: http://stackoverflow.com/comment/48032398
has comment: http://stackoverflow.com/comment/48032438
has comment: http://stackoverflow.com/comment/48032201
has body: I have this html structure: &lt;ul id="comments_notifications_list" class="dropdown-menu"&gt; &lt;li&gt;&lt;img src="loader.png" class="noty" style="display: none;"&gt;&lt;li&gt; &lt;/ul&gt; Now i am trying to add add some content after the loader. The code should be always updated, so after() will not work because the &lt;li&gt; will be incremented. $('.noty').after('&lt;li&gt; Name: ' + jd.name + '&lt;/li&gt;'); How can i do that? basically the &lt;li&gt; elements should be dynamic inserted and the img always preserved.
has comment: http://stackoverflow.com/comment/48032354
has comment: http://stackoverflow.com/comment/48032166
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/48032274
has comment: http://stackoverflow.com/comment/48032287
type: Question
has title: Insert list elements with jquery after img
has comment: http://stackoverflow.com/comment/48032574
has comment: http://stackoverflow.com/comment/48032210
has comment: http://stackoverflow.com/comment/48032592
tagged with: javascript
has comment: http://stackoverflow.com/comment/48032248
has comment: http://stackoverflow.com/comment/48032272

http://stackoverflow.com/comment/48035101
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/29956925
has text: What is your end goal after you get scrollPosition. Are you trying to determine if the scroll bar is at the bottom of the DIV?

http://stackoverflow.com/comment/48001207
type: Comment
has text: Clean and easy to understand +1
type: AnswerComment
comment on: http://stackoverflow.com/a/29938697
score: 0

http://stackoverflow.com/q/29935737
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/29960375
type: Question
has answer: http://stackoverflow.com/a/29936036
accepted answer: http://stackoverflow.com/a/29936036
has title: How can i use timepicker in angular schema forms
tagged with: javascript
tagged with: angular-schema-form
answer count: 2
has answer: http://stackoverflow.com/a/29960375
downvote count: 0
favorite count: 0
tagged with: angularjs
upvote count: 2
tagged with: datetime
has body: I am using angular schema forms https://github.com/Textalk/angular-schema-form/tree/master There is a addon for datepicker https://github.com/Textalk/angular-schema-form-datepicker But it does not support timepicker. How can i add the timepicker or datetime pickers there Date is working fine with this scope.schema = { "type": "object", "properties": { "birthDate": { "title": "Bday", "type": "string", "format": "date" } } }
score: 2

http://stackoverflow.com/q/29959248
has title: 60 degrees angled text in HTML / HTML5 ( in scriptable format )
tagged with: css
has comment: http://stackoverflow.com/comment/48070023
has body: One of the outputs from my software is written in to html5 format. It involves color-coding a particular column of text (depending on position chosen by user) and I have implemented this using monospace font so as to keep text alignment which is of primary requirement. Such highlighted column should be labelled so as to easily track them. Currently I am doing this by displaying label text (shown in red color) vertically but as you could see it is not easily readable (especially true when labels are right next to each other). It will be 1000x better if I could show the label in an angled manner -preferably at 60 degrees. It cannot be hard-coded as the solution needs to scripting compatible. Is there a way to do it in a way that can be scripted? Thanks in advance!! Expected Output: Screenshot of current output: Current HTML code: 2 1 3 0 3 2 4 4 5 6 Line1 MSLLNVPAGKDLPEDIYVVIEIPANADPIKYEIDKESGALFVDRFMSTAMFYPCNYGYIN 60 Line2 MNIKEIPIGNNPPEDVNVIIEVPVDSQPVKYEMDKKSGSLFVDRFISTSMVYPGNYGFIP 60 Line3 -MFIDKIKAKANNDEINVIIEIPMNIGPIKYEFDKESGAVFVDRFMQTTMSYPCNYGFIP 59 Line4 -MFIDKIKAKANNDEINVIIEIPMNSGPIKYEFDKESGAVFVDRFMQTTMSYPCNYGFIP 59 Edit 1: Updated with expected output picture. And code updated per @FelipeAls suggestion on removing font and styling with css instead.
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29998415
possible better answer: http://stackoverflow.com/a/29959500
has comment: http://stackoverflow.com/comment/48039177
type: Question
has answer: http://stackoverflow.com/a/29959500
answer count: 2
has comment: http://stackoverflow.com/comment/48044642
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/29998415
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/29995878
has comment: http://stackoverflow.com/comment/48111498
has answer: http://stackoverflow.com/a/29995908
tagged with: javascript
possible better answer: http://stackoverflow.com/a/29995908
answer count: 3
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29995919
type: Question
has title: Pass a method in a function
has body: How can I pass a method to a function? Ex: alert(myFunc('id')); function myFunc(method){ return document.getElementById('ele').method; } Thank you!
score: 0
has answer: http://stackoverflow.com/a/29995961
accepted answer: http://stackoverflow.com/a/29995919

http://stackoverflow.com/q/29883966
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/47892178
has body: I have a little problem with my functions. When I execute a function which launchs an Ajax call several times, each time, it multiplicate the number of call. For example, I want to send a commentary, the first time, all is going good. But if I want to send another, it will be send twice. And if I do it again, it will be send three times. If you can help me, it will be great :D Thanks in advance. Javascript: $('.modifier').live('click',function(e){ e.preventDefault(); $('#error').hide(); var form = document.querySelector('form') var formdata = new FormData(form); formdata.append('fichier', window.file[0]); //console.log(window.file[0]); $('input[name=titre]').val(''); $('input[name=fichier]').val(''); $('textarea[name=description]').val(''); window.request_upload = $.ajax({ xhr: function() { var xhr = new window.XMLHttpRequest(); //Upload progress xhr.upload.addEventListener("progress", function(evt){ if (evt.lengthComputable) { var percentComplete = evt.loaded / evt.total; $('.chargement').show(); $('.chargement&gt; #progress_bar').css({'width' : percentComplete*100 + '%'}).text(Math.round(percentComplete*100) + '%'); //console.log(percentComplete); } }, false); return xhr; }, url: "foobar.php", type: "POST", data: formdata, async: true , cache: false, contentType: false, processData: false }) .done(function(data){ var json = $.parseJSON(data); //console.log('Data : '+data); //console.log('L\'erreur : '+json.erreur); if(json.erreur == 0) { //console.log(json.titre); var titre = json.titre; $.notify('Votre photo : "'+titre+'" a bien été envoyé !',{autoHideDelay: 10000, className: 'success'}); $('.drop_depot').removeClass('hover'); $('.chargement').hide(); $(this).removeClass('hover'); $('.drop_depot').empty().append('&lt;span&gt;'+options.message+'&lt;/span&gt;'); $('.drop_depot').css({'width': '30%', 'height': '100px' }); $(window).resize(); $('input[type=file]').val(''); } else{ $('.chargement').hide(); $('#error').show().after(json.erreur + ' ' + json.erreurs); } …
tagged with: jquery
has comment: http://stackoverflow.com/comment/47892129
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/47891892
has answer: http://stackoverflow.com/a/29903482
has comment: http://stackoverflow.com/comment/47900559
downvote count: 2
accepted answer: http://stackoverflow.com/a/29903482
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47900471
has comment: http://stackoverflow.com/comment/47891947
type: Question
has title: Avoid multiplication of ajax request
upvote count: 0
score: -2

http://stackoverflow.com/comment/47932931
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29905055
has text: please only post code relevant to the question
score: 1

http://stackoverflow.com/q/30002231
tagged with: dom-events
score: 0
answer count: 3
has comment: http://stackoverflow.com/comment/48123011
upvote count: 1
has answer: http://stackoverflow.com/a/30002360
downvote count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/30002306
accepted answer: http://stackoverflow.com/a/30002306
has title: Why am I getting an uncaught type error with the following code?
has body: The purpose of this code is to have 3 divs that change color when clicked and when the two colors in divs on the left make up the one on the right the user receives a positive message either on the console or the DOM. I thought I had this entirely figured out but now whenever I click a div I get an uncaught type error in Chrome that says: Uncaught TypeError: Cannot read property 'backgroundColor' of undefined Fiddle var squares1 = document.getElementsByClassName('square1'); var squares2 = document.getElementsByClassName('square2'); var squares3 = document.getElementsByClassName('square3'); //change squares1 to either red,green, or blue for(var i = 0; i < squares1.length; i++) { squares1[i].addEventListener("click", changeColor); } //change squares2 to either red, green, or blue for(var i = 0; i < squares2.length; i++) { squares2[i].addEventListener("click", changeColor); } //changes squares3 to either red, green, blue, magenta, cyan, etc for(var i = 0; i < squares3.length; i++) { squares3[i].addEventListener("click", changeColors); } function changeColor(event){ if(event.target.style.backgroundColor == 'rgb(255, 0, 0)') { event.target.style.backgroundColor = 'rgb(0, 255, 0)'; checkColors(); } else if (event.target.style.backgroundColor == 'rgb(0, 255, 0)') { event.target.style.backgroundColor = 'rgb(0, 0, 255)'; checkColors(); } else { event.target.style.backgroundColor = 'rgb(255, 0, 0)'; checkColors(); } } function changeColors(event){ if(event.target.style.backgroundColor == 'rgb(255, 0, 0)') { event.target.style.backgroundColor = 'rgb(255, 0, 255)'; checkColors(); } else if (event.target.style.backgroundColor == 'rgb(255, 0, 255)') { event.target.style.backgroundColor = 'rgb(255, 255, 0)'; checkColors(); } else if (event.target.style.backgroundColor == 'rgb(255, 255, 0)') { event.target.style.backgroundColor = 'rgb(0, 0, 255)'; checkColors(); } else if (event.target.style.backgroundColor == 'rgb(0, 0, 255)') { event.target.style.backgroundColor = 'rgb(0, 255, 25…
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/30002308
has answer: http://stackoverflow.com/a/30002308
type: Question
tagged with: javascript

http://stackoverflow.com/a/29974168
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/71988363
accepted answer of: http://stackoverflow.com/q/29974088
has comment: http://stackoverflow.com/comment/48068484
score: 16
answers question: http://stackoverflow.com/q/29974088
has comment: http://stackoverflow.com/comment/100388163
upvote count: 16
has body: When you click a submit button in a form the click event spawns on the button and bubbles up. The submit event spawns on the form (not the button) and bubbles up from there. If you stop propagation on the click event you're just stopping the bubbling phase of the click event. This has no effect on the submit event. To stop the submit action you have to add a check to the submit handler. Keep in mind that adding e.preventDefault() on the click handler in the button is not enough to prevent the submit event from spawning since there are more ways to submit a form than just clicking a button. (pressing enter in an input field for instance).
has comment: http://stackoverflow.com/comment/100445213
has comment: http://stackoverflow.com/comment/48068312
type: AcceptedAnswer

youtube-javascript-api
type: Tag
tags question: http://stackoverflow.com/q/29944104
tag name: youtube-javascript-api
tags question: http://stackoverflow.com/q/29954343

http://stackoverflow.com/comment/48075495
has text: This is almost a repeat of the documentation !
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29964759

http://stackoverflow.com/comment/47910698
has text: @d_z90 but the example you have given sounds good, let em try that
comment on: http://stackoverflow.com/q/29893569
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/29940280
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/48002206
answer count: 0
has comment: http://stackoverflow.com/comment/48002326
type: Question
has comment: http://stackoverflow.com/comment/48001933
tagged with: addeventlistener
has title: Javascript addEventListener within addEventListener
tagged with: javascript
has comment: http://stackoverflow.com/comment/48002128
tagged with: mouseevent
score: 0
has comment: http://stackoverflow.com/comment/48002248
tagged with: canvas
has comment: http://stackoverflow.com/comment/48002371
has comment: http://stackoverflow.com/comment/48002445
has body: This could be a silly question, but I'm having a hard time with a sequence of event listeners that shouldn't be running all the time basically. I want to click a button that will allow certain mouse events to be performed on a &lt;canvas&gt; element. On mousedown there is something logged to the console, and as long as the the mouse is down I want another statement logging to the console, and then on mouseup there should be a final statement and the mousemove logging will cease. At current, anytime after the first mousedown, there is mousemove logging, completely ignoring the mUp boolean to stop it. It might be that there's something wrong about nesting Event Listeners, but I wasn't really aware of any problems it might cause... Here's my code so far, any help would be appreciated: function mouseMove() { var mX = canvas_x, mY = canvas_y; console.log('move: ' + mX + ',' + mY + ',' + mouseup); } btnRect.addEventListener('click', function (event) { dRect = false; c.addEventListener('mousedown', function () { var x = canvas_x, y = canvas_y; mouseup = false; console.log('down: ' + x + ',' + y + ',' + mouseup); if(mouseup === false) { c.addEventListener('mousemove', mouseMove); } else if (mouseup === true) { c.removeEventListener('mousemove', mouseMove); } else { c.removeEventListener('mousemove', mouseMove); } }); c.addEventListener('mouseup', function () { var eX = canvas_x, eY = canvas_y; mouseup = true; console.log('up: ' + eX + ',' + eY + ',' + mouseup); }); });

http://stackoverflow.com/a/29919301
type: Answer
has body: So does it really matter if I load them while the page is loading, or if I load them after the page has loaded? Just to be clear - we are not comparing lazy loading of images vs. loading all images. All the images will be loaded irrespective of whether the user views them or not. If the images are not loaded upfront, your $(window).load event theoretically fires earlier (theoretically because - see comments in https://stackoverflow.com/a/545005/360067) But since you seem to be using document.ready (and I presume you use the same handler to start up the rest of your javascript) this would not make a difference for your javascript execution. Now, coming to images hogging the bandwidth - it varies by browser (see How to make the browser (IE and Chrome) request images before scripts?). So you might (depending by browser) see the images download holding up subsequent scripts and hence delaying the page startup (note that for IE it also depends on whether you use a normal img tag vs loading an image as a css background - css background images are loaded last) Next, user experience. If your images are large (or the network is slow), delay loading the images may see the user actually clicking through the slides before the images have fully loaded.
score: 2
answers question: http://stackoverflow.com/q/29916329
downvote count: 0
upvote count: 2

http://stackoverflow.com/comment/47845773
score: 0
has text: @joe1234 usually this `$(obj).attr('onclick', 'like_image('+id+' ,'+image_id+ ',this); return false');` is done like that `$(obj).click(function () {like_image(id, image_id, this); return false;});` other than that we really need the other function or more information in general
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29859174

http://stackoverflow.com/comment/48019087
score: 0
type: Comment
comment on: http://stackoverflow.com/q/29949109
type: QuestionComment
has text: You should show the code, but it probably has a wrapper that prevents immediate execution.

http://stackoverflow.com/a/29921923
score: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/48008931
has comment: http://stackoverflow.com/comment/48012587
type: Answer
accepted answer of: http://stackoverflow.com/q/29920466
has body: You can change conventions.vendor in your config to something that won't match your vendor files in order to enable module wrapping. https://github.com/brunch/brunch/blob/master/docs/config.md#conventions
answers question: http://stackoverflow.com/q/29920466
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/48012702
has comment: http://stackoverflow.com/comment/48004144

http://stackoverflow.com/q/29980149
has comment: http://stackoverflow.com/comment/48081381
has answer: http://stackoverflow.com/a/29987859
has comment: http://stackoverflow.com/comment/48080893
answer count: 1
tagged with: javascript
tagged with: jquery
tagged with: ajax
score: 0
has comment: http://stackoverflow.com/comment/48080842
has comment: http://stackoverflow.com/comment/48080703
has comment: http://stackoverflow.com/comment/48081571
has body: I currently have a problem with ajax or loading a fragment of page with $('#id').load("page.php #id"). What I'm trying to do is an image gallery. To allow the user to update the name of an album, I created a form with a button calling an ajax function. This ajax function sends the datas in post like "$_POST['oldAlbumName'] = 'newAlbumName'" (more or less). Unfortunately, nothing happens. I don't know if it comes from the ajax or from the reloading of the span. Here is my PHP : &lt;?php try { $bdd = new PDO('mysql:host=localhost;dbname=bd;charset=utf8', 'root', ''); $reponse = $bdd-&gt;query('SELECT DISTINCT album AS A from galerie'); while($donnees = $reponse-&gt;fetch()) { echo $donnees['A']."&lt;br/&gt;"; if(isset($_POST[$donnees['A']."_text"])) { echo $_POST[$donnees['A']."_text"]."&lt;br/&gt;"; echo $donnees['A']."_text&lt;br/&gt;"; $bdd-&gt;query("UPDATE galerie SET album ='".$_POST[$donnees['A']."_text"]."' WHERE album='".$donnees['A']."_text'"); } } } catch(Exception $e) { echo "Impossible de se connecter à la BDD&lt;br/&gt;"; }?&gt; (The echo only prints "Rouge", which is normal) And here is my JS : function renommageAjax(textID) { var splitted = textID.split("_"); var champ = splitted[0]; $.ajax({ type: "POST", url: "Galerie.php", data: { textID: $("#"+textID).val(), }, dataType: "text", success: function(data) { alert(textID); $('#'+champ+'_name').html($("#"+textID).val()); $('#updateSpan').load("Galerie.php #updateSpan"); } }); } (The alert prints "Rouge_text" in my case, wich is also normal) Of course, my php is between two spans with the ID "updateSpan", in the page "Galerie.php". Where is/are my error(s) ? Thank you !
tagged with: load
has title: Ajax or loading a fragment of page does not work
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/48081908
has comment: http://stackoverflow.com/comment/48091612
tagged with: php
has comment: http://stackoverflow.com/comment/48081999
has comment: http://stackoverflow.com/comment/48081115
type: Question
has comment: http://stackoverflow.com/comment/48080465

http://stackoverflow.com/comment/82041296
score: 0
comment on: http://stackoverflow.com/a/29912287
has text: @K3N haha this may be the latest reply I have received but I do appreciate you explaining this, thanks!
type: AnswerComment
type: Comment

http://stackoverflow.com/a/29914470
score: 0
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/29913887
answers question: http://stackoverflow.com/q/29913887
has body: I think ngElse is not a built-in directive, but you could just use another ngIf. http://plnkr.co/edit/HB7zK0Q8nGFRkj44U1AR?p=preview {{x}} is in b {{x}} is not in b: b: {{x}}

http://stackoverflow.com/q/29997650
type: UnansweredQuestion
tagged with: menu
score: 2
upvote count: 2
tagged with: onclick
type: Question
has answer: http://stackoverflow.com/a/29997945
has body: I'm currently attempting to learn Javascript so that I can create a multi-level menu that only expands on click. The reason I'm trying to do it this why rather than simply use element:hover in CSS is because I have very many menu items in my menu, and when the sub-menus randomly expand on hover "without permission", it can make it harder, and frustrating, to get at certain menu options. Since I want to avoid frustrating my visitors, I'm trying to get it to work "on click". I feel like I have the basic idea down, but clearly lacking in execution. I've seen samples of other onClick code, but they were only for 1 level submenus, and I have a 4 level menu. Here is my code. http://jsfiddle.net/bbm4hzs8/ HTML Link Sub Menu Links Here Drop Meny Links Here Slide Out Menu Links Here Slide Out Menu Links Here Slide Out Menu Links Here Javascript function MenuClick( ) { /* ------- Defining Variables ------ */ var Nav-Tabs = document.getElementByClassName("Nav-Tabs"); var Sub-Tabs = document.getElementByClassName("Sub-Tabs"); var Drop-Tabs = document.getElementByClassName("Drop-Tabs"); if (Nav-Tabs.onClick) { Parent = Nav-Tabs; Child = document.getElementById("Sub-Menu"); } if (Sub-Tabs.onClick) { Parent = Sub-Menu; Child = document.getElementById("Drop-Menu"); } if (Drop-Tabs.onClick) { Parent = Drop.Menu; Child = document.getElementById("Slide-Menu"); } /* -------- Parameters ------------ */ if ( Parent.onClick) { if (Child.style.display = "none") { Child.style.display = "block"; } else Sub-Menu.style.display = "none" } } /* ------ Activate Menu Buttons ------ */ document.getElementByClassName("Nav-Tabs").onClick = MenuClick; document.getElementByClassName("Sub-Tabs").onClick = MenuClick; document.getElementByClassName("Drop-Tabs").onClick = MenuClick; My goal is to have a menu that expands on click, contracts on click, and if you were to click on a different menu item while a sub-menu was open, that sub-menu would close. Does that make sense? I know this code only tackles th…
tagged with: javascript
answer count: 1
downvote count: 0
favorite count: 0
has title: Any tips/tutorials for creating a multi-level drop-down on-click javascript menu?
tagged with: expand
has comment: http://stackoverflow.com/comment/48316874

http://stackoverflow.com/a/29909322
type: Answer
has body: If you call React.render(component, element) on the client where element points to a DOM node that contains your server-rendered React markup and component is instantiated with the same props as on the server (and assuming the props/state matches all the way down), React will transparently upgrade your static markup into an interactive React app. See this JSFiddle example that demonstrates this technique: http://jsfiddle.net/BinaryMuse/ddvdppeg/ (note that there is a 1 second delay before the markup is upgraded to an interactive app, but only for demonstration purposes).
upvote count: 1
has comment: http://stackoverflow.com/comment/47942053
answers question: http://stackoverflow.com/q/29909006
type: AcceptedAnswer
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/29909006

http://stackoverflow.com/a/29894637
answers question: http://stackoverflow.com/q/29894461
has body: ng-click and ng-repeat are in same div. You can add a new div in this repeated div like and this is works for me : Select This item {{record.id}} {{record.rfcObject}} {{record.rfcFunction}} {{record.status}} {{mii.utils.date.extToIntDate(record.firstProcessing)}}
score: 0
type: Answer

http://stackoverflow.com/q/29935330
upvote count: 1
type: Question
score: 1
has answer: http://stackoverflow.com/a/29935434
has body: I've leraned js for a few days as topic I want to put several hyperlinks in a var var aaa = [ 'www.google.com', 'www.yahoo.com', 'www.facebook.com']; $('#showlink').text(aaa[2]); and then "www.yahoo.com" link will show in html,it's an url &lt;div id="showlink"&gt; &lt;/div&gt; how can i do for that?
has comment: http://stackoverflow.com/comment/47992519
has title: How to add Hyperlink in javascript var?
has answer: http://stackoverflow.com/a/29935407
downvote count: 0
has answer: http://stackoverflow.com/a/29935412
tagged with: javascript
favorite count: 0
answer count: 3
tagged with: http://stackoverflow.com/tag/html
tagged with: var
type: UnansweredQuestion

http://stackoverflow.com/comment/47935777
has text: @EricJ. I think the upvoted comment from user1403582 answers the question pretty well actually. Maybe I framed it wrong; I wasn't looking for the spec-writer's intentions.
type: QuestionComment
score: 0
type: Comment
comment on: http://stackoverflow.com/q/29906553

http://stackoverflow.com/comment/47960362
comment on: http://stackoverflow.com/a/29906584
has text: Ok, but I'm not trying in my example to access a specific bucket, I just want to see the names of buckets available in the specified account. So logically it has nothing to do with CORS settings of the bucket. If some bucket has no CORS enabled the it should not appear in the response for example, but i'm getting error in the request.
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/comment/47839680
has text: I add comment above: "I need to show to user mobile view of site, by clicking button(for example)."
comment on: http://stackoverflow.com/a/29856798
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/47963409
comment on: http://stackoverflow.com/a/29919650
score: 0
type: Comment
has text: I have upvoted your answer because you did provide a solution to the first question and it was well written. But I have marked New Dev's answer as correct for the actual include issue :)
type: AnswerComment

http://stackoverflow.com/a/32549748
type: Answer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/29935254
upvote count: 1
accepted answer of: http://stackoverflow.com/q/29935254
type: AcceptedAnswer
has body: Thanks to the comments above, I was able to get this working simply by changing the last portion of the code below to reflect the submit event for the View Object, rather than a submit event for a form tag within the View Object. /** * Form View */ Stratus.Views.Form = Backbone.View.extend({ tagName:'form', el: '#formAsync', events: { 'submit': 'catchSubmit' }, initialize: function() { console.log('Form Initialized'); }, catchSubmit: function(e) { console.log("Caught Submission!"); e.preventDefault(); } });

http://stackoverflow.com/comment/48001660
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/29940241
type: Comment
has text: yes, it willl work if we do call(event), without using event while calling the function we have to do.

http://stackoverflow.com/a/29878737
has body: The basic idea would be: function nextPrev(array, direction, currentPointer) { var index = array.indexOf(currentPointer); if (direction=="left") { return array[index == 0 ? array.length-1 : index-1]; } else if (direction=="right") { return array[index == array.length-1 ? 0 : index+1]; } else { // default action or throw error } } You can reorganize this a bit: function nextPrev(array, direction, currentPointer) { var index = array.indexOf(currentPointer); var len = array.length; if (direction=="left") { index--; } else if (direction=="right") { index++ } else { // default action or throw error } return array[(index + len) % len]; } You might want to add a check that array.indexOf returns a valid index (in case currentPointer contains something not in array).
downvote count: 0
type: Answer
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/29878639

http://stackoverflow.com/comment/47939125
has text: @Amadan is correct. All code needed to be secure should be executed on the server. An access token is just to verify the users identity on the server so it can decide whether or not to perform the task.
score: 0
type: Comment
comment on: http://stackoverflow.com/q/29908241
type: QuestionComment

http://stackoverflow.com/a/56372815
has body: This is my spin on things. I found that Audi Nugraha’s solution worked when testing, but not when I tried it in an Electron application. A solution which did work for me was to position the cursor to the beginning and then blur/focus. textarea.selectionEnd = textarea.selectionStart = position; textarea.blur(); textarea.focus(); I have incorporated the above into a function: function scrollTextarea(textarea,position) { textarea.selectionEnd = textarea.selectionStart = position; textarea.blur(); textarea.focus(); }
type: Answer
answers question: http://stackoverflow.com/q/29899364
downvote count: 0
score: 1
upvote count: 1

http://stackoverflow.com/comment/48189149
type: AnswerComment
comment on: http://stackoverflow.com/a/29980044
score: 0
type: Comment
has text: It's not working on mobile. When I zoom in on the page I want it to stay centered. I've added a picture of what's happening.

http://stackoverflow.com/comment/48005877
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/29921541
type: Comment
has text: Thank you for tip on using a plugin. I have tried a few plugins to achieve this but couldn't get the results I wanted which is why I am trying to do it without a plugin. Plus it a great way for me to expand my knowledge.

http://stackoverflow.com/comment/82631483
score: 1
comment on: http://stackoverflow.com/a/29927491
type: AnswerComment
type: Comment
has text: This answer does not work properly. The animation is wrong, it does an animation like it was offsetting of 3 but it actually offsets the images by 1.

http://stackoverflow.com/q/29902920
has answer: http://stackoverflow.com/a/29903110
downvote count: 0
tagged with: javascript
answer count: 3
has answer: http://stackoverflow.com/a/29903057
has comment: http://stackoverflow.com/comment/47928506
favorite count: 0
tagged with: angularjs-ng-click
has answer: http://stackoverflow.com/a/29902995
possible better answer: http://stackoverflow.com/a/29903057
tagged with: angularjs
upvote count: 2
has title: Toggle class between two buttons in Angular but restrict to prevent same button from changing class
tagged with: ng-class
has body: Trying to create some very basic functionality which basically makes two buttons behave like radio buttons. Have two buttons that are used to show/hide different content based on what is shown. So it is working as expected except for it is changing on any click. So if I click the same button twice then it changes the class. I only need it to change if the other button is clicked: YES NO So if Yes is clicked then it should update and No should too. But if Yes is clicked again before No is clicked then there should be no change. Here is a Plunkr to play with: Plunkr Demo
accepted answer: http://stackoverflow.com/a/29902995
score: 2
type: AnsweredQuestion
type: Question

http://stackoverflow.com/comment/47879025
type: Comment
type: QuestionComment
has text: Read the [**documentation**](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/search), `string.search` accepts a **regular expression** !
score: 3
comment on: http://stackoverflow.com/q/29877444

http://stackoverflow.com/comment/48122144
type: QuestionComment
type: Comment
has text: How you want to style the slider? And right arrow is working fine.
score: 0
comment on: http://stackoverflow.com/q/30000357

http://stackoverflow.com/comment/47895548
has text: @GabrielPires This is all contained in my app.js file. I have yet to break things apart. Index.html includes the app.js
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29885685

http://stackoverflow.com/comment/47959740
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29919178
type: Comment
has text: Yup, I've tried this. I think the problem is that the directive is declared inside the templateUrl and is not compiled by angular. But I really don't know how to solve it.

http://stackoverflow.com/q/29908261
score: 9
tagged with: javascript
possible better answer: http://stackoverflow.com/a/29908318
answer count: 2
tagged with: events
has answer: http://stackoverflow.com/a/29908318
favorite count: 0
upvote count: 9
has body: How can I prevent text selection without using the traditional method e.stopPropagation (related question at bottom)? Is there a call I can make to say "unhighlight whatever is highlighted"? I bound mouse events on the document because there are about a hundred [more or less] elements in the page that I want to have interact with each other. The reason I don't bind events to the elements instead is because when the mouse moves off the element, all mouse events stop triggering. I need to bind to the document to correctly watch mouse events. The problem with using the method traditional method (link below) is that by the time the listener is triggered, the elements with text has already evaluated the mouse event. My code works fine for Chrome. The issues below applies to Firefox. Related Question: How can I prevent text/element selection with cursor drag This talks about preventing bubbling to the text element with: if(e.stopPropagation) e.stopPropagation(); if(e.preventDefault) e.preventDefault(); e.cancelBubble=true; e.returnValue=false; return false;
linked to: http://stackoverflow.com/q/5429827
has title: Prevent text selection on mouse drag
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29908832
accepted answer: http://stackoverflow.com/a/29908832
downvote count: 0
type: Question

http://stackoverflow.com/comment/48058419
comment on: http://stackoverflow.com/q/29969136
has text: possible duplicate of [how to generate Excel through Javascript](http://stackoverflow.com/questions/333537/how-to-generate-excel-through-javascript)
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/47952985
score: 0
type: Comment
type: QuestionComment
has text: What is not working for you?
comment on: http://stackoverflow.com/q/29897729

http://stackoverflow.com/comment/47823602
score: 0
type: Comment
type: QuestionComment
has text: the issue does not occurs to me: all seems to go the right way.
comment on: http://stackoverflow.com/q/29848011

http://stackoverflow.com/a/33562308
accepted answer of: http://stackoverflow.com/q/29920784
answers question: http://stackoverflow.com/q/29920784
has comment: http://stackoverflow.com/comment/93194388
score: 48
has body: swal({ title: "An input!", text: "Write something interesting:", type: "input", showCancelButton: true, closeOnConfirm: false, animation: "slide-from-top", inputPlaceholder: "Write something" }, function(inputValue){ if (inputValue === null) return false; if (inputValue === "") { swal.showInputError("You need to write something!"); return false } swal("Nice!", "You wrote: " + inputValue, "success"); });
type: AcceptedAnswer
downvote count: 0
upvote count: 48
type: Answer

http://stackoverflow.com/comment/47912432
score: 0
type: AnswerComment
has text: @DougLerner "I don't know what you mean by not processing the raw JSON though." --- I mean that the `\uXXXX` literal in JSON string exists only before the JSON string was parsed. After it was - it's a parser job to substitute it with the actual character. So I highly recommend you to not apply any string functions to the raw JSON string as it may potentially damage its structure. But in your case that might be necessary though, as you say they are broken initially.
type: Comment
comment on: http://stackoverflow.com/a/29892414

http://stackoverflow.com/a/29946549
type: Answer
score: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29945288
answers question: http://stackoverflow.com/q/29945288
has body: still i cannot see any HTML of DropDown-Menu. you use $('.clickable-dropdown ..... where is this Element and its Sub-Elements? How can I change this, so that the dropdown will always be open, and only can be closed by clicking somewhere on the website or on the event? here is a very simple Example of how a DropDown-Menu could be implemented! its just a DEMO: http://jsfiddle.net/f43yh0jk/4/ HTML: ABOUT MY STORY MY STYLE MY STYLE X MY STYLE Y SERVICE MY PRICING SERVICES CSS: .TREE{ background: #3f4c6b; } .TREE > .NODE{ background: #313654; display: inline-block; border-left: 1px solid #000; border-right: 1px solid #3f4c6b; position: relative; cursor: pointer; } .TREE > .NODE:FIRST-CHILD{ border-left: 0px solid #000; } .TREE > .NODE:LAST-CHILD{ border-right: 0px solid #000; } .TREE > .NODE:HOVER{ background: #3f4c6b; } .TREE > .NODE a.NODE-LINK{ display: block; padding: 5px 10px 5px 10px; font-size: 13px; font-weight: bold; color: #FFF; } .TREE > .NODE .NODES{ position: absolute; left: 0px; top: 100%; background: #3f4c6b; padding: 5px; display: none; } .TREE > .NODE .NODES .NODE a.NODE-LINK{ display: block; white-space: nowrap; } .TREE > .NODE .NODES .NODE:HOVER{ background: #313654; } JS/JQuery: $(".TREE > .NODE > a").click(function(event){ event.preventDefault(); }); $(".TREE > .NODE").click(function(event){ event.stopPropagation(); $(this).parent().find(".NODE").not(this).find(".NODES").slideUp(); $(this).find(".NODES").slideToggle(); }); $(document).click(function(event ) { $(".TREE .NODES").slideUp(); });

http://stackoverflow.com/q/29888185
score: 1
favorite count: 0
tagged with: cordova
accepted answer: http://stackoverflow.com/a/29888235
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/20833762
upvote count: 1
tagged with: paypal
has title: PayPal LogIn Button in PhoneGap
type: Question
has body: I am trying to add a "Login with PayPal" button on my PhoneGap app. I am following the instructions on this stackoverflow question: Using Paypal Login API I created an app and matched the settings under advanced options. Now I think I am not understanding this correctly. These are the settings I used on the Dynamic Log In with PayPal Button JavaScript Builder (https://developer.paypal.com/docs/integration/direct/identity/button-js-builder/): Now it does come back to my localhost page but that url contains this: http://localhost/?error_uri=http%3A%2F%2Flocalhost&error_description=Client+Validation+Error%3A+Invalid+scope.&error=invalid_scope What does this mean? Why is it saying that scope is invalid and client validation error etc. It did come back to the page that I specified. Also, what should have come back from this? I am having trouble understanding what will be the next step after this request. Here is what I understand: In my PhoneGap application, I will have this button showing up for user to make a payment to me. On clicking this button, user should be prompted to select to either pay by logging in with their PayPal account or by entering card number. I did do this in an Android PhoneGap project and that was what was presented. Is the JavaScript function authorizing me as a valid user by inputting all those details? It is the user who should get authorized. Please will appreciate any efforts to help me understand this. I am doing all this in Sandbox testing environment, so I have a generated credit card number for a buyer and business facilitator account. Here is what I saw when I tried doing the same thing on Android PhoneGap project: Update So this is what I did. I changed my call to the following: I received this window now: But I haven't got the OAuth access token like the developer site says that I should have in order to make any requests. What am I missing? Any help is appreciated. Update: I made further progress by logging in with valid PayPal creden…
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/29888235
answer count: 1

http://stackoverflow.com/comment/48029514
score: 0
type: Comment
has text: Are you using jQuery?
type: QuestionComment
comment on: http://stackoverflow.com/q/29954373

http://stackoverflow.com/q/29982985
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has answer: http://stackoverflow.com/a/29983045
type: AnsweredQuestion
downvote count: 0
has title: Printing out mutated vowel with CSS
type: Question
has body: I am creating the Table headers for my responsive Table in CSS like this: td:nth-of-type(1):before { content: "Abfahrtszeitpunkt"; } td:nth-of-type(2):before { content: "Startort"; } td:nth-of-type(3):before { content: "Zielort"; } td:nth-of-type(4):before { content: "Karte"; } td:nth-of-type(5):before { content: "Bewertung"; } td:nth-of-type(6):before { content: "Fahrt löschen"; } But when I load this table in my webbrowser the "ö" doesn't get shown in the correct way. The webside only prints out a rhomb with a question mark in it. I already tried fixing it with html and javascript, but it doesnt work. Is there a easy way to fix my problem?
has comment: http://stackoverflow.com/comment/48087247
score: 3
answer count: 1
has comment: http://stackoverflow.com/comment/48085356
tagged with: javascript
has comment: http://stackoverflow.com/comment/48085325
accepted answer: http://stackoverflow.com/a/29983045
favorite count: 0
upvote count: 3

http://stackoverflow.com/q/29893781
score: -2
has comment: http://stackoverflow.com/comment/47910426
has comment: http://stackoverflow.com/comment/47910879
tagged with: javascript
tagged with: jquery
answer count: 3
has title: Nesting an array of objects in javascript by matching details
has comment: http://stackoverflow.com/comment/47910952
has comment: http://stackoverflow.com/comment/47911090
favorite count: 0
has answer: http://stackoverflow.com/a/29894023
possible better answer: http://stackoverflow.com/a/29893912
has answer: http://stackoverflow.com/a/29893912
has comment: http://stackoverflow.com/comment/47910870
has answer: http://stackoverflow.com/a/29894314
has comment: http://stackoverflow.com/comment/47911004
type: AnsweredQuestion
has body: I have an array of objects and some of the objects shares the same id, is there a quick way to nest them so they can be grouped, such as from: var items = [ { id: 5, title: 'wow', name: 'item1' }, { id: 5, title: 'wow', name: 'item2' }, { id: 26, title: 'latest', name: 'item3' }, { id: 26, title: 'latest', name: 'item4' } ]; To: var items = [ [{ id: 5, title: 'wow', name: 'item1' }, { id: 5, title: 'wow', name: 'item2' } ], [{ id: 26, title: 'latest', name: 'item3' }, { id: 26, title: 'latest', name: 'item4' } ] ]; When you don't have any details about those objects in advance, i could use simple loops for that but i am looking for a shorter, smart solution if there is one, something like: for each in items group by the same id's under arrays or something.
downvote count: 3
has comment: http://stackoverflow.com/comment/47911174
upvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/29894314

http://stackoverflow.com/q/29858041
linked to: http://stackoverflow.com/q/17184791
type: Question
has answer: http://stackoverflow.com/a/29858202
has answer: http://stackoverflow.com/a/56323092
has answer: http://stackoverflow.com/a/29858126
tagged with: javascript
has title: Jade conditional based on page url?
answer count: 3
tagged with: pug
score: 3
has body: Is it possible to setup a jade conditional in my layout template based on page path? Is there a page path variable? I am looking to do things like: if page = "/about" link(rel='stylesheet', href='css/about') else link(rel='stylesheet', href='css/main') Where this is part of the layout template. Where and how do I define the variables to drive this?
downvote count: 0
favorite count: 0
type: UnansweredQuestion
tagged with: node.js
upvote count: 3

http://stackoverflow.com/comment/48107434
has text: OK, what conditions would cause it to hit the error function?
type: QuestionComment
score: 0
type: Comment
comment on: http://stackoverflow.com/q/29993862

http://stackoverflow.com/a/30000234
has comment: http://stackoverflow.com/comment/48120091
score: 0
answers question: http://stackoverflow.com/q/29999971
type: Answer
has body: If you truly want to use C# and Chrome, go for CefSharp: which is bindings for .NET and Chromium browser. I think it could be a lot easier to use Electron or nw.js, but these would require you code in javascript, which of cause also will make custom javascript calls easier. Side note: The new Visual Studio Code is actually built with Electron, so even microsoft uses that for doing javascript/web technology based apps.
has comment: http://stackoverflow.com/comment/48119813

http://stackoverflow.com/q/29928964
has body: I want to add some arguments to all images in a website, but these are dynamic. Unfortunately the (only) way I have to do this would be by intercepting the image before loading. Javascript would be the only way to go here since I can change the header. Any third party libraries like jquery are not an option. Something like: http://www.example.com/acme.jpg Would be captured and transformed into http://www.example.com/acme.jpg?v=120 The way I see it javacript would have to be, inline, in the header of the page, before the images start to load. I don't need to change the html itself, only intercept when the browser calls the image and tweak it a bit as ilustrated. Is this possible?
type: Question
score: 0
upvote count: 1
tagged with: function
has answer: http://stackoverflow.com/a/29929187
answer count: 1
downvote count: 1
tagged with: javascript
favorite count: 0
has title: Is it possible to intercept http calls to images and change them with javascript?
linked to: http://stackoverflow.com/q/14415027
has comment: http://stackoverflow.com/comment/47981207
has comment: http://stackoverflow.com/comment/47981073
has comment: http://stackoverflow.com/comment/47980184
has comment: http://stackoverflow.com/comment/47981137
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47980073

http://stackoverflow.com/a/29896298
has body: Please correct your json : var jsonVar = {test :{ "name":"test", "age":"99" }}; Also avoid creating a variable using reserved words like json. use jsonVar, jsonVal etc. console.log(jsonVar); console.log(jsonVar.test); console.log(jsonVar.test.name); console.log(jsonVar.test.age); and their respective ans in firebug console. Object { test={...}} Object { name="test", age="99"} test 99
type: Answer
score: 0
answers question: http://stackoverflow.com/q/29896107

http://stackoverflow.com/comment/47893365
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29865017
type: Comment
has text: @Oriol I have to agree, this answer is *wrong* and misleading. If selman's problem is solved, it must have been for something else and maybe should be properly addressed.

http://stackoverflow.com/comment/47913358
type: Comment
comment on: http://stackoverflow.com/a/29895300
has text: Put a sibling in there though instead of a child and it breaks: http://jsfiddle.net/sL7joxhs/ - Highlight some text from `test1` and `test2` and it wraps both divs in a span and breaks structure
type: AnswerComment
score: 4

http://stackoverflow.com/comment/47824242
score: 0
type: Comment
type: QuestionComment
has text: @user1680977 No need to post, but upon inspection there are no blank option fields, it looks legitimate, but not for the end-user, very strange issue
comment on: http://stackoverflow.com/q/29848473

http://stackoverflow.com/a/29982401
has comment: http://stackoverflow.com/comment/48098240
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/48120106
score: 2
has body: try changing these: &lt;input type="submit" value="Send Message to Server" onclick="start()" /&gt; function start() { var text = document.getElementById("userinput").value; webSocket.send(text); return false; } to: &lt;input id="submitButton" type="submit" value="Send Message to Server" /&gt; function start() { var text = document.getElementById("userinput").value; webSocket.send(text); return false; } var subm = document.getElementById("submitButton"); subm.addEventListener("click", start, false);
upvote count: 2
has comment: http://stackoverflow.com/comment/48085541
answers question: http://stackoverflow.com/q/29962125

http://stackoverflow.com/comment/47968354
type: QuestionComment
has text: Where are you applying `ng-app`, in the body or html tag? It appears you have forgotten to use the `ng-app` directive, because it appears to be rendering your HTML label content literally. This is usually the case when Angular is not told what part of the DOM to govern.
score: 1
type: Comment
comment on: http://stackoverflow.com/q/29923286

http://stackoverflow.com/comment/47962384
type: Comment
type: QuestionComment
has text: Same problem @HarveySpecter
score: 0
comment on: http://stackoverflow.com/q/29920263

http://stackoverflow.com/comment/48004306
comment on: http://stackoverflow.com/a/29941129
has text: Thanks @Sebastian, can we make the same thing for i.e. {x:0,y:0} points/coordinates, color structure for each cell is same as you did. Thanks again made my day....
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/47872876
type: Comment
comment on: http://stackoverflow.com/a/29873938
has text: that is very frustrating... it works as soon as I cancel the font-size in fire-bug
type: AnswerComment
score: 0

http://stackoverflow.com/q/29900146
has title: How to insert in SVG using native JS in IE11?
type: Question
tagged with: javascript
tagged with: title
has comment: http://stackoverflow.com/comment/47975743
score: 0
has body: I got this: hello world I also tried using: // "this" is the svg element already var use = document.createElementNS("http://www.w3.org/2000/svg", "use"); use.setAttributeNS("http://www.w3.org/1999/xlink", "xlink:href", "mydefs.svg#hello"); var title = document.createElementNS("http://www.w3.org/2000/svg", "title"); title.textContent = "hello world"; this.appendChild(use); this.insertBefore(title, use); However, after it exits the function, IE11 simply replaced the inner content of the svg with the path that were defined from mydefs.svg ignoring completely the dynamic title tag that i tried to put in there. If i put the title directly in the mydefs.svg, then i will see the title tag, however when you mouse hover, the tooltip will not show up either. What's the correct way to generate the title tag for SVG in IE11?
tagged with: http://stackoverflow.com/tag/svg
answer count: 0
type: UnansweredQuestion
tagged with: internet-explorer-11
has comment: http://stackoverflow.com/comment/47945703

http://stackoverflow.com/comment/47862219
comment on: http://stackoverflow.com/a/29867639
score: 0
type: Comment
has text: Sure, you can do `delete item.name`
type: AnswerComment

http://stackoverflow.com/q/29961050
tagged with: popup
has comment: http://stackoverflow.com/comment/48042934
has comment: http://stackoverflow.com/comment/48043384
type: Question
answer count: 1
tagged with: javascript
tagged with: share
has comment: http://stackoverflow.com/comment/48043431
score: 0
has body: How to detect sharing result if I'm not using social network's Javascript SDK? All social network's stuff (authorization, sharing, etc.) happens in popups on my domain. var popup = window.open('/api/share/' + service + '/page/123', '', 'top=' + top + ', left=' + left + ', width=400, height=500'); When sharing popup opens user can press Facebook's (or any other social service) share button and popup closes. But, user also can just close a popup without sharing. So, how do I know user shared or user closed a popup? If I use social network's Javascript SDK, eg. Facebook Javascript SDK, it is pretty simple: $('#shareButton').click(function() { FB.ui({ method: 'feed', link: 'https://developers.facebook.com/docs/dialogs/', caption: 'An example caption', }, function(response) { if (response === null) { console.log('user just closed a popup'); } else { console.log('user really shared a post ' + response.post_id); } }); }); I'm using Facebook, Google+, Twitter and Vkontakte social networks on my web page and I really do not want to include four Javascript SDK on my web page (Twitter does not even have JS SDK actually).
has comment: http://stackoverflow.com/comment/48043290
has comment: http://stackoverflow.com/comment/48043574
has title: Catch share result in popup
type: UnansweredQuestion
tagged with: facebook
has comment: http://stackoverflow.com/comment/48043363
has answer: http://stackoverflow.com/a/29961520

http://stackoverflow.com/comment/48080084
type: Comment
type: QuestionComment
score: 2
comment on: http://stackoverflow.com/q/29980190
has text: Hey arindam, I just tried out your code and its working fine without any error. Please check in chrome dev tool if your JS file is loaded correctly(not throwing 404)because I tried with Inline javascript.

http://stackoverflow.com/comment/48072377
has text: I did consider the separate array, though it didn't seem quite right because it means I need to merge the two "states" in the render() function and anywhere else I want to get the currently selected items.
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29974541
score: 0

http://stackoverflow.com/comment/78921776
type: AnswerComment
has text: What is `Buffer`? I can't find any reference for this. Only `ArrayBuffer` exists, but it doesn't expect the arguments you've provided.
type: Comment
comment on: http://stackoverflow.com/a/35381681
score: 1

http://stackoverflow.com/a/29934881
has comment: http://stackoverflow.com/comment/91029052
type: Answer
has body: When you write: arr["Hello"]=... you are creating a new Object associated with the arr Array object, which does not affect the length of arr. You can achieve the same effect by writing: arr.Hello=...
answers question: http://stackoverflow.com/q/29934583
score: 0

http://stackoverflow.com/q/29965686
type: Question
has body: I'm new to development section . I have developed a code for inserting the time of an employee by giving the pause / resume option. The problem i've been facing is I could able to retrieve only the page starting time and first time pausing after that while resuming the time is dispalying the page starting time but where as i need the resuming time . for ex : the page starting time is 1430389269247 and the page pausing time is 1430389301723 and the page resuming time is 1430389314550 and again when i give pause the time has to start from resuming time 1430389314550. but instead i can get only starting time 1430389269247. $(document).ready(function() { var startTime = Date.now(); var pausedTime; alert(""+startTime); $('#btn_pause_resume').click(function () { if ($(this).data('paused')==='false') { //alert('Resumed...'); //$(this).data('paused', 'true'); resumedTime = Date.now(); var UrlToPass = 'action=pauseTime&amp;pausedTime='+pausedTime+'&amp;resumedTime='+startTime; $.ajax({ // Send the credential values to another checker.php using Ajax in POST menthod type : 'POST', data : UrlToPass, url : 'pauseTimer.php', success: function(responseText){ // Get the result and asign to each cases if(responseText == 0){ // window.location = 'index.html'; } else if(responseText == 1){ alert("Sucess"); //window.location = 'majorprocess.php'; } else{ alert('Problem with sql query'); } } }); } else { pausedTime = Date.now(); alert('Paused...'); // alert(""+pausedTime); var UrlToPass = 'action=workTime&amp;startTime='+startTime+'&amp;pausedTime='+pausedTime; $.ajax({ // Send the credential values to another checker.php using Ajax in POST menthod type : 'POST', data : UrlToPass, url : 'workedTimer.php', success: function(responseText){ // Get the result and asign to each cases if(responseText == 0){ // window.location = 'index.html'; } else if(responseText == 1){ alert("Sucess"); //window.location = 'majorprocess.php'; } else{ alert('Problem with sql query'); } } }); $(this).data('pau…
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/29967010
answer count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/48053616
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: php
has title: fetching the current time and insert into database

http://stackoverflow.com/comment/48026154
score: 0
type: AnswerComment
type: Comment
has text: See also: http://stackoverflow.com/questions/22560413/html5-web-audio-convert-audio-buffer-into-wav-file
comment on: http://stackoverflow.com/a/29952503

http://stackoverflow.com/a/29866302
has body: well if you really want to know about the internals and want to digg into the deep rabbit hole of rendering engines i'd give you a start by pointing you to certain source files of chromium: http://src.chromium.org/viewvc/blink/trunk/Source/core/dom/Element.cpp you could find stuff like innerHTML and how it actually works in it. (around line 2425) .getElementById() will just resolve to a document element that matches the specified id and will return a reference to it. its some kind of identifier with prototyped methods, getters and setters to interact with that element. as soon as you interact with methods like innerHTML etc. you will simply tell the engine to execute that action on the element that is referenced inside the element reference. just digg around inside the source code. you might get a good insight: http://src.chromium.org/viewvc/blink/trunk/Source/core/dom/
answers question: http://stackoverflow.com/q/29866145
score: 0
type: Answer

http://stackoverflow.com/a/29887246
type: Answer
answers question: http://stackoverflow.com/q/29887064
has comment: http://stackoverflow.com/comment/47899068
has comment: http://stackoverflow.com/comment/47899180
has comment: http://stackoverflow.com/comment/48429513
score: 1
has body: You could iterate over all lines in the table and calculate the value. Here's a quick example: function calculateTableTotal() { var total = 0; $('#voucher_line tr td input[type="text"]').each(function() { // find the amount input field var $input = $(this); total += parseInt($input.val()); }); alert('The total is : ' + total); }
upvote count: 1
downvote count: 0

http://stackoverflow.com/comment/47957959
type: AnswerComment
has text: `appendControls` is getting called?
comment on: http://stackoverflow.com/a/29918114
type: Comment
score: 0

http://stackoverflow.com/a/29855360
accepted answer of: http://stackoverflow.com/q/29855130
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/29855130
type: Answer
score: 1
has comment: http://stackoverflow.com/comment/47891922
upvote count: 1
has body: Assuming you're going to use jQuery: $(document).ready(function(){ var dueDate = new Date("8/15/2015"); var today = new Date(); if(today &gt; dueDate){ $("#preferredFirstName").prop("disabled", "disabled"); $("#preferredLastName").prop("disabled", "disabled"); } }); fiddle: http://jsfiddle.net/ar5mkdfo/

http://stackoverflow.com/comment/48235066
type: QuestionComment
comment on: http://stackoverflow.com/q/29956640
has text: Also a public demo of the upload link like this would help to provide a reliable solution.
score: 0
type: Comment

angular-dart
tag name: angular-dart
tags question: http://stackoverflow.com/q/29900290
type: Tag

http://stackoverflow.com/comment/47841183
type: QuestionComment
type: Comment
score: 2
has text: @JorgeF `async: false` is never the answer.
comment on: http://stackoverflow.com/q/29857639

http://stackoverflow.com/comment/47993879
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29925710
type: AnswerComment
has text: Yup, agreed. But, when the projects starts to scale, its good to have automated builds.. Plus learn grunt as per your needs, no need for mastery. Basics and using plugins, you can learn in 2,3 hours.

http://stackoverflow.com/a/71694051
downvote count: 3
has body: A bit outdated question, but had similar request since I'm working with Angular + PrimeNG (which uses chart.js) with npm for packages. Just install types from npm i --save-dev @types/chart.js and then use it for example: import { Chart } from 'chart.js'; … const myOptions: Chart.ChartOptions = { title: { display: true, text: 'My title', fontSize: 16, }, }; Might help someone.
score: 5
has comment: http://stackoverflow.com/comment/126704860
has comment: http://stackoverflow.com/comment/126825236
has comment: http://stackoverflow.com/comment/140062713
has comment: http://stackoverflow.com/comment/136366432
answers question: http://stackoverflow.com/q/29885809
upvote count: 8
type: Answer

http://stackoverflow.com/comment/47970549
score: 1
comment on: http://stackoverflow.com/q/29903815
type: Comment
type: QuestionComment
has text: I solve the problem: `autoPK: false, schema: true` is the solution. The lack of `autoPK: false` or `schema: true` provokes `id: null`. Thank you Meeker!

http://stackoverflow.com/comment/48054719
comment on: http://stackoverflow.com/a/29967576
type: AnswerComment
score: 0
type: Comment
has text: It is giving me the same result :(

http://stackoverflow.com/comment/48332985
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29996685
has text: @Programmer I sincerely apologize, but I want TEXT from the textbox...
score: 0

http://stackoverflow.com/comment/48006663
has text: @Winterwind Sorry i make it only for firefox browser support i update it with webkit support. please check fiddle link again.
comment on: http://stackoverflow.com/a/29942269
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/47959443
has text: @SufianRashid Yes. I don't work more in highchart but as per my knowledge no. But, you can try it. But you can give gievn style. check http://api.highcharts.com/highcharts#tooltip
type: AnswerComment
comment on: http://stackoverflow.com/a/29918875
score: 0
type: Comment

http://stackoverflow.com/comment/108921558
type: Comment
comment on: http://stackoverflow.com/a/55070618
score: 1
type: AnswerComment
has text: this works perfectly. Except, depend on version of swal, you should use `showConfirmButton:false, showCancelButton:false`

http://stackoverflow.com/q/29906738
tagged with: jquery
favorite count: 0
tagged with: ajax
tagged with: http://stackoverflow.com/tag/html
has title: Refresh div with button click using random javascript string element
upvote count: 1
has answer: http://stackoverflow.com/a/29907115
type: AnsweredQuestion
has body: There are several similar questions, so I hope this is a unique problem. None of the proposed solutions on those similar questions have solved my issue. Humble apologies from this beginner if I messed up somehow. I have an empty div on my page with I am loading using javascript with strings from an array. Currently, I have a script running on a button which reloads the entire page. I would like for that button to just reload the div with items from my javascript array. Here is my code: Again Here is a snippet of my array and the JS (coming from the os.js file referenced in index.html) I am using to load the div initially/on refresh: var obliqueStrategy = ["Abandon normal instruments", "Accept advice", "Accretion", "A line has two sides"]; var randomStrategy = obliqueStrategy[Math.floor(Math.random() * obliqueStrategy.length)]; document.getElementById("strategyBox").innerHTML = ' ' + randomStrategy + ' '; I've tried calling the same javascript as a function in script in the html like this: Again I've tried using the jQuery AJAX load function like this: I've played around with variations of the above and tried a couple other things that I'm forgetting exactly how and what I did, so I can't include them. I've really hit a wall on this even though it seems profoundly simple. Thanks in advance for any help.
score: 1
type: Question
answer count: 1
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29907115

http://stackoverflow.com/comment/47907486
type: QuestionComment
has text: Let me know, why you cannot load json with data, and then load new points dynamically, by using setInteraval and addPoint? Using ob_start() seems to be unnecessary.
score: 0
comment on: http://stackoverflow.com/q/29878522
type: Comment

http://stackoverflow.com/a/29891038
type: Answer
answers question: http://stackoverflow.com/q/29890862
has comment: http://stackoverflow.com/comment/47949195
has body: Use Javascript keyboard event and then, send the value of the input into your php function. For example: $("#youInput").keyup( function() { $.ajax( { type: "post", url: "your_url.php", data: {params: $(this).val()}, success: function(data) { console.log(data) } } ); } ); And in you php code, just retrieve the params value, $_POST['params'] Explain When you press the keybord, your retrieve the value of the input ( here, it is $(this).val() where this represents #yourInput ), then you send the value via ajax (Here we use post type) with your url and the different params that you will send to the server side. If you post the value with $_POST['params'] you will get the value entered in the input. And if it's success, the callback function will retrieve the data returned by your server side. Here, we just use, jQuery.ajax but you can find more about ajax here or here. Using library make it easy to work with. Hope it helps you!
score: 0

universal-analytics
tag name: universal-analytics
tags question: http://stackoverflow.com/q/29968966
type: Tag

http://stackoverflow.com/comment/47993669
has text: I don't know your model, but what I try to say is this: if your page deals with an order for a product (for which you have a model), you should create an "order" model that contains the product and all relevant properties for an order.
comment on: http://stackoverflow.com/q/29935771
type: QuestionComment
type: Comment
score: 0

http://stackoverflow.com/q/29864557
score: 3
tagged with: popup
tagged with: image
has title: Browse Image and pass it to popup window
type: Question
has comment: http://stackoverflow.com/comment/47857954
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/29864663
favorite count: 0
answer count: 3
has body: I would like to browse an image in my HTML script and then open a popup window in which the browsed image will appear. Right now he is opening the image in the original script. But how can I pass it to the ShowImage.html popup? function newwindow(event){ var pop = window.open("ShowImage.html", "Image","width=200, height=100"); document.getElementById('output'); output.src = URL.createObjectURL(event.target.files[0]); } &lt;label&gt; Browse File &lt;input id="Browse" type="file" style="display: none" checked= true onchange="newwindow(event)"&gt; &lt;/label&gt; &lt;img id="output"/&gt;
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29866077
upvote count: 3
type: UnansweredQuestion
tagged with: file
has comment: http://stackoverflow.com/comment/47875038
has answer: http://stackoverflow.com/a/29875771

http://stackoverflow.com/a/29966448
has body: This looks like its because there is an initial fetch that isn't used before the main loop. $row = $results-&gt;fetch(); // not needed $data = array(); while ($row = $results-&gt;fetch(PDO::FETCH_ASSOC)) { $data[] = $row; } The first line can be discarded, as you want them all gathered in the loop.
answers question: http://stackoverflow.com/q/29952400
upvote count: 2
type: Answer
score: 2
downvote count: 0

http://stackoverflow.com/a/29883999
has body: For now, there is no such option in paper.js. However, if you really need it, you can edit this line: https://github.com/paperjs/paper.js/blob/master/src/view/CanvasView.js#L190 and build your custom version of library (or edit built file). As you can see, the tolerance is explicitly set to 0. I've tried to set it to other value and it works - mouseEnter and mouseLeave events are fired earlier.
type: Answer
accepted answer of: http://stackoverflow.com/q/29854703
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/29854703
has comment: http://stackoverflow.com/comment/134074495
upvote count: 2
type: AcceptedAnswer

http://stackoverflow.com/a/29969742
upvote count: 1
downvote count: 1
answers question: http://stackoverflow.com/q/29969633
has comment: http://stackoverflow.com/comment/48059333
score: 0
has comment: http://stackoverflow.com/comment/48059406
has comment: http://stackoverflow.com/comment/48059554
type: Answer
has body: PHP &lt;script&gt; addRow('".$song."','".$artist."'); &lt;/script&gt; JavaScript function addRow(s,a){ console.log(s); console.log(a); document.write("test"); }

http://stackoverflow.com/a/29931690
score: 2
upvote count: 2
has body: use this var click_numbers = 0; $('.square').on('click',function(){ click_numbers ++; if (click_numbers == $(this).attr('order')){ $('#status-'+click_numbers).html('OK'); } else { $('#status-'+click_numbers).html('NOT OK'); } if (click_numbers === 3){ click_numbers=0; } }); JSFiddle demo
accepted answer of: http://stackoverflow.com/q/29931675
has comment: http://stackoverflow.com/comment/47985980
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/29931675
type: Answer

http://stackoverflow.com/a/29986243
upvote count: 1
has body: Why don't you want to use builtin WordPress AJAX support? You could add two action handlers like : add_action( 'wp_ajax_my_action', 'my_action_method' ); add_action( 'wp_ajax_nopriv_my_action', 'my_action_method' ); You can check the documentation here : http://codex.wordpress.org/AJAX_in_Plugins If you want to pass some values to JavaScript you can use I18n - https://codex.wordpress.org/I18n_for_WordPress_Developers#Handling_JavaScript_files
downvote count: 0
type: Answer
score: 1
answers question: http://stackoverflow.com/q/29984021

http://stackoverflow.com/q/29853074
downvote count: 0
favorite count: 0
has title: Buffer Through File
type: UnansweredQuestion
has body: I have a scenario where my producer runs a lot faster than my consumer with a lot of data. However, I do not want to block the producer. So the only option is to buffer the extra data through a file. I've managed to make a non-optimal solution. However, there has to be a more pragmatic way to implement this. I'm more familiar with RxJS where I probably wouldn't have much problem but I've just started switching over to highlands and would appreciate some advice. import fs from 'fs-promise' import _ from 'highland' export default function buffer(id, source) { const ctx = { fd: null, written: 0, read: 0, eof: false, err: null, path: `/tmp/${id}` } async function drain(push) { ctx.fd = ctx.fd || await fs.open(ctx.path, 'w+') const bufferSize = 1024 * 1024 while (ctx.read &lt; ctx.written) { let buffer = new Buffer(bufferSize) buffer = buffer.slice(0, await fs.read(ctx.fd, buffer, 0, buffer.length, ctx.read)) if (buffer.length === 0) { break } ctx.read += buffer.length push(null, buffer) } } // TODO: What about errors? source.each(async (x) =&gt; { try { ctx.fd = ctx.fd || await fs.open(ctx.path, 'w+') if (x === _.nil) { ctx.eof = true } else { ctx.written += await fs.write(ctx.fd, x, 0, x.length, ctx.written) } } catch (err2) { ctx.err = err2 } }) return _(async (push, next) =&gt; { try { await drain() if (ctx.err) { throw ctx.err } else if (ctx.eof) { await drain() fs.unlink(ctx.path) push(null, _.nil) } else { setTimeout(next, 40) } } catch (err2) { fs.unlink(ctx.path) push(err2) } }) }
tagged with: highland.js
has comment: http://stackoverflow.com/comment/48302659
tagged with: node.js
answer count: 0
score: 1
tagged with: stream
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/48300399
tagged with: javascript
has comment: http://stackoverflow.com/comment/48315551

http://stackoverflow.com/comment/47987722
score: 0
has text: If you want to write the login logic yourself, I wouldn't use `accounts-ui`
type: AnswerComment
comment on: http://stackoverflow.com/a/29885575
type: Comment

http://stackoverflow.com/a/29871071
has comment: http://stackoverflow.com/comment/47980408
has body: (Acrobat) JavaScript has no access to the imaging layer. Therefore, there is no such option. To solve your issue, you have a few possibilities: • Open the vector PDF in a (raster) image editor which does properly interpret the PDF (such as Adobe Photoshop), and save the resulting image as PDF again. • Get a vector graphics optimizer, which replaces excessive segments with longer curves (no product name comes to my mind, but I stumbled over references in the past). This may be very useful if your vector drawings were created with CAD systems with lousy PDF export (essentially plotting to PDF).
score: 0
answers question: http://stackoverflow.com/q/29853809
type: Answer

http://stackoverflow.com/comment/47990417
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29933871
has text: The only code I have removed is your `return details_in_popup($(this).data('url'), div_id);`
score: 0

http://stackoverflow.com/q/29913322
has answer: http://stackoverflow.com/a/29913470
upvote count: 2
has title: node.js: HTML form hangs after submit when inserting data into PostgreSQL database
tagged with: node.js
score: 2
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29913470
type: Question
answer count: 1
tagged with: javascript
has body: I have recently set up node.js using Express and I created a simple HTML form using Jade. The form is to insert the data in a PostgreSQL database. The problem is that when I press submit on the form, everything is inserted on the database, but the HTML form is just hanging/lingering, and at some point it stops with No data received, ERR_EMPTY_RESPONSE. Sometimes it also inserts the data twice. I guess this is because the server side does not return a response, but I cannot see how (I am new to node.js). The form has action="add_device" which is routed to routes/add_device.js. add_device.js looks like this: var express = require('express'); var router = express.Router(); router.get('/', function(request, response, next) { res.send('Nothing to see here. Move along.'); }); router.post('/', function(request, response, next) { var db = require('../public/javascripts/db/insert'); var result = db.insertDevice(request, response); return result; }); module.exports = router; The insertDevice function in my db module looks like this (it is exported with module.exports): // Insert new QA device. Data arriving as a request from a HTML form. insertDevice: function (request, response) { // Input that is verified in the HTML form. // Convert to proper format for PostgreSQL query. var name = '\'' + request.body.name + '\''; var ip_address = '\'' + request.body.ip_address + '\''; var os = '\'' + request.body.os + '\''; // Input that needs to be verified. Prepare for PostgreSQL query. var mac_address; var os_version; request.body.mac_address == "" ? mac_address = 'NULL' : mac_address = '\'' + request.body.mac_address + '\''; request.body.os_version == "" ? os_version = 'NULL' : os_version = '\'' + request.body.os_version + '\''; var pg = require('pg'); // PostgreSQL module. var td = require('./table_data') // Database constants. var client = new pg.Client(request.app.get('postgreConnection')); client.connect(function(err) { if (err) { return console.error('Could not connect to postgre…
tagged with: postgresql
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
favorite count: 0

http://stackoverflow.com/a/29867215
score: 1
answers question: http://stackoverflow.com/q/29867109
has body: Below is how you can get all elements with a selector attribute and create an onclick listener for each element. Run the snippet, and click the "click me -- A" or "click me -- B" links for a demo: var elements = document.querySelectorAll('[data-something]'); Array.prototype.forEach.call(elements, function (element) { element.onclick = function () { alert(element.innerHTML); }; }); click me -- A click me -- B You can also use .addEventListener('click', someFunction) instead of .onclick = someFunction.
type: Answer
upvote count: 1
accepted answer of: http://stackoverflow.com/q/29867109
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/47942595
type: Comment
type: AnswerComment
has text: THANK YOU. That worked great, but it has a comma at the end of each line. Can this be fixed?
comment on: http://stackoverflow.com/a/29910236
score: 3

http://stackoverflow.com/a/29993589
has body: ... .tooltip({ "share":false, "html" : "Summary information about the Service, and may be some links to the external applications", "font": {size:"auto"}, "background": "red" // add this }) Check documentation here.
answers question: http://stackoverflow.com/q/29988298
has comment: http://stackoverflow.com/comment/48108567
score: 0
has comment: http://stackoverflow.com/comment/48109199
type: Answer
has comment: http://stackoverflow.com/comment/48107325

http://stackoverflow.com/comment/47890918
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29876374
has text: Nope. 3 separate pages.

http://stackoverflow.com/comment/48069865
type: QuestionComment
has text: @sscotti I posted an answer, take a look. Snippet doesn't works here (maybe due the callback), so copy the source and run locally. See if this is what you need.
comment on: http://stackoverflow.com/q/29973426
score: 0
type: Comment

http://stackoverflow.com/comment/47845698
type: QuestionComment
has text: can you install jquery with npm by any chance? It would be a lot easier since webpack prefers it.
type: Comment
comment on: http://stackoverflow.com/q/29858162
score: 0

http://stackoverflow.com/a/29850319
type: Answer
upvote count: 3
score: 3
answers question: http://stackoverflow.com/q/29850172
downvote count: 0
has body: You can use a library like markdown-js. And then just process it when fetched (note you have to inject $sce because angular doesn't allow printing out HTML because of security concerns by default): var id = "asdf76f7g68sd7g"; $http.get("/api/article/" + id).then(function(res){ var article = res.data; article.content = $sce.trustAsHtml(markdown.toHTML(article.content)); $scope.article = article; }); And in your view: &lt;div ng-bind-html="article.content"&gt;&lt;/div&gt;

http://stackoverflow.com/q/29878231
has answer: http://stackoverflow.com/a/29878277
tagged with: javascript
has title: Image not drawing from Math.random function
score: 0
tagged with: html5-canvas
tagged with: http://stackoverflow.com/tag/html
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29878405
type: Question
has body: My code below is supposed to draw a picture of a rock on the canvas at random times. But the code I currently have doesn't draw anything even after many refreshes. I also could do with loop round the mathRock function so that I get constant new random rocks without having to refresh the page, but I don't know which loop to use. My code for the rock spawn is below: var num; var rock = new Image(); rock.src = "rock.png"; mathRock(); spawnRock(); function mathRock() { var x = parseInt(Math.random()* 10); document.getElementById("num"); } function spawnRock() { if (num == 2|| num == 4 || num == 6 || num == 8){ context.drawImage(rock, 500, 450); } else { } }
answer count: 2

http://stackoverflow.com/a/29918571
has body: You can try some thing like this. CSS div { display: none; } HTML Show Contents JS $('#hover') .mouseleave(function() { $('#div').hide(); }) .click(function(e) { e.preventDefault(); $('#div').show(); });
score: 0
type: Answer
answers question: http://stackoverflow.com/q/29918384

http://stackoverflow.com/comment/48899300
type: Comment
comment on: http://stackoverflow.com/a/29907618
score: 1
type: AnswerComment
has text: Ah yeah sorry I was oversimplifying. For the quick test script I wrote in the gist, you are probably right that it works from scratchpad but for the more complex one I started with (to actually test whether the imported properties worked) it wouldn't be a fair test unless run from a jsm. Given that I didn't have time to write a full test of each property and have just assumed they will work if they get imported, that point is moot. So lets stick with that assumption and just run them from scratchpad to save time :-)

http://stackoverflow.com/comment/47981335
comment on: http://stackoverflow.com/a/29929187
type: Comment
score: 0
has text: It's so easier with JQuery. If you wan't a pure js solution, you can just rewrite the function in my answer. The logic is the same.
type: AnswerComment

http://stackoverflow.com/a/29891000
answers question: http://stackoverflow.com/q/29890971
downvote count: 0
score: 6
has body: .wrapAll() will wrap the two div's around the new div: $(".pagination_info, .pagination_numbers").wrapAll("&lt;div class='pagination_wrapper'&gt;"); FIDDLE
type: Answer
upvote count: 6

http://stackoverflow.com/comment/47906488
comment on: http://stackoverflow.com/q/29891321
score: 0
type: Comment
type: QuestionComment
has text: Please provide plunkar

http://stackoverflow.com/q/29847960
possible better answer: http://stackoverflow.com/a/29848171
score: 1
has answer: http://stackoverflow.com/a/29848171
upvote count: 1
has body: I use javascript to get a string (name) that I will eventually paste to a text file with other data (a grade). var name = "Joe Smith"; var n = str.length; document.getElementById("sum").value="" + name + " " + grade I want to create a column effect that will make the text file easier to read by reading the length of the name string then adding a number of spaces relative to the length of the str variable. So, if the string length is 15 spaces, I will add 5 spaces to make it 20. And if the string length is 10, I will add 10 spaces to make it 20 too. When I use the PRE tag, all the grade variables should line up. Should I use the join() function somehow? I'm not sure how. Any suggestions?
type: Question
linked to: http://stackoverflow.com/q/2686855
has answer: http://stackoverflow.com/a/29848074
has comment: http://stackoverflow.com/comment/47822000
tagged with: javascript
duplicate of: http://stackoverflow.com/q/2686855
answer count: 2
downvote count: 0
tagged with: string
favorite count: 0
accepted answer: http://stackoverflow.com/a/29848074
has title: How do I pad a string length in javascript?
type: AnsweredQuestion

http://stackoverflow.com/comment/48006278
score: 0
type: QuestionComment
has text: Blogger CSS https://support.google.com/blogger/answer/175740?hl=en Can demonstrate with details how to change, if u can?
comment on: http://stackoverflow.com/q/29942538
type: Comment

unit-testing
tags question: http://stackoverflow.com/q/29998663
tags question: http://stackoverflow.com/q/29946121
tags question: http://stackoverflow.com/q/29969371
tags question: http://stackoverflow.com/q/29928647
tags question: http://stackoverflow.com/q/29912285
tags question: http://stackoverflow.com/q/29858731
tags question: http://stackoverflow.com/q/29956548
tags question: http://stackoverflow.com/q/29952833
tags question: http://stackoverflow.com/q/29921882
type: Tag
tags question: http://stackoverflow.com/q/29860239
tags question: http://stackoverflow.com/q/29953903
tag name: unit-testing
tags question: http://stackoverflow.com/q/29857911
tags question: http://stackoverflow.com/q/29923888
tags question: http://stackoverflow.com/q/29924385
tags question: http://stackoverflow.com/q/29931725

http://stackoverflow.com/comment/47969009
type: Comment
comment on: http://stackoverflow.com/a/29923654
has text: Sessions persist except in the case of a HARD REFRESH. Look around the docs for this, you can also explore things like ReactiveVars and packages that extend Session functionality.
type: AnswerComment
score: 0

http://stackoverflow.com/comment/49637257
type: QuestionComment
score: 1
has text: also see: https://github.com/6pac/SlickGrid/pull/4#issuecomment-100419965
comment on: http://stackoverflow.com/q/29991072
type: Comment

http://stackoverflow.com/q/29950100
favorite count: 0
upvote count: 2
has body: I have been trying to scroll the page to a dynamic div that is created by the an ajax call. When #divnotifications div clicked (below), I make the first ajax call that adds the Post details, then within this ajax call, another ajax call is made to add the related comments to the div. The part explained so far works great. Then, I use $.when().then() to scroll to a div item created based on the ajax calls. However, the page does not scroll to the element that was created by LoadCommentsForPost ajax call. Did I get the logic of $.when().then() wrong? $(document).on('click', '#divnotifications div', function (event) { event.preventDefault(); $.ajax({ //other details success: function (postid) { $.when(DisplayPostWithFullDetails(postid)).then(function () { //scroll to the content created by //LoadCommentsForPost function nested //inside DisplayPostWithFullDetails }); } }); }); function DisplayPostWithFullDetails(postId) { $.ajax({ //other details success: function (post) { //The code to build the div to display the post -- working fine LoadCommentsForPost(post.PostId); } }); } function LoadCommentsForPost(postid) { $.ajax({ //other details success: function (response) { var comments = JSON.parse(response); DisplayComments(comments);//builds the div to display the comments - working fine } }); } UPDATED CODE After receiving some feedback, I ended up with the following code. However, it is still not working. It works only if I add some delay to make sure the div is loaded: $(document).on('click', '#divnotifications div', function (event) { event.preventDefault(); $.ajax({ //other ajax stuff success: function (postid) { DisplayPostWithFullDetails(postid).done(function () { setTimeout(function () { var scrollto = $("div[data-" + type.toLowerCase() + "displayform='" + relateditem + "']").offset().top; $("html, body").animate({ scrollTop: scrollto }, 600); }, 500); }); } }); }); function DisplayPostWithFullDetails(postId) { jQuery.support.cors = true; return $.ajax({ //other …
has answer: http://stackoverflow.com/a/29950249
type: AnsweredQuestion
score: 2
has comment: http://stackoverflow.com/comment/48024445
possible better answer: http://stackoverflow.com/a/29950179
has comment: http://stackoverflow.com/comment/48021160
has comment: http://stackoverflow.com/comment/48024129
has answer: http://stackoverflow.com/a/29950179
type: Question
has comment: http://stackoverflow.com/comment/48023945
answer count: 2
downvote count: 0
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/29950249
has title: $.when().then() not working with nested ajax calls
has comment: http://stackoverflow.com/comment/48021560
tagged with: ajax

http://stackoverflow.com/comment/47937153
type: Comment
score: 1
type: QuestionComment
has text: You could calculate the width and height of the svg element to get your scrollbar working properly. Is there a reason why you need to render the text as svg instead of just adding it directly to the div as html?
comment on: http://stackoverflow.com/q/29869603

http://stackoverflow.com/a/30697161
downvote count: 0
has body: So, I never found a great way to separate logic and drawing because JavaScript uses a single thread. No matter what I do the execution of the draw function may get in the way of the logic or vis versa. What I did do was find a way to execute them in the most timely manner possible while also ensuring constant time updates to the logic and optimized drawing using requestAnimation Frame. This system is set up to interpolate animations to make up for skipped frames should the device be too slow to draw at the desired frame rate. Anyway, here's my code. var engine = { /* FUNCTIONS. */ /* Starts the engine. */ /* interval_ is the number of milliseconds to wait between updating the logic. */ start : function(interval_) { /* The accumulated_time is how much time has passed between the last logic update and the most recent call to render. */ var accumulated_time = interval_; /* The current time is the current time of the most recent call to render. */ var current_time = undefined; /* The amount of time between the second most recent call to render and the most recent call to render. */ var elapsed_time = undefined; /* You need a reference to this in order to keep track of timeout and requestAnimationFrame ids inside the loop. */ var handle = this; /* The last time render was called, as in the time that the second most recent call to render was made. */ var last_time = Date.now(); /* Here are the functions to be looped. */ /* They loop by setting up callbacks to themselves inside their own execution, thus creating a string of endless callbacks unless intentionally stopped. */ /* Each function is defined and called immediately using those fancy parenthesis. This keeps the functions totally private. Any scope above them won't know they exist! */ /* You want to call the logic function first so the drawing function will have something to work with. */ (function logic() { /* Set up the next callback to logic to perpetuate the loop! */ handle.timeout = window.setTimeout(logic, int…
score: 3
accepted answer of: http://stackoverflow.com/q/29856379
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29856379
upvote count: 3
type: Answer

http://stackoverflow.com/q/29876525
type: Question
has comment: http://stackoverflow.com/comment/47877799
answer count: 1
has comment: http://stackoverflow.com/comment/47877748
downvote count: 0
tagged with: jsp
tagged with: javascript
has comment: http://stackoverflow.com/comment/47877656
has comment: http://stackoverflow.com/comment/47877458
has answer: http://stackoverflow.com/a/29876779
has comment: http://stackoverflow.com/comment/47877421
favorite count: 0
has comment: http://stackoverflow.com/comment/47877441
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29876779
score: 3
has body: I have to disable the "Username" & "Password" text boxes when the user fails to provide correct credentials 3times. I should use the logic in JSP itself(using jQuery or javascript) or in the controller. PS : I have to redirect to the login page only after failure. Just need to update the error message with "Your account has been disabled". Below is the JSP: Login.jsp Login Form Username Password Below is the Servlet: LoginServlet public class LoginServlet extends HttpServlet { private static final long serialVersionUID = 1L; public void init() throws ServletException { //we can create DB connection resource here and set it to Servlet context if(getServletContext().getInitParameter("dbURL").equals("jdbc:mysql://localhost/mysql_db") && getServletContext().getInitParameter("dbUser").equals("mysql_user") && getServletContext().getInitParameter("dbUserPwd").equals("mysql_pwd")) getServletContext().setAttribute("DB_Success", "True"); else throw new ServletException("DB Connection error"); } protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { //get request parameters for userID and password String user = request.getParameter("user"); String pwd = request.getParameter("pwd"); //get servlet config init params String userID = getServletConfig().getInitParameter("user"); String password = getServletConfig().getInitParameter("password"); //logging example log("User="+user+"::password="+pwd); if(userID.equals(user) && password.equals(pwd)){ response.sendRedirect("LoginSuccess.jsp"); }else{ RequestDispatcher rd = getServletContext().getRequestDispatcher("Login.jsp"); PrintWriter out= response.getWriter(); out.println("Either user name or password is wrong."); rd.include(request, response); } } }
upvote count: 3
has comment: http://stackoverflow.com/comment/47877701
has title: Disable text box on failure of 3 login attempts
has comment: http://stackoverflow.com/comment/47877666
tagged with: servlets

http://stackoverflow.com/comment/48017338
comment on: http://stackoverflow.com/q/29948130
type: Comment
type: QuestionComment
has text: Also `myComment = null` at the end should be `myComment == null`
score: 1

http://stackoverflow.com/q/29996686
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/48113088
has body: I have an Object I use JSON.stringify to create JSON string. Than I save that string into file. Then I read that file. Make JSON.parse and try to use that object again. But it does not work anymore. For example if I use [i] to select element it doesnt select element but just take charset like its a string :( Can any body help with that? This is some kind of example but actuall JSON is toooo long: {"featureCollection": {"layers":"[ {\"layerDefinition\": {\"currentVersion\": 10.3, \"id\": 0, \"supportsCoordinatesQuantization\": true, \"advancedQueryCapabilities\": { \"supportsPagination\": true, \"supportsDistinct\": true }, \"geometryType\": \"esriGeometryPolygon\", \"minScale\": 0, \"maxScale\": 0, \"extent\": {}, \"drawingInfo\": {\"renderer\": {\"type\": \"simple\", \"symbol\": {\"type\": \"esriSFS\", \"style\": \"esriSFSSolid\", \"color\": [76, 129, 205, 191], \"outline\": {\"type\": \"esriSLS\", \"style\": \"esriSLSSolid\", \"color\": [0, 0, 0, 255], \"width\": 0.75} } },
score: 2
has comment: http://stackoverflow.com/comment/48113217
tagged with: http://stackoverflow.com/tag/json
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/29996786
downvote count: 0
has comment: http://stackoverflow.com/comment/48112948
tagged with: javascript
has answer: http://stackoverflow.com/a/29996830
has title: JSON.stringify and JSON.parse get different result
favorite count: 0
tagged with: parsing
upvote count: 2

http://stackoverflow.com/comment/47908967
type: QuestionComment
comment on: http://stackoverflow.com/q/29892738
has text: As far as passing Error message is concerned, setup it like `ModelState.AddModelError("Error", "Invalid credentials. Please enter valid credentials.");` and on your view side do this : `@Html.ValidationMessage("Error")`
score: 0
type: Comment

http://stackoverflow.com/a/29913596
upvote count: 1
answers question: http://stackoverflow.com/q/29913183
has body: $.ajax({ url: $_navigateURL, beforeSend: function (xhr) { PageLoadingProgressStart(); } }).done(function (data) { $("#dvContentHolder").html(data); }).fail(function (xhr) { }) .always(function () { PageLoadingProgressEnd(); }); The PageLoadingProgressStart() and PageLoadingProgressEnd() will handle the loading animation or progressbar or something else. like function PageLoadingProgressStart() { $("#dvPageProgress div").width("0%"); $("#dvPageProgress").show().find("div").width("40%"); } function PageLoadingProgressEnd() { $("#dvPageProgress div").width("100%"); setTimeout("$('#dvPageProgress').hide();", 500); }
downvote count: 0
score: 1
type: Answer

http://stackoverflow.com/a/29908028
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/47939511
has comment: http://stackoverflow.com/comment/47939110
accepted answer of: http://stackoverflow.com/q/29907871
answers question: http://stackoverflow.com/q/29907871
upvote count: 1
type: AcceptedAnswer
has body: The only real thing I can think of is that the author wanted to keep everything off the scope directly, only populating properties of the controller instance, which will be available on the scope via the property specified in the controllerAs property on the route definition object. However, when doing it that way, if you want to set up $watches on the scope to be notified of changes to something, you can't, because you don't actually know what property of the scope it will be published on. You could settle on a convention, such as vm, ctrl or whatever, for the controllerAs value, but that is not ideal and is fragile and not really a concern of the controller code itself. But if you made that concession, you could use $scope.$watchCollection('vm.someModel', ... instead. One final possible reason is that $scope.$watch() and $scope.$watchCollection() always ultimately end up dealing with a function as the thing they use to get the value of the thing being watched during the digest. If you pass a string, it uses the $parse service under the covers to turn it into a function. If you pass a function directly, no conversion is necessary, so this can be perceived as a minor performance improvement. The real reason(s) may be one, all or none of these, but they are valid reasons for adopting this approach. I actually admire it for its purity and strict adherence to "controller as", which is the in-vogue strategy encouraged by the Angular team and community at the moment.
type: Answer
has comment: http://stackoverflow.com/comment/47938785

http://stackoverflow.com/a/33899351
answers question: http://stackoverflow.com/q/29963847
has body: In case anyone still experience this issue but would still want to use the jQuery clone: If you are using Bootstrap, you actually just need to remove the bootstrap-select and then reinitialise the normal cloned select. Just add these two lines of code after you do your clone: clone.find('.bootstrap-select').remove(); clone.find('select').selectpicker(); Based on answer from this Github issue: https://github.com/silviomoreto/bootstrap-select/issues/605
score: 0
type: Answer

http://stackoverflow.com/q/29848908
score: 6
has comment: http://stackoverflow.com/comment/48489244
has answer: http://stackoverflow.com/a/30184375
has comment: http://stackoverflow.com/comment/48491154
has comment: http://stackoverflow.com/comment/47824325
has comment: http://stackoverflow.com/comment/47823851
has answer: http://stackoverflow.com/a/30193157
has answer: http://stackoverflow.com/a/30055427
has comment: http://stackoverflow.com/comment/47823859
has comment: http://stackoverflow.com/comment/47823802
upvote count: 10
type: Question
has comment: http://stackoverflow.com/comment/48225405
downvote count: 4
has title: Javascript Module Pattern returning initial value of Private property
has answer: http://stackoverflow.com/a/31339060
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47823836
has comment: http://stackoverflow.com/comment/47824574
has answer: http://stackoverflow.com/a/30065988
has comment: http://stackoverflow.com/comment/48225338
has comment: http://stackoverflow.com/comment/47823765
has comment: http://stackoverflow.com/comment/47823921
has comment: http://stackoverflow.com/comment/47824202
favorite count: 0
has body: I'm trying to get a private property from a Module but I always get the initial value of it and not the most recent one. When the form is submited and onSuccess get called, I set the partnerId = 10. After that, I have a click event that gets the partner's Id, and get -1 search.js var SearchForm = (function ($) { "use strict"; // Private variables // Private functions var onSuccess = function () { PartnerDetail.setPartnerId(10); }; // Public functions return { onSuccess: onSuccess, }; })(jQuery); detail.js var PartnerDetail = (function ($) { "use strict"; var _partnerId = -1; var getPartnerId = function () { return _partnerId; }; var setPartnerId = function (id) { _partnerId = id; } // Public functions return { getPartnerId: getPartnerId, setPartnerId: setPartnerId }; })(jQuery); search.internal.js var SearchAll = (function ($) { "use strict"; // Private variables // Private functions var init = function () { $("#partner").on("click", function () { var p = PartnerDetail.getPartnerId(); console.log(p); ==&gt; -1 } }; // Public functions return { init: init }; })(jQuery); (main page) // Load when ready $(document).ready(function () { SearchAll.init(); });
answer count: 5
type: UnansweredQuestion

http://stackoverflow.com/a/29920746
has comment: http://stackoverflow.com/comment/47963076
downvote count: 0
has comment: http://stackoverflow.com/comment/47963631
has comment: http://stackoverflow.com/comment/47962970
type: Answer
answers question: http://stackoverflow.com/q/29920326
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/47964861
has comment: http://stackoverflow.com/comment/47962952
has body: This would work: $(function() { $('#formTbl tr').each(function() { var frstVal = $(this).find('td').eq(0).text(); if (!frstVal.match(/name|title/i)) { $(this).remove() } }); }); Content Type Title * Name *
has comment: http://stackoverflow.com/comment/47962825
has comment: http://stackoverflow.com/comment/47963035

http://stackoverflow.com/comment/47869634
type: Comment
type: QuestionComment
score: 2
has text: when you returned it as base64, did you modify the img tag like this? http://stackoverflow.com/q/1207190/870769
comment on: http://stackoverflow.com/q/29872254

http://stackoverflow.com/q/29898008
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29898100
has body: Hi few times ago I post question how to add eight 0 before primary key using php and javascript and I got my answers for both php and javascript and I create two functions for it. PHP function function addingZerosBeforeIds($ids){ return str_pad($ids, 9, "0", STR_PAD_LEFT); } and javascript function function addingZerosBeforeIds(input, length, string) { string = string || '0'; input = input + ''; return input.length &gt;= length ? input : new Array(length - input.length + 1).join(string) + input; } its working fine but now I want to remove zeros before primary key I tries a lot for this but didn't succeed how to do this.
favorite count: 0
has answer: http://stackoverflow.com/a/29898077
answer count: 3
linked to: http://stackoverflow.com/q/850341
linked to: http://stackoverflow.com/q/28874795
has answer: http://stackoverflow.com/a/29898100
has comment: http://stackoverflow.com/comment/47918714
upvote count: 1
tagged with: php
type: Question
possible better answer: http://stackoverflow.com/a/29898077
type: AnsweredQuestion
downvote count: 3
has title: remove zero before primary key
has answer: http://stackoverflow.com/a/29898081
score: -2

http://stackoverflow.com/q/29928953
type: UnansweredQuestion
tagged with: memory-leaks
tagged with: node.js
has title: Memory leak introduced when upgrading from Express 3.4 to 3.20?
answer count: 0
upvote count: 3
type: Question
has comment: http://stackoverflow.com/comment/47980760
score: 3
tagged with: javascript
tagged with: express
has comment: http://stackoverflow.com/comment/47982771
linked to: http://stackoverflow.com/q/29926648
downvote count: 0
has body: I have been using Express 3.4 with good success for awhile now. I am not quite ready to make the jump to Express 4 -- However I figure it would be a good idea to upgrade to the latest version of Express 3 prior to jumping off to 4. So I upgraded my app to use Express 3.20. Now: When I am running my app on express 3.4, the memory usage for each process in pm2 tends to hover around the mid 200, low 300MB range. As soon as I upgraded to 3.20, the memory usage started climbing over 600MB in less than an hour for each process, at which point things crash out. Rolling back to 3.4, I have confirmed that memory usage stays level in the mid-200s. Changing express versions is the only modification I have made. I am wondering: Is there a known issue / change of some kind, between 3.4 and 3.20, that could cause a memory leak?
favorite count: 0

http://stackoverflow.com/a/30088702
has body: I had the same problem, make sure the Status is set to "Released".
downvote count: 0
answers question: http://stackoverflow.com/q/29941533
score: 7
upvote count: 7
type: Answer

http://stackoverflow.com/q/29849357
tagged with: javascript
has title: Semantic UI Search Selection won't remain collapsed/unfocused on Modal load
score: 0
accepted answer: http://stackoverflow.com/a/29874759
has body: I'm using a Semantic UI Search Selection and am using a very simple implementation of .dropdown() to convert static markup into a searchable country input. The problem is that this input automatically focuses and the menu drops down on page load. If I wait until $(window).load(), I can remove the active and visible classes from the element (and its children), but I'd rather instantiate the menu without these to begin with. My markup looks something like the following: $('.ui.modal').modal('show'); $('.ui.dropdown').dropdown(); I am a: -- Homeowner Country: Select Country United States Uruguay Uzbekistan There are no other instances of .dropdown() in my code. Thoughts? EDIT: I've discovered that this is happening because the form is included within a modal. The issue doesn't occur when the form is outside of the modal.
answer count: 1
tagged with: jquery
favorite count: 0
tagged with: semantic-ui
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29874759
upvote count: 1
downvote count: 1
type: Question

http://stackoverflow.com/a/29890886
answers question: http://stackoverflow.com/q/29890556
type: Answer
score: 0
has body: You are doing it in wrong way. Id should not contains space. So just remove space from id and make it like below Test Data and Accordion like this: Drug Test To remove white space you have to write server side code as you said its coming from database.

http://stackoverflow.com/comment/47843370
has text: Related: http://programmers.stackexchange.com/questions/176761/compute-if-a-function-is-pure - nutshell version, you'd have to solve the halting problem to do it.
comment on: http://stackoverflow.com/q/29858699
score: 4
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47845730
score: 0
type: AnswerComment
has text: My system isn't migtymouse, but on osx chrome, there is a significant difference (with your implementation) when using `idle` and `tilesloaded`. Maybe milage varies here, but `titlesloaded` seems better to me. If you're willing to describe why adding the listener as you did works where mine didn't (and drop in that working code from the fiddle) I'll mark your answer as correct.
type: Comment
comment on: http://stackoverflow.com/a/29859304

http://stackoverflow.com/a/29988420
type: Answer
has comment: http://stackoverflow.com/comment/48097626
answers question: http://stackoverflow.com/q/29988335
score: 4
upvote count: 4
downvote count: 0
has body: When executing a function you don't have to write function up front. try function one(){ two(a,b); two(c,d); }

http://stackoverflow.com/q/29924907
accepted answer: http://stackoverflow.com/a/34979803
score: 3
upvote count: 3
has title: JQuery UI set up my own tolerance
type: Question
tagged with: jquery-ui
downvote count: 0
tagged with: javascript
tagged with: jquery
tagged with: jquery-ui-droppable
has answer: http://stackoverflow.com/a/34979803
answer count: 1
favorite count: 0
has body: I´m working on game for my little baby. I want to change default tolerance in droppable object. I know, that there are default values like touch, fit, intersect and pointer. But in my app it doesn't work correctly, because I want something between fit and intersect. When I use fit, it is too difficult to insert into correct position, and when I use intersect, it is too light. Here is my HTML source: Puzzle Slovakia And there is my JS code: window.onload = function() { var hra = document.getElementById("game"); hra.innerHTML+=" "; hra.innerHTML+=" "; hra.innerHTML+=" "; hra.innerHTML+=" "; hra.innerHTML+=" "; hra.innerHTML+=" "; hra.innerHTML+=" "; hra.innerHTML+=" "; $('.puzzle').draggable( { containment:'parent', cursor:'move', }); $('.place').droppable ( { accept: '.puzzle', drop: dropPicture, tolerance: 'intersect' }); } function dropPicture( event, ui ) { if ( $(this).attr('id') == ui.draggable.attr('id') + "p" ) { ui.draggable.draggable( 'disable' ); ui.draggable.attr('class','done'); $(this).droppable( 'disable' ); ui.draggable.position( { of: $(this), my: 'left top', at: 'left top' } ); } }
type: AnsweredQuestion

http://stackoverflow.com/q/29948474
accepted answer: http://stackoverflow.com/a/29948984
tagged with: asynchronous
has comment: http://stackoverflow.com/comment/48018045
has answer: http://stackoverflow.com/a/29948984
tagged with: node.js
has comment: http://stackoverflow.com/comment/48018150
tagged with: parallel-processing
type: AnsweredQuestion
has body: I am trying to use the async library in order to deal with asynchronous functions, and am unable to get the functionality I need. The basic idea is that I am building a JSON object using multiple calls to a redis database. I want to only return the JSON object after the redis calls have been completed, so I tried using async.parallel but I don't seem to understand it properly. My callback is called with the empty JSON object and then my console logs within the functions are seen. Here is my code: server.js: getHostObject(redis,sess.hostName,function(data) { console.log('calledback data: '+JSON.stringify(data)); }); getHostObject.js var async = require('async'); var getHostObject = function(redis, hostName, callback) { var hostObject = { hostName: hostName, pushers: [], tracklist: [] }; var getSongObject = function(err,song) { console.log('song got!'); hostObject.tracklist.push(song); }; var getSongs = function() { redis.lrange(hostName+":songs",0,-1, function(err,data) { if (err) {console.log('Error reading songs! '+hostName+'\n'+err);} for(var i=0;i&lt;data.length;i++) { redis.hgetall(hostName+":song:"+data[i], getSongObject); } }); }; var getPusherObject = function(err,pusher) { console.log('pusher got!'); hostObject.pushers.push(pusher); }; var getPushers = function() { redis.smembers(hostName+":pushers", function(err, data) { if (err) {console.log('Error reading pushers! '+hostName+'\n'+err);} for(var i=0;i&lt;data.length;i++) { redis.hgetall(hostName+":pusher:"+data[i], getPusherObject); } }); }; async.parallel([ function() { getPushers(); }, function() { getSongs(); } ],callback(hostObject)); }; module.exports = getHostObject; console output: calledback data: {"hostName":"47B71","pushers":[],"tracklist":[]} pusher got! song got!
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/48018209
has comment: http://stackoverflow.com/comment/48018231
score: 0
has title: Node async callback being called for operations complete
answer count: 1

http://stackoverflow.com/comment/48111657
has text: Your code should've been waiting for promises anyway, promisify at the lowest possible API level and use promises app-wide, for example in `setTimeout` you can use `Promise.delay` instead.
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29995696

http://stackoverflow.com/q/29890997
has comment: http://stackoverflow.com/comment/47906879
has comment: http://stackoverflow.com/comment/47906377
score: 0
tagged with: iframe
has title: How to load iframe in window.open in javascript when url is assigned to a variable
has body: In my angular application, I have an url which I need to open in new window. If I directly give url in iframe src, it works. But if the url is stored in an variable and if I assign src through variable, it fails. For example: var win = $window.open(); win.document.write('') This works. But if I have a variable url = "//www.youtube.com/embed/mTWfqi3-3qU". var win = $window.open(); win.document.write('') This fails. If a url is assigned to a variable, how to assign that url to iframe src?
tagged with: javascript
type: UnansweredQuestion
answer count: 0
tagged with: window.open
tagged with: angularjs
type: Question
linked to: http://stackoverflow.com/q/20045150
has comment: http://stackoverflow.com/comment/47906297

http://stackoverflow.com/q/29949146
score: -2
has comment: http://stackoverflow.com/comment/48019504
has comment: http://stackoverflow.com/comment/48019156
has comment: http://stackoverflow.com/comment/48019141
type: Question
has comment: http://stackoverflow.com/comment/48019369
answer count: 2
has body: I got a PSD from our designers today with the following layout: They want to include 3 circles, evenly spaced, that also have to be responsive. Every solution that I've tried so far has failed. My code at the moment is as follows: CSS (compiled from SCSS) .section2 .info-box { float: left; display: block; margin-right: 10.1484%; width: 26.56773%; } /* line 89, /Users/chriswatson/.rvm/gems/ruby-2.1.5/gems/neat-1.7.2/app/assets/stylesheets/grid/_span-columns.scss */ .section2 .info-box:last-child { margin-right: 0; } @media screen and (max-width: 992px) { /* line 84, /Users/chriswatson/Sites/nuvi-website/source/stylesheets/index.css.scss */ .section2 .info-box { float: left; display: block; margin-right: 38.19821%; width: 100%; margin-bottom: 40px; background-color: rgba(250, 250, 250, 0.1); padding: 15px; } /* line 89, /Users/chriswatson/.rvm/gems/ruby-2.1.5/gems/neat-1.7.2/app/assets/stylesheets/grid/_span-columns.scss */ .section2 .info-box:last-child { margin-right: 0; } } /* line 94, /Users/chriswatson/Sites/nuvi-website/source/stylesheets/index.css.scss */ .section2 .info-box img { height: 90px; margin-bottom: 20px; } /* line 99, /Users/chriswatson/Sites/nuvi-website/source/stylesheets/index.css.scss */ .section2 .info-box h2 { font-size: 1.2em; } /* line 103, /Users/chriswatson/Sites/nuvi-website/source/stylesheets/index.css.scss */ .section2 .info-box p { font-size: 18px; } HTML A Comprehensive Solution Real-Time NUVI monitors 12 social networks and nearly 4 million RSS feeds in over 20 languages in Real Time. Learn More Visualizations Beautiful visualizations and dashboards make it easy to see actionable insights. Learn More Reporting Beautiful visualizations and dashboards make it easy to see actionable insights. Learn More How can I get those circles to appear as they are pictured above?
tagged with: javascript
has answer: http://stackoverflow.com/a/29949628
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/48019453
has answer: http://stackoverflow.com/a/29949417
has title: Creating responsive circle borders in CSS and/or jQuery
has comment: http://stackoverflow.com/comment/48019293
has comment: http://stackoverflow.com/comment/48020679
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/48019669
tagged with: css
has comment: http://stackoverflow.com/comment/48019822
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/12945891
downvote count: 3
has comment: http://stackoverflow.com/comment/48019166
upvote count: 1
has comment: http://stackoverflow.com/comment/48021111

http://stackoverflow.com/comment/47968779
comment on: http://stackoverflow.com/q/29922959
score: 0
type: QuestionComment
type: Comment
has text: Thanks, Nikos M. That solution is definitely a possibility I have considered and discussed. I don't think I could kick something like that off from the JavaScript. Are you saying kick off the script from the PHP side after the file has already been uploaded to one device? Or setting it up a separate daemon? Either way, in my specific scenario, this might load one of the embedded servers too much and/or for too long to be acceptable to the end users. But definitely a possibility. Thanks again.

http://stackoverflow.com/a/29892488
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29890608
downvote count: 0
has comment: http://stackoverflow.com/comment/47936285
accepted answer of: http://stackoverflow.com/q/29890608
has comment: http://stackoverflow.com/comment/47908593
type: Answer
score: 1
has body: Autoform hooks is your friend Read about it here Add this to your client code: AutoForm.hooks({ 'echoForm': { after: { method: function(error, result) { console.log("after"); if (result) { return Session.set('result', result); } } } } }); In your Template js file, create a helper to return Session.get 'result' Template.showEcho.helpers({ text: function() { return Session.get('result') } }); Template html file: &lt;template name="showEcho"&gt; {{#autoForm schema=getEchoFormSchema id="echoForm" type="method" meteormethod="echoMethod"}} . . . . {{/autoForm}} &lt;p&gt; {{text}} &lt;/p&gt; &lt;/template&gt;
upvote count: 1
has comment: http://stackoverflow.com/comment/47909034

http://stackoverflow.com/q/30002319
tagged with: model-view-controller
score: 2
upvote count: 2
has body: I'm trying to build JQuery DataTable with customize buttons. This is my code: Company name Address Town And this is my Action in the Controller: return Json(new { sEcho = param.sEcho, iTotalRecords = result.Count(), iTotalDisplayRecords = result.Count(), aaData = result }, JsonRequestBehavior.AllowGet); } This code works fine but now I want to add data-id attributes to my buttons. I wanna to set value of ID field (which I hided) to data-id attribute for each row. How I can implement it?
type: Question
has answer: http://stackoverflow.com/a/43693090
has answer: http://stackoverflow.com/a/30002681
tagged with: javascript
answer count: 2
tagged with: datatables
downvote count: 0
has title: JQuery DataTable add attribute to customize button
tagged with: jquery
favorite count: 0
type: UnansweredQuestion

http://stackoverflow.com/comment/47976110
score: 0
comment on: http://stackoverflow.com/q/29925593
has text: I really feel so foolish, but when you say applicant_search action are you referring to a route? Code in my applicants controller? applicants model maybe? I am so confused and have been up for days trying to meet my deadline.
type: QuestionComment
type: Comment

http://stackoverflow.com/q/29937157
type: AnsweredQuestion
tagged with: fasta
has body: I want to validate a text box input on an HTML page whether it is in fasta format or not and if it only contains one sequence before submission of data. I know PHP and little idea about JavaScript. I don't think it is possible with php.
upvote count: 2
has title: validate text box input (for fasta format) before submission
possible better answer: http://stackoverflow.com/a/33006720
has answer: http://stackoverflow.com/a/29937354
has answer: http://stackoverflow.com/a/33006720
type: Question
has comment: http://stackoverflow.com/comment/47995990
tagged with: javascript
answer count: 2
accepted answer: http://stackoverflow.com/a/29937354
downvote count: 0
favorite count: 0
tagged with: php
score: 2

http://stackoverflow.com/comment/48044472
score: 0
type: Comment
type: QuestionComment
has text: Do you get an error-message when pressing the button?
comment on: http://stackoverflow.com/q/29962095

http://stackoverflow.com/a/29953329
score: 0
type: Answer
has body: Is children supposed to be the variable that targets the input ? This is just elementary jQuery. var input = $('input[username]').val();
answers question: http://stackoverflow.com/q/29952791

http://stackoverflow.com/a/31711231
has body: function getDimensions() { // do something here to get your height and width values var x = 640, y = 480; return [x,y]; } svgEditor.setConfig({ dimensions: getDimensions() }); If you want the workarea to change as the user resizes the window then you'll also need to bind window.onresize to change SVG-Edit's canvas size using svgCanvas.setResolution(). Hopefully that helps.
answers question: http://stackoverflow.com/q/29928722
score: 0
type: Answer

http://stackoverflow.com/comment/47953179
has text: Next time, please put imagemagick in your tags. Good luck.
comment on: http://stackoverflow.com/q/29915829
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29893756
upvote count: 0
has comment: http://stackoverflow.com/comment/47910431
has comment: http://stackoverflow.com/comment/47911035
answers question: http://stackoverflow.com/q/29893291
has comment: http://stackoverflow.com/comment/47913019
has body: I have used the approach i have mentioned in my comment. var arr = [ {c: "baz", a: "foo", b: "bar" }, {c: "qux", a: "foo", b: "bar" }, {c: "baz", b: "bar", a: "foo" }, {c: "qux", b: "bar", a: "foo" }, {a: "bar", c: "qux", b: "foo" }, {a: "bar", c: "foo", b: "qux" }, {a: "bar", b: "foo", c: "qux" } ]; var modified = arr.map(function (value) { var result = []; var keys = Object.keys(value).sort(); for (var i = 0; i &lt; keys.length; i++) { result.push(value[keys[i]]); } return result.join(''); }); for (var i = (modified.length - 1); i &gt;= 0; i--) { if (modified.indexOf(modified[i]) !== i) { arr.splice(i, 1); } } alert(JSON.stringify(arr));
has comment: http://stackoverflow.com/comment/47911564
downvote count: 2
has comment: http://stackoverflow.com/comment/47911581
has comment: http://stackoverflow.com/comment/47912945
score: -2
has comment: http://stackoverflow.com/comment/47910821
has comment: http://stackoverflow.com/comment/47911230
has comment: http://stackoverflow.com/comment/47911926
type: Answer
has comment: http://stackoverflow.com/comment/47911396
has comment: http://stackoverflow.com/comment/47912727

http://stackoverflow.com/a/29953194
answers question: http://stackoverflow.com/q/29952432
has body: The reason your map worked for a while and later started failing is that you are using undocumented properties of the MouseEvent object. As you discovered, these may change at any time. Think about it: do kb and lb and gb sound like names you would use in your code to describe a mouse position? And would you change them willy-nilly like that? :-) So why does Google use gibberish names like these, and why do they change them all the time? In the original source code that their developers work on, of course they use readable and consistent names. But then they compile the code with a "minifier" that shortens the private variable/property/method names for faster loading. When they revise the source and recompile it, those short names get reassigned arbitrarily. The three different property names you found over the weeks clearly all refer to the same object in the original source, but the minifier changed the name you see in the browser. Never assume you can use a property or method you discover in your browser's developer tools - especially if it has a name that makes no sense. Check it first in the Maps API documentation, and if it's not there, don't use it. See Seyong's answer for the details of how to change your code to use the documented methods.
type: Answer
upvote count: 1
score: 1
downvote count: 0

http://stackoverflow.com/comment/48018537
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29932877
has text: `getElementsByClassName` (note the added `s`) works too on modern browsers! See http://caniuse.com/#feat=getelementsbyclassname
type: Comment

http://stackoverflow.com/q/29937203
has answer: http://stackoverflow.com/a/29937369
accepted answer: http://stackoverflow.com/a/29937369
type: Question
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json
tagged with: javascript
has comment: http://stackoverflow.com/comment/47996185
upvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/47996106
tagged with: jquery
favorite count: 0
downvote count: 5
has title: Find all parents elements in a Json file using jQuery
tagged with: css
score: -4
has body: I'm currently working on a recursive menu which is built on top of jQuery which looks quite good already. The structure of the JSon file containing the menu looks as the following: [ { "Id": "menuOfficeWebControlsForWebApplication", "Title": "Office Web Controls", "Resource": "/Documentation/Data/index.html" }, { "Id": "menuGettingStarted", "Title": "Getting Started", "Resource": "/Documentation/Data/getting-started.html", "Categories": [{ "Id": "menuCompilingFromSource", "Title": "Compiling From Source", "Resource": "/Documentation/Data/Getting-Started/compiling-from-source.html" },{ "Id": "menuDownloadReleasePackage", "Title": "Download Release Package", "Resource": "/Documentation/Data/Getting-Started/downloading-release-package.html" },{ "Id": "menuBuildingYourFirstApplication", "Title": "Building your first application", "Resource": "/Documentation/Data/Getting-Started/building-your-first-application.html" }] } ] Now, I can retrieve an item out of the menu using jQuery and the result might be this item: { "Id": "menuBuildingYourFirstApplication", "Title": "Building your first application", "Resource": "/Documentation/Data/Getting-Started/building-your-first-application.html" } Now, I want to retrieve all the elements which are at a higher level and all the items which are directly below that item. Any help is highly appreciated.

http://stackoverflow.com/comment/48054190
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29955711
has text: I find them difficult to understand, and needlessly complex; especially when used with an irregular language, such as written language (whether English, Italian, etc...).
type: AnswerComment

http://stackoverflow.com/comment/47829697
type: QuestionComment
score: 1
has text: @adeneo `window.outerHeight` is height **including** the _chrome_ , `window.innerHeight` is height **excluding** the _chrome_. The confusion has come from the [Google Chrome](http://www.google.com/chrome/) conversation above it. You will be getting 40 in your calculation because that will be how high your windows task-bar is (start menu, system tray, etc.).
comment on: http://stackoverflow.com/q/29850717
type: Comment

http://stackoverflow.com/q/29923971
tagged with: node.js
type: AnsweredQuestion
upvote count: 1
possible better answer: http://stackoverflow.com/a/29924244
has body: I'm writing javascript multiplayer game, my server code is in nodejs. I need to synchronize time between server and client. At server side i call Date() and send the date string to client. Client recieves: Tue Apr 28 2015 15:37:01 GMT+0000 (UTC) After initialization with: var time = Date("Tue Apr 28 2015 15:37:01 GMT+0000 (UTC)"); the time variable set to local time is: Tue Apr 28 2015 17:37:03 GMT+0200 (CEST). If i run my server localy then time is importing correctly. Is problem in different time format, CEST vs UTC ? Thank you for answers
accepted answer: http://stackoverflow.com/a/29924316
type: Question
has answer: http://stackoverflow.com/a/29924244
has comment: http://stackoverflow.com/comment/54351623
tagged with: javascript
answer count: 2
downvote count: 0
has title: Javascript Date() initialization in bad format
score: 1
tagged with: synchronization
favorite count: 0
has answer: http://stackoverflow.com/a/29924316
tagged with: datetime

http://stackoverflow.com/comment/48113749
has text: No worries, take your time :)
comment on: http://stackoverflow.com/a/29996889
score: 0
type: Comment
type: AnswerComment

http://stackoverflow.com/comment/48067986
comment on: http://stackoverflow.com/q/29973681
type: QuestionComment
has text: @dman2306 Oh! Text. Sorry.
type: Comment
score: 0

http://stackoverflow.com/comment/48037612
has text: that's a lot of code for us to attempt to debug
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29958524

http://stackoverflow.com/q/29997713
upvote count: 4
score: 3
has comment: http://stackoverflow.com/comment/48115090
has answer: http://stackoverflow.com/a/68850626
type: Question
has comment: http://stackoverflow.com/comment/48115116
has comment: http://stackoverflow.com/comment/48115070
tagged with: javascript
has body: I am a beginner when it comes to HTML coding. I am trying to complete an assignment for an online computer course. I have emailed my professor, but he has not been much help with this assignment. I must create a simple cost calculator that will allow a user to add quantity and price per item for up to three items. After an onclick button is pressed the total price should be displayed. I had a similar assignment last week and was able to complete the coding and design on my own. I cant figure this one out. This is the code that I have so far. Name <FONT SIZE="7" Easy Cost Calculator # of Items Cost Per Item Item Total <input type="button" value="Calculate Total" onclick=' var q1 = document.forms[0].quantity1.value; var q2= document.forms[0].quantity2.value; var q3= document.forms[0].quantity3.value; var cpi1 = document.forms[0]. cost per item1.value; var cpi2= document.forms[0]. cost per item2.value; var cpi3= document.forms[0]. cost per item3.value; var st11= q1*cpi1; document.forms[0].item total1.value= st11; var st2= q2*cpi2; document.forms[0].item total2.value= st2; var st3= q3*cpi3; document.forms[0]. item total3.value= st3; var tc =st11+st2+st3 ; document.forms[0].total.value= tc; '>
has answer: http://stackoverflow.com/a/29997875
has comment: http://stackoverflow.com/comment/48115085
has title: How to use javascript in a HTML document to create a simple cost calculator
has comment: http://stackoverflow.com/comment/48115139
tagged with: http://stackoverflow.com/tag/html
downvote count: 1
has comment: http://stackoverflow.com/comment/48115927
answer count: 4
favorite count: 0
has answer: http://stackoverflow.com/a/29997879
has answer: http://stackoverflow.com/a/29997884
has comment: http://stackoverflow.com/comment/48137929
has comment: http://stackoverflow.com/comment/48115087
type: UnansweredQuestion

http://stackoverflow.com/comment/47912114
score: 1
comment on: http://stackoverflow.com/q/29894088
type: Comment
type: QuestionComment
has text: There's code on plunker, what's the point of posting dozens of lines of code into the question? There's a nested if because I was messing around, trying to see whether it's the element itself that causes the issue.

http://stackoverflow.com/q/29980922
favorite count: 0
has comment: http://stackoverflow.com/comment/48081490
type: UnansweredQuestion
downvote count: 3
score: -3
has comment: http://stackoverflow.com/comment/48081801
has body: I have nested json data with objects Account and Category.Category is in account json data.I pass default columns to map function and it creates my columns.But if i pass Category.Name i cant see on screen.How can i pass nested data property name to this function ? //Default Columns: this.defaultColumns = ["Name","Limit","Category.Name"]; //My Function: that.props.results.map(function(rowData){ return ( &lt;tr&gt; {that.props.defaultColumns.map(function (column) { return ( &lt;td&gt;{rowData[column]}&lt;/td&gt; ); &lt;/tr&gt;})} JSON Data: [{ "RowNumber":"e0275f18-f86a-1d2e-97e6-b8ce9a4a7fef", "Name":1, "Limit":78, "Category":{ "RowNumber":"b72a77db-8c44-8b59-5044-3c42595203aa", "Name":"Produce" } }]
type: Question
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/48081866
has answer: http://stackoverflow.com/a/29981254
has comment: http://stackoverflow.com/comment/48081880
tagged with: reactjs
upvote count: 0
has comment: http://stackoverflow.com/comment/48081833
tagged with: arrays
answer count: 1
tagged with: javascript
has title: Pass nested json item name to function

http://stackoverflow.com/comment/53257248
has text: I think you should try to do this `angular.extend({}, $scope.actions.data, data); `. https://docs.angularjs.org/api/ng/function/angular.extend. This helps me a lot and this also works for me.
comment on: http://stackoverflow.com/a/29948773
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/30000551
accepted answer of: http://stackoverflow.com/q/30000492
score: 2
answers question: http://stackoverflow.com/q/30000492
downvote count: 0
upvote count: 2
type: AcceptedAnswer
has body: You can't without putting it in the global namespace somehow. My recommendation to structure code like this: function ExampleHelper() { (function(scope) { scope.globalConfiguration = null; scope.loadFile = function(filePath) { }; scope.onLoadPage = function() { }; scope.getConfiguration = function() { }; scope.process = function() { }; })(this); } var foo = new ExampleHelper(); // "foo" now contains all of your functions foo.onLoadPage(); Edit 2024: Use classes instead now - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes This wasn't available/widely supported when this answer was originally posted
type: Answer

http://stackoverflow.com/comment/47950083
type: Comment
has text: @DeepakSamuel node.js are working in scopes and callback maner. It's his nature. Are you sure you need to implement code in this way? You can try to sync vars via promise interface.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29913290

http://stackoverflow.com/q/29965452
tagged with: angularjs
answer count: 1
has title: window.resolveLocalFileSystemURI is not a function
accepted answer: http://stackoverflow.com/a/30665893
score: 8
type: AnsweredQuestion
downvote count: 0
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/49393899
upvote count: 8
tagged with: file-io
type: Question
has answer: http://stackoverflow.com/a/30665893
tagged with: android
linked to: http://stackoverflow.com/q/8326272
has body: I created a web application that I need to convert to a mobile application, now all I have is html5/js/css files which means I don't have any www foder no platforms folder, not a cordova project ... I started first to build the app using cordova command lines, but I couldn't, I found many problems on that, I used then https://build.phonegap.com/ , and it works fine for me. In order to read the file, I have tried this code : window.resolveLocalFileSystemURI("file:///android_asset/www/data/User.xml", function () { alert("Success"); }, function () { alert(" error "); }); but, it didn't work. I added a try catch, the exception was : window.resolveLocalFileSystemURI is not a function Do i need to add something to my code to make it work ?
tagged with: cordova

http://stackoverflow.com/comment/48120278
score: 0
comment on: http://stackoverflow.com/q/30000714
has text: Why use # navigation. Use scrollintoview or the jquery plugin navigation, which also supports callback (run after scroll finishes) that would solve your issue. Also, in my opinion, you should specify what browsers you are targeting. tl;dr: You are describing normal browser behavior. which you can avoid by ordering the events properly.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/48033104
type: Comment
type: QuestionComment
score: 2
has text: Is your `javascript` executed just once when the page loads or is it called as a function at some point after the user has typed something into the text field named `"email"`?
comment on: http://stackoverflow.com/q/29956126

http://stackoverflow.com/q/29956252
type: Question
has answer: http://stackoverflow.com/a/29956297
has answer: http://stackoverflow.com/a/29956309
tagged with: if-statement
has body: &lt;script&gt; $(document).ready(function() { session_start(); if (!$_SESSION['kool']) { alert("session") } else { alert('work') location.href = 'lol.html'; } }); &lt;/script&gt; it doesn't work why ?
tagged with: session
tagged with: javascript
upvote count: 2
answer count: 2
favorite count: 0
downvote count: 5
type: UnansweredQuestion
score: -3
tagged with: php
has comment: http://stackoverflow.com/comment/48033287
has title: JavaScript to check if PHP session exists

http://stackoverflow.com/comment/48122752
type: Comment
comment on: http://stackoverflow.com/a/29999866
has text: I open the model pretty much like you do, based on the snippet from the boostrap documentation. I added some dummy extra data model ('items') that came in my snippet, but in your case the focus is wroking fine even with the ng- repeat. I have other components in the patch such angular tree. Nope, I will analyse my page. In any case, why do you need to use the timeout service if your timeout is set to 0?
type: AnswerComment
score: 0

http://stackoverflow.com/q/29949237
has comment: http://stackoverflow.com/comment/48019353
tagged with: arrays
tagged with: javascript
has comment: http://stackoverflow.com/comment/48040965
has answer: http://stackoverflow.com/a/29949263
type: AnsweredQuestion
has title: Convert string to array or object
linked to: http://stackoverflow.com/q/3473639
accepted answer: http://stackoverflow.com/a/29949263
has body: is there possible to convert this string to array or object? It is not a valid stringify JSON data, not sure how to tackle this. "{"subject":"Test Comment"},{"message":"Test Message."}" Thank in advance!
type: Question
has comment: http://stackoverflow.com/comment/48019318
score: 0
has comment: http://stackoverflow.com/comment/48041101
answer count: 1

http://stackoverflow.com/a/29976473
downvote count: 0
score: 1
has body: If you just want to make &lt;div class="righthead"&gt; drop below the other divs without overlapping &lt;nav&gt;, change the float property of this media query ruleset from none to left: before: @media (max-width: 500px) { .righthead { float: none !important; } } after: @media (max-width: 500px) { .righthead { float: left !important; } }
upvote count: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29975948
type: Answer
answers question: http://stackoverflow.com/q/29975948

http://stackoverflow.com/q/29855533
downvote count: 0
accepted answer: http://stackoverflow.com/a/29855594
has title: CSS animated button won't animate when clicked outside
type: Question
tagged with: javascript
tagged with: jquery
upvote count: 2
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
has body: I have a button to trigger nav menu to open (this is placed in the top right corner). When you open the menu (by clicking the button) it works as intended - menu is open and button animates. It also works when you click the icon again - Then it closes the menu and animates the icon back to it's initial position. But when you have the menu open and click outside the icons area it closes the menu BUT the icon doesn't animate. How can I get the icon to animate back to initial position, when a click outside has been made? Here is the fiddle And here is the script: $(function() { var btn = $('#btn'); menu = $('nav ul'); menuHeight = menu.height(); $(btn).on('click', function(e) { e.preventDefault(); menu.slideToggle(); }); $('html').on("click touchstart", function() { menu.slideUp(); }); $('.nav-wrapper').on("click touchstart", function(event){ event.stopPropagation(); }); $( "#nav-toggle" ).on( "click", function() { $( this ).toggleClass( "active" ); }); }
tagged with: animation
tagged with: css
type: AnsweredQuestion
score: 2
has answer: http://stackoverflow.com/a/29855594

http://stackoverflow.com/comment/47914246
has text: just another supplementary question , what is the "ability to add multiple events in a single listener function eg. on(), known in Jquery ?? "
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29894967
type: Comment

http://stackoverflow.com/a/29898869
type: AcceptedAnswer
downvote count: 0
has body: The setInterval() function returns a value that identifies that particular timer. You can use clearInterval() later to stop it. var timerId; // should probably be global // ... clearInterval(timerId); // clear prev timer timerId = setInterval(function() { /* ... */ }, 1000);
has comment: http://stackoverflow.com/comment/47920699
type: Answer
score: 2
upvote count: 2
accepted answer of: http://stackoverflow.com/q/29898816
answers question: http://stackoverflow.com/q/29898816
has comment: http://stackoverflow.com/comment/47920661
has comment: http://stackoverflow.com/comment/47921145
has comment: http://stackoverflow.com/comment/47921149

http://stackoverflow.com/q/29848141
has title: Handle appear.in applications as api calls
upvote count: 2
type: Question
has comment: http://stackoverflow.com/comment/47824051
tagged with: javascript
has comment: http://stackoverflow.com/comment/47872763
score: 2
tagged with: api
downvote count: 0
answer count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/31694111
type: UnansweredQuestion
has body: Is there any way to access the appear.in API (Developer page) via python? I want to create a user with the API and with that credentials, I then want to create multiple rooms. I am assigning each rooms to separate persons hence I am storing the details in a database. Any help?
tagged with: python

http://stackoverflow.com/q/29857367
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47914480
has title: Adding Custom Point on the X axis- Kendo UI
answer count: 1
has comment: http://stackoverflow.com/comment/47914316
has comment: http://stackoverflow.com/comment/47915059
has comment: http://stackoverflow.com/comment/47915903
tagged with: javascript
has comment: http://stackoverflow.com/comment/47914960
tagged with: kendo-ui
has answer: http://stackoverflow.com/a/29997304
score: 0
accepted answer: http://stackoverflow.com/a/29997304
has comment: http://stackoverflow.com/comment/47914435
has comment: http://stackoverflow.com/comment/47912837
has body: I have the following project and only missing piece that I could not able to figure out that to add 0 on the X axis. The interval is 2000, therefore it is skipping 0 in the middle of X axis, which is start point. xAxis: { min: -5000 , axisCrossingValue: [-5000, 0], labels: { template: kendo.template($("#labelTemplate").html()) }, } , yAxis: { reverse: true , labels: { format: "{0}" } } http://jsfiddle.net/3yhbyy2g/37/

http://stackoverflow.com/a/29986032
has body: Just create a child-parent map so that you can look up what you need: var map = {}; function recurse(arr, parent) { if (!arr) return; for (var i=0; i&lt;arr.length; i++) { // use underscore here if you find it simpler map[arr[i].key] = parent; recurse(arr[i].children, arr[i]); } } recurse(data, {key:"root", children:data}); Now, in your event handler you can trivially use that map to look up your siblings: map[clicked.key].children
answers question: http://stackoverflow.com/q/29985568
score: 0
type: Answer

http://stackoverflow.com/comment/47976040
comment on: http://stackoverflow.com/q/29926755
score: 0
type: Comment
type: QuestionComment
has text: Are you looking for something like `browser.get()` or `browser.driver.get()`?http://angular.github.io/protractor/#/api?view=Protractor.prototype.get

http://stackoverflow.com/comment/48092617
type: Comment
has text: Hope the down vote was not some kind of vendetta vote
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29977854

http://stackoverflow.com/q/29911729
has title: Layout in ExtJs 4.1
upvote count: 1
type: Question
score: 1
answer count: 2
has answer: http://stackoverflow.com/a/29912770
tagged with: layout
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/29911936
tagged with: multiple-columns
favorite count: 0
tagged with: extjs
possible better answer: http://stackoverflow.com/a/29911936
accepted answer: http://stackoverflow.com/a/29912770
type: AnsweredQuestion
tagged with: extjs4.2
has body: Hy, this is my first question so please be nice to me. :D Ok here is my question i have a problem with the layout in ExtJs. basically i want a layout like: +--------+-----------------+-----------------+-------------------+ | B | TF | B | TF | |--------|--------+--------|-----------------+-------------------+-------------+ | B | TF | B | B | TF | B | +--------+--------+--------+-----------------+-------------------+-------------+ where B stands for Ext.Button and TF for Ext.form.TextField an those Buttons and TextFields are in a new Ext.Panel({ layout : { type : 'table', columns : 10 } }); I tried it with a colspan but it won't work.

http://stackoverflow.com/a/38011927
score: 22
answers question: http://stackoverflow.com/q/29939697
upvote count: 22
has body: The script named as "build" in package.json is not special in any way. The only way to get it to run is to call: npm run-script build There are some names which are called automatically by npm, but "build" is not one of them. The full list is: prepublish, publish, postpublish preinstall, install, postinstall preuninstall, uninstall, postuninstall preversion, version, postversion pretest, test, posttest prestop, stop, poststop prestart, start, poststart prerestart, restart, postrestart preCUSTOM and postCUSTOM for custom script names.
downvote count: 0
type: Answer

http://stackoverflow.com/comment/47877925
type: AnswerComment
type: Comment
has text: With `path` I mean the `src` attribute on your ` ` tags, I think Mr Morphe explained it more clearly: http://stackoverflow.com/a/29876640/1240061
score: 0
comment on: http://stackoverflow.com/a/29876604

http://stackoverflow.com/q/29872840
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/29873003
has answer: http://stackoverflow.com/a/29957590
type: AnsweredQuestion
tagged with: underscore.js
has answer: http://stackoverflow.com/a/29872922
accepted answer: http://stackoverflow.com/a/29872922
possible better answer: http://stackoverflow.com/a/29872968
type: Question
has answer: http://stackoverflow.com/a/29872968
upvote count: 1
tagged with: javascript
has body: I'd like to use Javascript's lodash to turn this object of arrays into percentages. Here is the object: gender = { female: [14, 33, 28, 49], male: [33, 50, 42, 61] } I would like the above object to be genderPercent = { female: [0.2978, 0.3975, ..., ...], male: [0.7021, 0.6024, ..., ...] } Here is what I already tried: _.map(gender, function (val, index, list) { gender["male"][gender["male"].length-1] / gender["male"][gender["male"].length-1] + gender["female"][gender["female"].length-1]) }); But this doesn't seem to work. Any suggestions? :) (Note: I need the solution to scale with time because my gender array(s) continue to grow each month.)
favorite count: 0
has title: Use .map to turn quantity into percentages
tagged with: lodash
answer count: 4
has comment: http://stackoverflow.com/comment/47871149

http://stackoverflow.com/comment/47968829
type: Comment
comment on: http://stackoverflow.com/q/29923286
type: QuestionComment
has text: How are `$scope.schedules` and `$scope.scheduleList` related? It's unclear from your post how they are linked (or if they are supposed to be the same)
score: 0

http://stackoverflow.com/comment/47913243
type: AnswerComment
type: Comment
has text: @Vikrant, I think you should also send him the bill for your work (obvious give me the codez post), but for your effort i'm willing to upvote you ;)
score: 1
comment on: http://stackoverflow.com/a/29893731

http://stackoverflow.com/comment/48041601
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29960135
has text: have you used ng-click?

http://stackoverflow.com/q/29948680
answer count: 4
tagged with: append
type: AnsweredQuestion
has title: How merge two objects array in angularjs?
has comment: http://stackoverflow.com/comment/48018213
type: Question
has answer: http://stackoverflow.com/a/29948773
possible better answer: http://stackoverflow.com/a/34102673
tagged with: javascript
tagged with: jquery
score: 27
accepted answer: http://stackoverflow.com/a/29948773
has answer: http://stackoverflow.com/a/34102673
upvote count: 27
has comment: http://stackoverflow.com/comment/48018227
downvote count: 0
linked to: http://stackoverflow.com/q/19765283
has body: I want to append following object array with existing one in angulajs for implementing load more feature. ie,appending AJAX response with existing one each time. I have one variable, $scope.actions which contains following JSON data, { "total": 13, "per_page": 2, "current_page": 1, "last_page": 7, "next_page_url": "http://invoice.local/activities/?page=2", "prev_page_url": null, "from": 1, "to": 2, "data": [ { "id": 2108, "action_type_id": 202, "user_id": 1 }, { "id": 2108, "action_type_id": 202, "user_id": 1 } ] } I want to append following JSON response each time this variable. { "data": [ { "id": 2108, "action_type_id": 202, "user_id": 1 }, { "id": 2108, "action_type_id": 202, "user_id": 1 } ] } I have tried with $scope.actions.data.concat(data.data); but it is not working and getting following error message $scope.actions.data.concat is not a function
favorite count: 0
has comment: http://stackoverflow.com/comment/48018200
has comment: http://stackoverflow.com/comment/48018217
tagged with: angularjs
tagged with: merge
has answer: http://stackoverflow.com/a/37061604
has answer: http://stackoverflow.com/a/39487315

http://stackoverflow.com/comment/69056171
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29852258
has text: JSFiddle is broken :(

http://stackoverflow.com/q/29857066
type: Question
tagged with: javascript
score: -1
accepted answer: http://stackoverflow.com/a/29857262
upvote count: 0
answer count: 1
has body: I have this ajax call that's suppose to run when a key is pressed on a specific textbox. Once in the call, it runs a function that fires an alert. But, its doesn't work. Maybe it's cause I wrote the call using an old forum post as reference. Assume, I called the jquery library cause on my test I did but I didn't post it here. This is what I've tried so far: &lt;script&gt; $("#&lt;% =tb.ClientID%&gt;").keydown ( function () { debugger; alert("hello"); } ); &lt;/script&gt; &lt;body&gt; &lt;asp:TextBox Id = "tb" runat = "server"/&gt; &lt;/body&gt; I'm new to these kind of calls. I'm very familiar with js functions, but I've never done this. Any explanations and suggestions, would be greatly appreciated.
tagged with: jquery
tagged with: asp.net
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/47840074
has comment: http://stackoverflow.com/comment/47840369
has title: Ajax call not running onKeydown
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29857262
downvote count: 1
has comment: http://stackoverflow.com/comment/47840075

http://stackoverflow.com/comment/48019467
has text: I didn't ask why, I asked how you are reloading the data into Javascript?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29928522

http://stackoverflow.com/q/29900155
has body: I'm developing a software on Excel as an App for Office, using office.js. For some part, I'm hooking to a table in the excel to check if its data is changed using following code: myBinding.addHandlerAsync(Office.EventType.BindingDataChanged, onBindingDataChanged); function onBindingDataChanged(eventArgs) { // eventArgs has just the binding info. // I want to have selected cell row and column, and old and new data. } Unfortunately the information in eventArgs is not enough for me to detect changes. Worth to mention that for Office.EventType.BindingSelectionChanged, there's lots of usable information such as startRow, startColumn, .... So my question is: How can I access these information: Changed Row Changed Column Old Data New Data
has title: How can I access the changed data in using office.js
answer count: 1
tagged with: office-app
favorite count: 0
has answer: http://stackoverflow.com/a/30873195
type: UnansweredQuestion
tagged with: excel
tagged with: office-js
type: Question
upvote count: 4
downvote count: 0
tagged with: javascript
score: 4

http://stackoverflow.com/comment/76088484
type: Comment
comment on: http://stackoverflow.com/a/29922772
score: 0
type: AnswerComment
has text: @mirabilos: Yeah I would have expected there would be problems with things like that. Unfortunately I don't know enough about RTF format to provide anything more robust

http://stackoverflow.com/comment/47837903
has text: so if you know you can check if the array contains a value, what's your problem?
comment on: http://stackoverflow.com/q/29855916
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47921256
type: Comment
comment on: http://stackoverflow.com/a/29898852
has text: But by doing it this, like the example below, when you hit cancel, it still deleted the record
type: AnswerComment
score: 0

http://stackoverflow.com/comment/47977725
comment on: http://stackoverflow.com/q/29927789
has text: Use `.split()` to split it into an array, delete the last element of the array, then `.join()` to combine them back into a string.
type: Comment
type: QuestionComment
score: 2

http://stackoverflow.com/a/29938061
has body: The code snippet provided above is working fine, as Dr.Molle pointed out in the comments, it led me to further investigate that there was another onChange event on the same textbox txtAddress that was resetting coordinates. Solution If someone else is facing the same issue please check your code to see if there is onChange event on the same textbox overriding the map data. function initializeGoogleMap() { .... // Code Works Fine } Check Working Code Here PS: In my case i couldn't have posted my whole JS file as it was huge! so i could only post the main snippet handling the map.
score: 0
accepted answer of: http://stackoverflow.com/q/29927587
answers question: http://stackoverflow.com/q/29927587
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/q/29894937
type: AnsweredQuestion
has body: Here is a JS Fiddle which shows what I have at the moment. I would like to add a text 3D/2D doesn't matter. The text should rotate along with the rotation of the white circle. Any method is preferred as long as the intended result is obtained. Here is the code. three.js code var SCREEN_WIDTH = window.innerWidth, SCREEN_HEIGHT = window.innerHeight, mouseX = 0, mouseY = 0, windowHalfX = window.innerWidth / 2, windowHalfY = window.innerHeight / 2, SEPARATION = 200, AMOUNTX = 100, AMOUNTY = 10, camera, scene, renderer; init(); animate(); function init() { var container, separation = 100, amountX = 50, amountY = 50, particles, particle; container = document.createElement('div'); document.body.appendChild(container); camera = new THREE.PerspectiveCamera(75, SCREEN_WIDTH / SCREEN_HEIGHT, 1, 10000); camera.position.y = 5800; camera.position.z = 1000; scene = new THREE.Scene(); renderer = new THREE.CanvasRenderer({ alpha: true }); renderer.setPixelRatio(window.devicePixelRatio); renderer.setSize(SCREEN_WIDTH, SCREEN_HEIGHT); container.appendChild(renderer.domElement); // particles var PI2 = Math.PI * 2; var material = new THREE.SpriteCanvasMaterial({ color: 0xffffff, program: function (context) { context.beginPath(); context.arc(0, 0, 9.5, 0, PI2, true); context.fill(); } }); for (var i = 0; i &lt; 1000; i++) { particle = new THREE.Sprite(material); particle.position.x = Math.random() * 2 - 1; particle.position.y = Math.random() * 2 - 1; particle.position.z = Math.random() * 2 - 1; particle.position.normalize(); particle.position.multiplyScalar(Math.random() * 10 + 450); particle.scale.multiplyScalar(10); scene.add(particle); } // lines for (var i = 0; i &lt; 300; i++) { var geometry = new THREE.Geometry(); var vertex = new THREE.Vector3(Math.random() * 2 - 1, Math.random() * 2 - 1, Math.random() * 2 - 1); vertex.normalize(); vertex.multiplyScalar(1850); geometry.vertices.push(vertex); var vertex2 = vertex.clone(); vertex2.multiplyScalar(Math.random() * 0.3 + 1); geometry.ve…
has comment: http://stackoverflow.com/comment/47913092
type: Question
has comment: http://stackoverflow.com/comment/47913039
score: 0
has title: Add text to an object(the white circle) in three.js
accepted answer: http://stackoverflow.com/a/29896039
answer count: 1
tagged with: javascript
tagged with: jquery
tagged with: texture-mapping
tagged with: css
tagged with: three.js
has answer: http://stackoverflow.com/a/29896039

http://stackoverflow.com/comment/47897179
has text: Is it.? Okay then let me try and get back to you. Thanks for the help.
type: Comment
comment on: http://stackoverflow.com/a/29870434
score: 1
type: AnswerComment

http://stackoverflow.com/comment/138025905
type: AnswerComment
type: Comment
has text: 2/2 ... Your implementation just does prove it for it just covers the most common/widespread approach of ... `class A extends fakeMultiInheritanceHook(B, C, D) { /* */ }` ... behind the fake syntax of ... `class A extends B, C, D { /* */ }` ... but it can not, like all the others, escape the true single/linear inheritance nature of JS.
score: 1
comment on: http://stackoverflow.com/a/78288151

http://stackoverflow.com/a/29960123
upvote count: 1
answers question: http://stackoverflow.com/q/29959953
type: AcceptedAnswer
downvote count: 0
has body: Google's (or anyone's) geolocation stuff isn't always accurate. I remember when I moved about 5km down the road to a new house, it still insisted my desktop was back at the old house because (I think) it had detected my router at that location sometime in the past. I had to get onto Google and basically tell them to delete that knowledge at which point it ended up re-evaluating. I would say that whatever method being used to locate you (such as network routes to get to you, local WiFi network names, cell tower strengths and so on) is not working too well. It can be plenty accurate when the device has, for example, a GPS it can query but the methods for desktops aren't necessarily that good.
accepted answer of: http://stackoverflow.com/q/29959953
type: Answer
has comment: http://stackoverflow.com/comment/48089749
score: 1

http://stackoverflow.com/q/29993892
tagged with: webrtc
favorite count: 0
type: UnansweredQuestion
score: 5
has title: opentok.js error when stopping screensharing (Cannot read property 'connections' of null)
answer count: 0
tagged with: opentok
type: Question
has body: I am trying to implement screen sharing using TokBox service in chrome and chromium. After chrome prompts to select a window everything works correctly but when I stop the screen sharing clicking on the "Stop sharing" button in the "pop up" that appears when screen sharing is in progress an error occurs: Uncaught TypeError: Cannot read property 'connections' of null ---- opentok.js line 11103 When using tokbox meet demo in the same browser this error does not happen: http://meet.tokbox.com I modified the basic tokbox tutorial code to reproduce this problem:
upvote count: 5
downvote count: 0
tagged with: javascript
tagged with: tokbox

ruby-on-rails-4
type: Tag
tags question: http://stackoverflow.com/q/29908007
tags question: http://stackoverflow.com/q/29991316
tags question: http://stackoverflow.com/q/29958215
tags question: http://stackoverflow.com/q/29979804
tags question: http://stackoverflow.com/q/29955732
tags question: http://stackoverflow.com/q/29853278
tags question: http://stackoverflow.com/q/29847985
tags question: http://stackoverflow.com/q/29901466
tags question: http://stackoverflow.com/q/29981876
tag name: ruby-on-rails-4
tags question: http://stackoverflow.com/q/29871743

http://stackoverflow.com/q/29871916
has comment: http://stackoverflow.com/comment/47868912
has comment: http://stackoverflow.com/comment/47869201
score: 1
type: Question
tagged with: jquery-ui-sortable
tagged with: jquery-ui
tagged with: javascript
tagged with: jquery
upvote count: 2
answer count: 1
downvote count: 1
has answer: http://stackoverflow.com/a/29873301
accepted answer: http://stackoverflow.com/a/29873301
favorite count: 0
has comment: http://stackoverflow.com/comment/47868939
has title: Jquery sortable is not working with touch
has comment: http://stackoverflow.com/comment/47868830
type: AnsweredQuestion
has body: I have created a simple jquery application, which supports sortable interaction. But this application does not work properly on mobile device with a touch screen. See demo here var divL; var word = "lorem ipsum"; $(function(){ var parsed = word.split("");; var x = $("#sortable"); for(var i = 0; i &lt; word.length; i++){ $('&lt;li&gt;&lt;/li&gt;').attr('class','item').attr('id',i).html(parsed[i]).appendTo(x); } }); $(function() { x = $( '#sortable' ) x.sortable({ placeholder:"itemPlaceHolder", cursor:"move", }); x.disableSelection(); }); How can I fix this issue ?

http://stackoverflow.com/a/29930649
upvote count: 1
downvote count: 0
has body: The function you wrote is not used. Try this instead &lt;script&gt; var x=2 $(document).ready(function(){ (function(){ x=3; })(); alert(x); }); &lt;/script&gt; Notice the added parenthesis which invoke the function immediatly after declaration. A working jsfiddle: http://jsfiddle.net/nayish/x9kzefc2/ In your example since x is defined outside of the function it is entered into the functions closure and so , if you would have immediatly, or some time later on run the function it would have changed the value of x that was defined outside the functions scope. Explanation on self invoking functions: https://sarfraznawaz.wordpress.com/2012/01/26/javascript-self-invoking-functions/
answers question: http://stackoverflow.com/q/29930577
type: Answer
score: 1

http://stackoverflow.com/comment/47891309
type: Comment
has text: @DCDC There's nothing in JavaScript syntax that defines this.
score: 1
comment on: http://stackoverflow.com/a/29883604
type: AnswerComment

http://stackoverflow.com/comment/48067830
type: Comment
has text: Depends entirely on what backend technologies you are using. PHP, Python, .NET etc all have ways to decode Base64 strings and create files though.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29973262

http://stackoverflow.com/comment/48027439
type: AnswerComment
comment on: http://stackoverflow.com/a/29953120
has text: You're welcome! Maps are designed for fast data look up. So for example, instead of doing the whole inside loop to match a name from tagsArray to selectedTags array, it uses a different approach that uses less time to find the same match.
type: Comment
score: 1

http://stackoverflow.com/q/29952234
answer count: 1
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29952501
favorite count: 0
has title: Access sails locals from view
score: 2
upvote count: 2
tagged with: node.js
type: AnsweredQuestion
has body: I'm playing around with Sails.js and trying to do some basic stuff to figure out how it works. I need to pass a variable to my view from the controller, should be simple. The routing works, but the variable isn't there, what am I missing ? Controller index: function (req, res) { User.find().exec(function list(err, listed){ return res.view('user/index', {users: listed}); }); } View: &lt;ul&gt; &lt;% _.each(users, function (dawg) { %&gt; &lt;li&gt;&lt;%= dawg.name %&gt;&lt;/li&gt; &lt;% }) %&gt; &lt;/ul&gt; Error: ReferenceError: /home/ejerhar/git/swriter/views/user/index.ejs:2 1| &lt;ul&gt; &gt;&gt; 2| &lt;% _.each(users, function (dawg) { %&gt; 3| &lt;li&gt;&lt;%= dawg.name %&gt;&lt;/li&gt; 4| &lt;% }) %&gt; 5| &lt;/ul&gt; users is not defined
has answer: http://stackoverflow.com/a/29952501
type: Question
tagged with: sails.js

http://stackoverflow.com/comment/48048426
type: Comment
type: QuestionComment
score: 0
has text: Can you post your codes and if possible, a rough sketch of what you have now and what you want.
comment on: http://stackoverflow.com/q/29964072

http://stackoverflow.com/comment/128529604
score: 0
comment on: http://stackoverflow.com/a/43158068
type: Comment
type: AnswerComment
has text: `bind|call|apply|toString` won't be own property names. Omitting `name|length` from the prototype will lead to quite a few false positives. And `prop.match()` won't work when `prop` is a symbol!

http://stackoverflow.com/comment/48048928
type: Comment
comment on: http://stackoverflow.com/a/29964375
has text: Yeah seems worthy shud give it a try
score: 0
type: AnswerComment

http://stackoverflow.com/a/29885366
downvote count: 1
upvote count: 37
has body: If you are storing data in a key-value store, please use Map which is explicitly designed for this purpose. If you have to use an object though, ES2017 (ES8) allows you to use Object.values: const foo = { a: 'foo', z: 'bar', m: 'baz' }; for (let value of Object.values(foo)) { console.log(value); } If that isn't supported yet, use a polyfill: Alternative version for Object.values() And finally if you're supporting an older environment that don't support this syntax, you'll have to resort to using forEach and Object.keys: var obj = { a: 'foo', z: 'bar', m: 'baz' }; Object.keys(obj).forEach(function (prop) { var value = obj[prop]; console.log(value); });
has comment: http://stackoverflow.com/comment/67918460
score: 36
has comment: http://stackoverflow.com/comment/65130632
has comment: http://stackoverflow.com/comment/63628321
has comment: http://stackoverflow.com/comment/63524862
type: Answer
answers question: http://stackoverflow.com/q/29885220
has comment: http://stackoverflow.com/comment/78406605

http://stackoverflow.com/comment/47911330
type: Comment
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/29893885
has text: Huey, there are some differences in the movement when I make cross check on these two. Thanks for your answer

http://stackoverflow.com/q/29926720
tagged with: http://stackoverflow.com/tag/json
tagged with: javascript
has answer: http://stackoverflow.com/a/29927147
has answer: http://stackoverflow.com/a/29928115
score: 0
has comment: http://stackoverflow.com/comment/47975972
possible better answer: http://stackoverflow.com/a/29927053
tagged with: variables
tagged with: jquery
has answer: http://stackoverflow.com/a/29927053
has comment: http://stackoverflow.com/comment/47975463
has comment: http://stackoverflow.com/comment/47976027
has comment: http://stackoverflow.com/comment/47975996
accepted answer: http://stackoverflow.com/a/29927147
tagged with: store
has title: How to get a specific information from Json output
answer count: 4
has comment: http://stackoverflow.com/comment/47975663
has comment: http://stackoverflow.com/comment/47975605
has answer: http://stackoverflow.com/a/29927617
has body: I am doing a school project and I am working with json output form Google Geocoding API. I don't know how to store the "formatted_address" (see below) of the output in a variable so I can use this information later. Here is a piece of the json output that I am working with. "results" : [ { "address_components" : [ { "long_name" : "11A", "short_name" : "11A", "types" : [ "street_number" ] }, { "long_name" : "Albyn Place", "short_name" : "Albyn Pl", "types" : [ "route" ] }, { "long_name" : "Aberdeen", "short_name" : "Aberdeen", "types" : [ "locality", "political" ] }, { "long_name" : "Aberdeen", "short_name" : "Aberdeen", "types" : [ "postal_town" ] }, { "long_name" : "Aberdeen City", "short_name" : "Aberdeen City", "types" : [ "administrative_area_level_2", "political" ] }, { "long_name" : "United Kingdom", "short_name" : "GB", "types" : [ "country", "political" ] }, { "long_name" : "AB10 1YE", "short_name" : "AB10 1YE", "types" : [ "postal_code" ] } ], "formatted_address" : "11A Albyn Place, Aberdeen, Aberdeen City AB10 1YE, UK", "geometry" : { "location" : { "lat" : 57.1425663, "lng" : -2.1144957 }, "location_type" : "ROOFTOP", "viewport" : { "northeast" : { "lat" : 57.1439152802915, "lng" : -2.113146719708498 }, "southwest" : { "lat" : 57.1412173197085, "lng" : -2.115844680291502 } } }, "place_id" : "ChIJ89KpnycOhEgR96EdolCIM8U", "types" : [ "street_address" ] }, { "address_components" : [ { "long_name" : "Union Grove (o/s 82)", "short_name" : "Union Grove (o/s 82)", "types" : [ "bus_station", "transit_station", "establishment" ] }, { "long_name" : "Aberdeen", "short_name" : "Aberdeen", "types" : [ "locality", "political" ] }, { "long_name" : "Aberdeen", "short_name" : "Aberdeen", "types" : [ "postal_town" ] }, { "long_name" : "Aberdeen City", "short_name" : "Aberdeen City", "types" : [ "administrative_area_level_2", "political" ] }, { "long_name" : "United Kingdom", "short_name" : "GB", "types" : [ "country", "political" ] }, { "long_name" : "AB10", "short_name" …
type: Question
type: AnsweredQuestion

http://stackoverflow.com/comment/48380304
has text: The SVG didnt rendered properly, `This page contains the following errors: error on line 1 at column 1: Encoding error`.
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/30134616

http://stackoverflow.com/a/29986383
downvote count: 3
upvote count: 1
has body: The problem with your code is that you're invoking slideDown() only when someone clicks on your flip element but you wish to do it on page load, so you can use jQuery's document.ready handler itself do that $(document).ready(function(){ $("#panel").slideDown("slow"); }); This will slideDown the panel when DOMContentLoaded event is fired which happens when all your scripts and markup are downloaded but your css and images are still downloading. If you really want to slideDown the panel, only when the page is completely loaded i.e., markup,all scripts, images and css files are downloaded and processed, then you can listen for load event of the window like this $(window).load(function(){ $("#panel").slideDown("slow"); });
answers question: http://stackoverflow.com/q/29986342
type: Answer
score: -2

http://stackoverflow.com/a/29858549
score: 1
has body: Here is an example using i to append them in the proper order when they all finish loading: mod.getArticles = function( ){ // initialize an empty array of proper size var articles = Array(3 - mod.vars.ajaxCount); var completed = 0; //mod.vars.ajaxCount could start at 0-2 for( var i = mod.vars.ajaxCount; i &lt; 3; i++ ){ // prevent i from being 3 inside of done callback (function (i){ //mod.vars.pushIds is an array with the ids to be ajaxed in var id = mod.vars.pushIds[i]; $.ajax({ url: '/ajax/article/' + id + '/', type: "GET", dataType: 'HTML', error: function() { console.error('get article ajax error'); } }).done( function( data ) { completed++; if (data.length) { // store to array in proper index articles[i - mod.vars.ajaxCount] = data; } else { console.error('get article ajax output error'); } // if all are completed, push in proper order if (completed == 3 - mod.vars.ajaxCount) { // iterate through articles for (var j = mod.vars.ajaxCount; j &lt; 3; j++) { // check if article loaded properly if (articles[j - mod.vars.ajaxCount]) { mod.appendArticle(articles[j - mod.vars.ajaxCount]); } } } }); }(i)); } };
upvote count: 1
has comment: http://stackoverflow.com/comment/47928683
has comment: http://stackoverflow.com/comment/47942939
answers question: http://stackoverflow.com/q/29858388
type: Answer
has comment: http://stackoverflow.com/comment/48019499
downvote count: 0

http://stackoverflow.com/q/29871445
type: UnansweredQuestion
has title: To Do List using JQuery and LocalStorage
has answer: http://stackoverflow.com/a/29871549
tagged with: arrays
tagged with: jquery
type: Question
tagged with: list
score: 0
answer count: 1
has body: Hi guys I'm trying to create a TODO list using JQuery and Local Storage. If the localstorage has values already, they should populate when the page loads (closing the window and reopening retains the "todo's") If an item already exists in the list, show a console message noting the duplicate (using $.inArray) User should be able to add and remove items and have the changes save automatically (using splice) This is what I have so far: TODO List Add Is something wrong in the code? How can I add the splice and check duplicates using $.inArray? Thanks.
tagged with: http://stackoverflow.com/tag/json
tagged with: javascript

http://stackoverflow.com/comment/69801512
score: 5
type: AnswerComment
type: Comment
has text: internal command should be renamed to `_build` and `npm build` shuould be a shortcut like `npm start` and `npm test`
comment on: http://stackoverflow.com/a/30112350

datatables
tags question: http://stackoverflow.com/q/29999120
tags question: http://stackoverflow.com/q/29849538
tags question: http://stackoverflow.com/q/29944119
tags question: http://stackoverflow.com/q/29896599
tags question: http://stackoverflow.com/q/30002319
tags question: http://stackoverflow.com/q/29976886
tags question: http://stackoverflow.com/q/29969792
tags question: http://stackoverflow.com/q/29918525
tags question: http://stackoverflow.com/q/29898747
tags question: http://stackoverflow.com/q/29929022
tags question: http://stackoverflow.com/q/29889127
tags question: http://stackoverflow.com/q/29891753
tags question: http://stackoverflow.com/q/29961134
tags question: http://stackoverflow.com/q/29893207
tags question: http://stackoverflow.com/q/29957684
tags question: http://stackoverflow.com/q/29963137
type: Tag
tags question: http://stackoverflow.com/q/29907992
tags question: http://stackoverflow.com/q/29966605
tags question: http://stackoverflow.com/q/29946463
tag name: datatables
tags question: http://stackoverflow.com/q/29877651
tags question: http://stackoverflow.com/q/29898722

http://stackoverflow.com/comment/47882760
type: Comment
has text: it works with `alert('msg');` but doesnt work with my function that write to iframe `iframe.write('msg');` why? :(
comment on: http://stackoverflow.com/a/29878847
score: 0
type: AnswerComment

http://stackoverflow.com/comment/47908079
type: Comment
score: 0
comment on: http://stackoverflow.com/a/29892220
type: AnswerComment
has text: Thank you, i took id form the link, and put it in what you said, but it still doesn't work

http://stackoverflow.com/q/29920784
favorite count: 0
score: 28
has answer: http://stackoverflow.com/a/33562308
has answer: http://stackoverflow.com/a/29920865
has answer: http://stackoverflow.com/a/75439330
has body: I'm using a custom version of sweetalert to ask my user for an input. I have managed to make the everything work but there is an strange behavior, In order to be able to input a text in the input box you have to click screen first: swal({ title: "Aggiornamento profilo", text: '&lt;br /&gt;&lt;form method="post" id="taxcode-update" name="taxcodeUpdate"&gt;&lt;input id="admin-tax-code" minlength="3" class="form-control wedding-input-text wizard-input-pad" type="text" name="taxCode" placeholder="Codice fiscale"&gt;&lt;/form&gt;', type: "warning", showCancelButton: false, confirmButtonText: "Aggiorna il mio profilo", closeOnConfirm: false }, function () { swal("Deleted!", "Your imaginary file has been deleted.", "success"); }); Working example: https://jsfiddle.net/fvkppx06/
has title: Input text in sweetAlert
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/52781407
accepted answer: http://stackoverflow.com/a/33562308
type: Question
has answer: http://stackoverflow.com/a/57586700
tagged with: sweetalert
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/30884113
has answer: http://stackoverflow.com/a/55901833
upvote count: 28
downvote count: 0
answer count: 7
possible better answer: http://stackoverflow.com/a/55901833

http://stackoverflow.com/comment/47999723
comment on: http://stackoverflow.com/q/29937532
score: 0
has text: In fact, this is a ExtJS code generated by Sencha Architect. But some of developpers doesn't take time to attribute a real name to functions, they let the framework attribute functions name with name incremented
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29956581
favorite count: 0
has answer: http://stackoverflow.com/a/45888999
has comment: http://stackoverflow.com/comment/48505922
has comment: http://stackoverflow.com/comment/48034370
answer count: 3
has comment: http://stackoverflow.com/comment/48067382
has comment: http://stackoverflow.com/comment/48034218
downvote count: 1
has title: React event not firing in React Component
has body: Here is my react code. I seen several examples for calling a function and I am having no luck. I have my app.js folder rendering the NavigationDiv to HTML in a separate folder, everything is displaying even the button but when I click on it nothing happens. This was a close post to mine: React events not firing but mine still is not firing. If I put {this.fireEvent()} I can get it to fire once but not again. Thank you in advance! var React = require('react'); var NavigationDiv = React.createClass({ getInitialState: function() { return {liked: false}; }, handleClick: function(event) { this.setState({ liked: !this.state.liked }); }, fireEvent:function() { console.log("am i being clicked" ); }, render: function() { var text = this.state.liked ? 'like' : 'haven\'t liked'; return ( &lt;button onClick={this.fireEvent}&gt; You Click to toggle. {text} &lt;/button&gt; ); } }); module.exports = NavigationDiv;
has comment: http://stackoverflow.com/comment/52639225
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/39587792
has comment: http://stackoverflow.com/comment/48135309
score: 1
type: Question
upvote count: 2
tagged with: reactjs
linked to: http://stackoverflow.com/q/28623734
has comment: http://stackoverflow.com/comment/48033932
tagged with: javascript
has comment: http://stackoverflow.com/comment/48033877
has comment: http://stackoverflow.com/comment/48034028
has answer: http://stackoverflow.com/a/31034547
has comment: http://stackoverflow.com/comment/48034172

http://stackoverflow.com/a/29899279
has body: This example checks if ANY part of the element is inside the specified region When you have the top and bottom coordinates of two boxes, you can check if the two boxes overlap by checking: box1.top < box2.bottom && box1.bottom > box2.top In the following example, box1 is the 30%-60% portion of window while box2 is each list item. Add debounce function and we have: var timeout; $(window).on("load scroll resize", function() { if (timeout) { clearTimeout(timeout); } timeout = setTimeout(function() { var $window = $(window), hitbox_top = $window.scrollTop() + $window.height() * .3, hitbox_bottom = $window.scrollTop() + $window.height() * .6; $("li").each(function() { var $element = $(this), element_top = $element.offset().top, element_bottom = $element.offset().top + $element.height(); $element.toggleClass("middle-viewport", hitbox_top < element_bottom && hitbox_bottom > element_top); }); }, 200); }); #overlay { position: fixed; left: 0; top: 30%; width: 100%; height: 30%; background-color: rgba(0, 192, 255, .5); } ul { padding: 0; text-align: center; } li { display: inline-block; margin: 10px; width: 200px; height: 200px; background-color: #F5F5F5; } li.middle-viewport { background-color: #FF0000; }
type: Answer
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/29891587
upvote count: 2

http://stackoverflow.com/comment/47856155
comment on: http://stackoverflow.com/q/29865487
score: 0
type: QuestionComment
has text: If it's in the background, you will probably have a problem with z-index layering. Why is it in the background if it's to be drawn upon? Should we assume you will place more content on top of it that is not to be drawn upon?
type: Comment

http://stackoverflow.com/a/29883319
upvote count: 4
has comment: http://stackoverflow.com/comment/47891067
downvote count: 0
has body: To read JSON in your POST requests you should use body-parser: npm install --save body-parser Then add to your server side: var bodyParser = require('body-parser'); // parse application/json server.use(bodyParser.json()); server.post("/savedata", function(req, res){ console.log(req.body); }); You also have to update your ajax request with following: contentType: "application/json", data: JSON.stringify(hellodata),
score: 4
accepted answer of: http://stackoverflow.com/q/29882601
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29882601
type: Answer

http://stackoverflow.com/a/29962372
upvote count: 1
has comment: http://stackoverflow.com/comment/48045816
accepted answer of: http://stackoverflow.com/q/29962280
answers question: http://stackoverflow.com/q/29962280
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/48045267
has body: jQuery won't do string modification like that. All inputs will be is an in-memory representation of &lt;input&gt; tags, changes to these will not save back to the pdfhtml string. What you should do instead is clone the #Calculation div, then perform your actions: $("#submit_btn").off("click").on("click", function(e) { e.preventDefault(); var pdfhtml = $("#Calculation").clone(); // Clone this var inputs = pdfhtml.find("input[type=number]"); $.each(inputs, function(k, v) { $(this).remove(); }); var data = {}; data["data"] = pdfhtml.html(); // Read the HTML here... alert(pdfhtml); getdataJSON("","POST", "html", data, true); });
type: Answer
has comment: http://stackoverflow.com/comment/48046132
score: 1

http://stackoverflow.com/q/29964674
answer count: 1
has comment: http://stackoverflow.com/comment/48070772
favorite count: 0
has comment: http://stackoverflow.com/comment/48051660
has title: Not all HTTPS requests from a loop reach server
has comment: http://stackoverflow.com/comment/48051501
has body: This is my JavaScript: &lt;script type="text/javascript"&gt; (function () { var lidd = 1; var ga1 = document.createElement('script'); ga1.type = 'text/javascript'; ga1.async = true; var res = ["A1LpRTPOUKU%3d", "a8g%2bUPW0%2bck%3d", "ptb0PT3OMIc%3d", "8NzewxsG6Zc%3d"]; for (var i = 0; i &lt; res.length; i++) { alert('mid=' + res[i]); ga1.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://') + 'localhost:59115/ui/trackconversion.aspx?cid=CAR9nmKJG1A%3d&amp;mid=' + res[i] + '&amp;lid=' + lidd; var s1 = document.getElementsByTagName('script')[0]; s1.parentNode.insertBefore(ga1, s1); } })(); &lt;/script&gt; My issue is that the for loop is not working properly in this code. Here the length of res is 4, hence the loop should be executed 4 times, but in my code it's only executed partially. This means, when I execute the code, I get alert('mid=' + res[i]); 4 times showing all the four values, i.e., "A1LpRTPOUKU%3d", "a8g%2bUPW0%2bck%3d", "ptb0PT3OMIc%3d", and "8NzewxsG6Zc%3d". But after that, my trackconversion.aspx is hit only once instead of getting hit 4 times. What am I doing wrong?
has answer: http://stackoverflow.com/a/29964727
type: AnsweredQuestion
downvote count: 5
tagged with: javascript
score: -1
accepted answer: http://stackoverflow.com/a/29964727
has comment: http://stackoverflow.com/comment/48070379
has comment: http://stackoverflow.com/comment/48070579
type: Question
has comment: http://stackoverflow.com/comment/48070692
upvote count: 4
has comment: http://stackoverflow.com/comment/48049675

http://stackoverflow.com/q/29863302
has title: $.getScript for every element of an array
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29863358
upvote count: 1
has body: The var json.script is an array. Every element is a path to a script, which I want to load via $.getScript. It should look like something like this - but I don't know how to loop the array to get every array-element: $.when( $.getScript( json.script ), $.getScript( json.script ), $.getScript( json.script ), $.getScript( json.script ), $.Deferred(function( deferred ){ $( deferred.resolve ); }) ) .done(function( script, textStatus ) { success(json); }) .fail(function( jqxhr, settings, exception ) { errormessage( exception ); });
type: Question
tagged with: arrays
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47851964
answer count: 2
has answer: http://stackoverflow.com/a/29863348
accepted answer: http://stackoverflow.com/a/29863358
downvote count: 0
score: 1
favorite count: 0
possible better answer: http://stackoverflow.com/a/29863348

http://stackoverflow.com/comment/47967624
type: QuestionComment
comment on: http://stackoverflow.com/q/29922713
score: 0
type: Comment
has text: I don't get an error, it's just not working to execute insert_download.php. I've used alert to verify if the function is executed and it's ok, so I guess the problem is with the ajax part.

http://stackoverflow.com/comment/47940680
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29908877
has text: Ok let me look into that. Thank you

http://stackoverflow.com/comment/47973497
type: QuestionComment
has text: I am looking at the /log/development file, put I am not seeing anything useful is that the right place to be lookinjg?
comment on: http://stackoverflow.com/q/29925593
score: 0
type: Comment

http://stackoverflow.com/comment/48143381
comment on: http://stackoverflow.com/a/30009346
type: Comment
has text: I'll try to explain again what I need... since this solution does not work for me...
score: 0
type: AnswerComment

http://stackoverflow.com/a/29948195
has comment: http://stackoverflow.com/comment/48050821
has comment: http://stackoverflow.com/comment/48051060
score: 3
accepted answer of: http://stackoverflow.com/q/29916316
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/48043755
type: Answer
upvote count: 3
has comment: http://stackoverflow.com/comment/48051297
has comment: http://stackoverflow.com/comment/48050381
answers question: http://stackoverflow.com/q/29916316
has body: SP.FieldCollection object contains the following methods for getting Field object: getById - gets the field with the specified ID getByInternalNameOrTitle - returns the first Field object with the specified internal name or title from the collection getByTitle - returns the first field object in the collection based on the title of the specified field Example The following example demonstrates how to retrieve site column: function getSiteField(fieldName,success,failure) { var ctx = SP.ClientContext.get_current(); var rootWeb = ctx.get_site().get_rootWeb(); var field = rootWeb.get_availableFields().getByInternalNameOrTitle(fieldName); ctx.load(field); ctx.executeQueryAsync( function(){ success(field) }, failure); } Usage SP.SOD.executeFunc('SP.js', 'SP.ClientContext', function() { //get Title column and print its properties getSiteField('Title', function(field){ //print field properties console.log(field.get_title()); console.log(field.get_internalName()); console.log(field.get_typeAsString()); console.log(field.get_description()); }, function(sender,args){ console.log(args.get_message()); }); }); How to update Field object The following example demonstrates to update SP.FieldChoice field properties: function updateFieldChoice(fieldTitle,choiceValues,success,failure) { var ctx = SP.ClientContext.get_current(); var web = ctx.get_web(); var fieldChoice = ctx.castTo(web.get_availableFields().getByTitle(fieldTitle), SP.FieldChoice); fieldChoice.set_choices(choiceValues); fieldChoice.update(); ctx.executeQueryAsync( function(){ success(fieldChoice) }, failure); } Usage var choiceValues = ["Low", "Normal", "Critical"]; updateFieldChoice('RequestStatus',choiceValues, function(field){ console.log('Choice field has been updated'); }, function(sender,args){ console.log(args.get_message()); });

http://stackoverflow.com/comment/47866883
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/29870944
has text: What is `pair` and what is `addon`, and how are they related. Right now, even though you have a nested `ng-repeat`, you have completely independent data structures, so `addons` array is same for each `pair`.
type: Comment

http://stackoverflow.com/q/29934730
has answer: http://stackoverflow.com/a/29934945
has comment: http://stackoverflow.com/comment/47991501
favorite count: 0
tagged with: css
answer count: 4
accepted answer: http://stackoverflow.com/a/29934840
has answer: http://stackoverflow.com/a/29934796
has title: How to loop 3 divs with jQuery
type: AnsweredQuestion
score: 1
upvote count: 1
type: Question
has body: I need a little help looping multiple divs (3 or more) using jQuery. The look I am after is having my home page rotate its main image div with other divs so that both the background image (of the div only) changes as well as links contained within the div. I had created the effect with stacking CSS and fading in to an image behind, however now I also require the links in the div to change. This is the HTML for the section - Sample Now the Div that I want changing What We Are A Paragraph Learn more What We Are A Paragraph Learn more What We Are A Paragraph Learn more I found a similar code to what I am after : var slideShowDivs = ['.jumbrotron-1', '.jumbotron-2', '.jumbotron-3']; var currentID = 0; var slideShowTimeout = 1000; $(document).ready(function() { for (var i = 1; i < slideShowDivs.length; i++) $(slideShowDivs[i]).hide(); setTimeout(slideShowChange, slideShowTimeout); }); function slideShowChange() { var nextID = currentID + 1; if (nextID >= slideShowDivs.length) nextID = 0; $(slideShowDivs[currentID]).stop(true).fadeOut(400); $(slideShowDivs[nextID]).stop(true).fadeIn(400, function() { setTimeout(slideShowChange, slideShowTimeout); }); currentID = nextID; }​ But it doesnt seem to work. Any additional thoughts?
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47991491
has answer: http://stackoverflow.com/a/29934877
has answer: http://stackoverflow.com/a/29934840
possible better answer: http://stackoverflow.com/a/29934945
tagged with: http://stackoverflow.com/tag/html
downvote count: 0

http://stackoverflow.com/a/29999439
answers question: http://stackoverflow.com/q/29999422
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/48159445
has body: this refers to window object there, you probably want to refer to .progress or .progressFull element. $('.progressFull').animate({ 'width' : '1000%' }, 2000);
has comment: http://stackoverflow.com/comment/48159908

http://stackoverflow.com/comment/47832062
score: 0
has text: tnx, why that is not working on codepen? i changed style to css... but doesn't work there
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29853044

http://stackoverflow.com/a/29931902
type: Answer
has comment: http://stackoverflow.com/comment/48063131
answers question: http://stackoverflow.com/q/29928364
has body: IIRC, the kendo batch option will only upload the files as a collection if selected at the same time (browse, then select more than one file). Once you select additional file(s) they will be sent in another request. The only way you can force the files to be posted during the same request is to use the synchronous mode rather than async. Good luck.
score: 0
has comment: http://stackoverflow.com/comment/48067181

http://stackoverflow.com/comment/48034144
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29956374
has text: All promises are "thenable", so they return somewhat the same properties, but currently I think jQuery's `$.when` only supports jQuery's promises, which incidentally don't follow the A+ standard.

http://stackoverflow.com/comment/47851058
type: Comment
has text: `alert()` won't show the contents of an object. Use `console.log()`.
comment on: http://stackoverflow.com/a/29862592
type: AnswerComment
score: 0

http://stackoverflow.com/comment/47860381
comment on: http://stackoverflow.com/a/29867592
score: 0
type: AnswerComment
has text: Updating answer to reflect these comments.
type: Comment

http://stackoverflow.com/comment/47923007
type: QuestionComment
comment on: http://stackoverflow.com/q/29862125
score: 1
has text: Thanks for our suggestions and links.Finally i found the solution and that was to keep the property "editable:true" to "editable:false" and everything worked fine.
type: Comment

http://stackoverflow.com/a/55177712
downvote count: 0
has body: The cgi, written in C-language bellow, returns the list of the environment parameters, among them REMOTE_ADDR. It constitutes a base for any HTML page, providing cgi are enabled in the HTTP server (Apache2 for instance). Just compile the source in your directory /cgi/bin and call it from your browser. /* ----------------------------------------------------- ENVVARS.C A simple program in C designed for working in a CGI context - print the environment variables. -------------------------------------------------- */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/types.h> #include <unistd.h> // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // m a i n // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ int main(int argc, char **argv, char **env) { char **pe; printf("Content-type: text/html\n\n" " " " " " ENVVARS " " " " ENVVARS " " My pid is: %d \n",getpid()); printf(" "); for (pe=env; pe && *pe; pe++) printf(" %s<//li>\n",*pe); printf(" "); printf(" "); return 0; } // end main //////////////////// EOF //////////////////////////////
type: Answer
upvote count: 2
answers question: http://stackoverflow.com/q/29959708
score: 2

http://stackoverflow.com/q/29972635
has body: I am trying to get values from the "links" instead of "nodes. I guess a more helpful way of asking this is how to specify where I am requesting getting the values from my JSON. JSON for reference: { "nodes": [ {"fixed":true,"data": {"id": "foo","idType":"USERNAME","color":"red"},"selected":false}, {"fixed":true,"data": {"id": "bar","idType":"USERNAME","color":"yellow"},"selected": false} ], "links": [ {"classes":null,"data":{"color":"blue","source":"foo","target":"bar","visible":true},"grabbable":false}, {"classes":null,"data":{"color":"green","source":"bar","target":"foo","visible":true},"grabbable":false} ]} So an example is I can get this to work node.style("fill", function(d) { return d.data['color'] }); but not link.style("stroke", function(d) { return d.data['color'] }); However, this works... link.style("stroke", "red"}); In the console it says d.data['color'] is undefined. I guess I do not understand how it is being called exactly. I have seen some examples of code that has function(d, i) { return bla bla } and I assumed that if d is always node, maybe i might be edges but adding that to my code didn't do much. If someone could explain what the i is touching that would be good also. Code snippet of actual code below: // Define the dimensions of the visualization. var width = innerWidth, height = innerHeight, color = d3.scale.category20(), root; // Create an array logging what is connected to what var linkedByIndex = { }; // Create the SVG container for the visualization and define its dimensions var svg = d3.select('body').append('svg') .attr('width', width) .attr('height', height); var link = svg.selectAll(".link"), node = svg.selectAll(".node"); // Create the force layout var force = d3.layout.force() .size([width, height]) .charge(-400) .linkDistance(50); //Read in the JSON data. d3.json("../test/resources/full.json", function(error, json) { // expands scope of json root = json alert(root) update(); }); function update() { // sets the source and target to…
score: 1
has comment: http://stackoverflow.com/comment/48098006
tagged with: http://stackoverflow.com/tag/json
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/48070985
has title: Specifying Values in D3 Graph from JSON
has comment: http://stackoverflow.com/comment/48067696
tagged with: force-layout
has comment: http://stackoverflow.com/comment/48075362
has answer: http://stackoverflow.com/a/30169713
tagged with: javascript
has comment: http://stackoverflow.com/comment/48075481
has comment: http://stackoverflow.com/comment/48070238
has comment: http://stackoverflow.com/comment/48096802
has comment: http://stackoverflow.com/comment/48076020
answer count: 1
downvote count: 0
favorite count: 0
tagged with: d3.js
accepted answer: http://stackoverflow.com/a/30169713
has comment: http://stackoverflow.com/comment/48065590
has comment: http://stackoverflow.com/comment/48066540
has comment: http://stackoverflow.com/comment/48070571
type: AnsweredQuestion

http://stackoverflow.com/comment/47869056
score: 0
type: Comment
has text: @Pointy Ah yes, I see how that doesn't make sense
comment on: http://stackoverflow.com/a/29871978
type: AnswerComment

http://stackoverflow.com/q/29939299
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/29941459
upvote count: 2
has title: Using Highcharts formatter causes Cannot read property 'length' of undefined
type: AnsweredQuestion
score: 2
has comment: http://stackoverflow.com/comment/48002547
accepted answer: http://stackoverflow.com/a/29941459
type: Question
has comment: http://stackoverflow.com/comment/47999958
tagged with: highcharts
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47999754
has body: I want to display custom text in tooltip. When I use my code, I got Cannot read property 'length' of undefined when I hover on tooltip. Does someone knows where's the problem? tooltip: { shared: false, formatter: function() { var serie = this.series; var s = '&lt;span style="color:' + serie.color + '"&gt;' + serie.options.name + '&lt;/span&gt;: &lt;b&gt;' + this.y + '&lt;/b&gt;&lt;br/&gt;'; $.each(serie.options.composition, function(name, value) {//Error pop ups here s += '&lt;b&gt;' + name + ':&lt;/b&gt; ' + value + '&lt;br&gt;'; }); return s; } } EDIT - Added error message: Uncaught TypeError: Cannot read property 'length' of undefinedm.extend.each @ jquery.min.js:2$.highcharts.tooltip.formatter @ grafovi.php:823Mb.refresh @ highcharts.js:160Va.runPointActions @ highcharts.js:166Va.onContainerMouseMove @ highcharts.js:174Va.setDOMEvents.b.onmousemove @ highcharts.js:176
has comment: http://stackoverflow.com/comment/47999980
answer count: 1

http://stackoverflow.com/comment/47859549
type: Comment
has text: Unfortunately, the first function is, in fact, not pure either. See my reply.
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/29861259

http://stackoverflow.com/q/29961289
has title: append text in tag using javascript
downvote count: 2
tagged with: php
answer count: 4
possible better answer: http://stackoverflow.com/a/29961372
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29961383
has answer: http://stackoverflow.com/a/29961372
type: Question
upvote count: 0
score: -2
tagged with: javascript
has answer: http://stackoverflow.com/a/29961423
favorite count: 0
has answer: http://stackoverflow.com/a/29961569
accepted answer: http://stackoverflow.com/a/29961569
has body: I'm a fresh developer, my question is that I want to append some text in the footer tag, my code is below &lt;script&gt; var result_string = '&lt;?php echo $result_string; ?&gt;'; var newpara = document.createElement("p"); var add_footer = document.createTextNode(result_string); newpara.appendChild(add_footer); var getFooter = document.getElementsByTagName('footer').innerHTML; alert(getFooter); get_footer.innerHTML = "&lt;p&gt;" + result_string + "&lt;/p&gt;"; // $("#getFooter").append(newpara); &lt;/script&gt; I am not getting any change in the footer text, please help

http://stackoverflow.com/a/46127917
answers question: http://stackoverflow.com/q/29996048
upvote count: 1
has body: I know I'm little late to answer this question but instead of using 2 strings why don't you do it by using just 1 string only. check out this npm package https://www.npmjs.com/package/react-simple-read-more It'll solve the problem. In case you are interested in code: https://github.com/oztek22/react-simple-read-more/blob/master/src/string-parser.jsx
type: Answer
downvote count: 0
has comment: http://stackoverflow.com/comment/127099167
score: 1

http://stackoverflow.com/comment/47902506
has text: where you declare & define m scope ?
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29888706

http://stackoverflow.com/a/30002219
score: 1
upvote count: 1
type: Answer
has body: I've had good experiences with the Mousetrap plugin. With it you can easily bind keypresses/combinations and execute code with it. It, among other things, automatically handles whether an input is focused (in which case you wouldn't want to execute the keybind) Without having seen your code, I'm guessing by offcanvas navigation you mean the navigation menu you see in mobile pages, opened by pressing a button? In which case you could use the following: Mousetrap.bind('m', function() { $("#your_menu_toggle_button").trigger("click"); });
downvote count: 0
answers question: http://stackoverflow.com/q/30001948

http://stackoverflow.com/comment/47971520
comment on: http://stackoverflow.com/a/29924964
has text: Will that work even if the set is a subclass of `Set`? I should've specified, that as a concern.
type: AnswerComment
type: Comment
score: 1

http://stackoverflow.com/q/29976359
type: Question
has body: I need the IP Address/Machine Name/Mac Address of the Client in my web application for a particular usecase. Using request.getRemoteHost()/request.getRemoteAddr() I get the details of the Firewall for the Network instead of the actual client machine. I also tried accessing the request header - X-Forwarded-For, as suggested in many answers. But it is always returned as Empty. I do not have control over the Proxy Server/Firewall Server to configure it to add the header, as they are Customer controlled. Is there any other API in Java or javascript to retrieve the original Client IP for the request. Any help is greatly appreciated...
answer count: 2
score: 5
has answer: http://stackoverflow.com/a/29976881
tagged with: network-programming
linked to: http://stackoverflow.com/q/9326138
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/48074003
upvote count: 5
downvote count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29978531
has comment: http://stackoverflow.com/comment/48072361
has title: Get the Actual IP Address of the Client behind Firewall, in Java
tagged with: java
linked to: http://stackoverflow.com/q/10277440

http://stackoverflow.com/comment/47911975
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29893098
has text: { "applicationName": "app1", "frequency": 1 }, { "applicationName": "app2", "frequency": 54 }, { "applicationName": "app3", "frequency": 3 },

http://stackoverflow.com/q/29942851
has title: Using chrome.downloads.acceptDanger from background page context
tagged with: javascript
answer count: 1
has answer: http://stackoverflow.com/a/30002272
favorite count: 0
has comment: http://stackoverflow.com/comment/48007076
has comment: http://stackoverflow.com/comment/48010401
tagged with: google-chrome-extension
has body: Invoking chrome.downloads.acceptDanger API method from background page context just causes this error: Javascript execution context is not visible (tab, window, popup bubble) What am I doing wrong? How to properly call this API from a background page?
type: AnsweredQuestion
upvote count: 2
accepted answer: http://stackoverflow.com/a/30002272
score: 1
downvote count: 1
type: Question

http://stackoverflow.com/comment/48097326
has text: I have checked I am sending non null values to the server .....how can i check the reason for the error
comment on: http://stackoverflow.com/q/29988231
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47974481
type: QuestionComment
type: Comment
score: 3
has text: `echo json_encode($treearr)` should work just fine ?
comment on: http://stackoverflow.com/q/29926387

http://stackoverflow.com/a/29850577
answers question: http://stackoverflow.com/q/29849666
type: Answer
has body: Here's a similar question on preventing flickering with Bootstrap-Select. The fact is that a Flash of Unstyled Content (FOUC) is going to happen anytime that JavaScript is running on the client after the page has rendered and changes the appearance of the page. You're best bet is to just minimize the changes ahead of time. The heavy handed approach would be to wait to display the page until all the scripts have run, but this is much worse for users. As Roryok suggested, the best way to mitigate this issue is to style the appearance of the native element as close as possible to the plugin control. To do that, just add the following css to any select element which will be applied before the javascript renders the control. /* apply styles to original select element before hidden */ select.select2{ color: #444; background-color: #FFF; border: 1px solid #AAA; border-radius: 4px; box-sizing: border-box; cursor: pointer; display: block; height: 28px; padding-left: 5px; font: unset; } Demo in Stack Snippets $('.select2').select2(); body { display: flex; flex-direction: row; } div { padding: 15px; display: flex; flex-direction: column; } label { font-weight: bold; } select { min-width: 150px; } .select2-theme { color: #444; background-color: #FFF; border: 1px solid #AAA; border-radius: 4px; box-sizing: border-box; cursor: pointer; display: block; height: 28px; padding-left: 5px; font: unset; } Select 2 Mustard Ketchup Relish Select2 Themed Mustard Ketchup Relish Default Select Mustard Ketchup Relish
has comment: http://stackoverflow.com/comment/100146044
has comment: http://stackoverflow.com/comment/100134394
upvote count: 3
has comment: http://stackoverflow.com/comment/47911152
score: 3
downvote count: 0

mongodb
tags question: http://stackoverflow.com/q/29949678
tags question: http://stackoverflow.com/q/29964554
tags question: http://stackoverflow.com/q/29963412
tags question: http://stackoverflow.com/q/30000685
tags question: http://stackoverflow.com/q/29896775
tags question: http://stackoverflow.com/q/29945824
tags question: http://stackoverflow.com/q/29917912
tags question: http://stackoverflow.com/q/29978195
tags question: http://stackoverflow.com/q/29991865
tag name: mongodb
tags question: http://stackoverflow.com/q/29968461
tags question: http://stackoverflow.com/q/29905317
tags question: http://stackoverflow.com/q/29848021
tags question: http://stackoverflow.com/q/29954094
tags question: http://stackoverflow.com/q/29957005
tags question: http://stackoverflow.com/q/29971324
tags question: http://stackoverflow.com/q/29983457
tags question: http://stackoverflow.com/q/29977815
type: Tag
tags question: http://stackoverflow.com/q/29993454
tags question: http://stackoverflow.com/q/29861111
tags question: http://stackoverflow.com/q/29969775
tags question: http://stackoverflow.com/q/29923360
tags question: http://stackoverflow.com/q/29904322
tags question: http://stackoverflow.com/q/29936078
tags question: http://stackoverflow.com/q/29896697
tags question: http://stackoverflow.com/q/29959602
tags question: http://stackoverflow.com/q/29897854
tags question: http://stackoverflow.com/q/29998323
tags question: http://stackoverflow.com/q/29856249
tags question: http://stackoverflow.com/q/29877254
tags question: http://stackoverflow.com/q/29995960
tags question: http://stackoverflow.com/q/29870586
tags question: http://stackoverflow.com/q/29850213
tags question: http://stackoverflow.com/q/29873557
tags question: http://stackoverflow.com/q/29850653
tags question: http://stackoverflow.com/q/29930464
tags question: http://stackoverflow.com/q/29903815
tags question: http://stackoverflow.com/q/29975316
tags question: http://stackoverflow.com/q/29850336
tags question: http://stackoverflow.com/q/29925152

http://stackoverflow.com/a/29947147
has body: jQuery.noConflict()(ready(function() { Response.Write("12") // Examples - images $("#various1").fancybox({ 'titlePosition' : 'inside', 'transitionIn' : 'none', 'transitionOut' : 'none' }); }); Find this in your code. There is an extra ) after this. Remove that
accepted answer of: http://stackoverflow.com/q/29947027
answers question: http://stackoverflow.com/q/29947027
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/48017000
score: 1

http://stackoverflow.com/q/29972701
type: Question
accepted answer: http://stackoverflow.com/a/29972963
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/48065319
tagged with: ajax
score: 0
has comment: http://stackoverflow.com/comment/48065467
tagged with: php
has body: Iam create online shop for my sister, but i have a problem when using ajax pagination, product show but data product mess. in page 1 or 3 or 4 and other pagging.. This is my screenshoot data products neat in pagging 1 This is my screenshoot data products mess in pagging 3 This is my code "product.php" View: This is my code "pagging_product.php" <?php include('koneksi.php'); $limit = 6; $adjacent = 3; if(isset($_REQUEST['actionfunction']) && $_REQUEST['actionfunction']!=''){ $actionfunction = $_REQUEST['actionfunction']; call_user_func($actionfunction,$_REQUEST,$con,$limit,$adjacent); } function showData($data,$con,$limit,$adjacent){ $page = $data['page']; if($page==1){ $start = 0; } else{ $start = ($page-1)*$limit; } $sql = "select * from product where show='OK' order by last_update desc"; $rows = $con->query($sql); $rows = $rows->num_rows; $sql = "select * from product where show='OK' order by last_update desc limit $start,$limit"; $data = $con->query($sql); $str=''; $i=0; while($row = mysqli_fetch_object($data)){ $kt = $row->kode_pr; $ktsp =str_replace("&", "~", str_replace(" ", "-", $row->link)); $data_kg = mysqli_query($con,"select * from kategori_product where kode_pr='".$kt."'"); $kg=mysqli_fetch_object($data_kg); $str.=" sampul."' height='200px' width='300px' alt='".$row->product."'> ".$row->product." Rp. ".$row->harga." ".$row->product." Kode Produk: ".$row->kode_p." Kategori: ".$kg->nama_kategori." Stok: ".$row->stock." Rp. ".$row->harga." ".$row->product." Kode Produk: ".$row->kode_p." Kategori: ".$kg->nama_kategori." Stok: ".$row->stock." Detail Produk "; $i++; } echo $str; pagination($limit,$adjacent,$rows,$page); } function pagination($limit,$adjacents,$rows,$page){ $pagination=''; if ($page == 0) $page = 1; //if no page var is given, default to 1. $prev = $page - 1; //previous page is page - 1 $next = $page + 1; //next page is page + 1 $prev_=''; $first=''; $lastpage = ceil($rows/$limit); $next_=''; $last=''; if($lastpage > 1) { //previous button if ($…
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29972963
tagged with: pagination
has title: Data mess when using ajax pagination
has comment: http://stackoverflow.com/comment/48065455

http://stackoverflow.com/q/29882683
type: AnsweredQuestion
tagged with: data-binding
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/29882803
has title: using data binding in onclick url
has answer: http://stackoverflow.com/a/29882850
answer count: 3
downvote count: 0
tagged with: url
favorite count: 0
tagged with: cordova
tagged with: angularjs
upvote count: 2
has body: I am using this cordova plugin to launch external urls in my Ionic App this is my code that works well. Privacy Policy However I would like to use data binding within the URL. How can I achieve the following: Privacy Policy it just prints it out as if it was a string. I have tried playing with the quotes however everything either breaks it or prints out a string.
accepted answer: http://stackoverflow.com/a/29882803
possible better answer: http://stackoverflow.com/a/29882753
has answer: http://stackoverflow.com/a/29882753
score: 2

http://stackoverflow.com/comment/48009892
has text: This is just the modal code which is hidden from the user. When a user clicks on a button that is lets say have an id="myButton", then the above modal is shown and the user can interact with. I would just like to resize this modal popup.
comment on: http://stackoverflow.com/q/29942149
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/48078060
has text: Perhaps you mean: `this.foo = foo;`. That creates an instance variable for the object you are creating.
type: Comment
comment on: http://stackoverflow.com/q/29979203
score: 0
type: QuestionComment

http://stackoverflow.com/a/29969401
type: Answer
answers question: http://stackoverflow.com/q/29969328
score: 0
has body: A solution, assuming that you don't have control over the report generator, would be to download the file in multiple smaller pieces, using range headers, process the piece, extract what's needed from it (I assume you'll be building some html components based on the report), and move to the next piece. You can tweak the piece size until you find a reasonable value for it, a value that doesn't make the browser crash, but also doesn't result in a large number of http requests. If you can control the report generator, you can configure it to generate multiple smaller reports instead of a huge one.

http://stackoverflow.com/comment/47839318
type: Comment
type: QuestionComment
has text: I haven't added that code yet but I will be using AJAX to send 4 arrays (months, days, hours, minutes) to a PHP Handler which will create the task using an API.
comment on: http://stackoverflow.com/q/29856541
score: 0

http://stackoverflow.com/a/29868537
accepted answer of: http://stackoverflow.com/q/29868453
type: Answer
downvote count: 0
score: 3
has body: Angular directives will work just fine inside of SVG. See the below code, using your ng-click function: count: {{count}} &lt;svg width="100" height="100"&gt; &lt;circle ng-click="count=count+1" ng-init="count=0" cx="50" cy="50" r="40" stroke="green" stroke-width="4" fill="yellow" /&gt; &lt;/svg&gt; SVG with angular ng-click example in plunker: http://plnkr.co/edit/KvHKa68oZ6YxQIJzyIXG?p=preview
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29868453
upvote count: 3

http://stackoverflow.com/comment/105940459
type: Comment
comment on: http://stackoverflow.com/a/41032123
has text: thanks @MarianoDesanze, +1 for your suggestion and added it in test cases. Taken care by removing duplication by unique function.
type: AnswerComment
score: 0

http://stackoverflow.com/q/29890156
answer count: 1
tagged with: javascript
tagged with: jquery
has title: get select option values in javascript file
has body: I have a select option tag in my HTML page like this <c:forEach items="${listUsers }" var="users"> ${users.getEmail() } </c:forEach> Also I have a JavaScript file to show the list of emails. I want to get the list of emails from the select option tag // Contact select // ================================ (function() { var REGEX_EMAIL = '([a-z0-9!#$%&*+/=?^_`{|}~-]+(?:[a-z0-9!#$%&*+/=?^_`{|}~-]+)*@' + '(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)'; var formatName = function(item) { return $.trim((item.firstName || '') + ' ' + (item.lastName || '')); }; // contact $('#selectize-contact') .selectize( { persist : false, maxItems : null, valueField : 'email', labelField : 'name', searchField : [ 'firstName', 'lastName', 'email' ], sortField : [ { field : 'firstName', direction : 'asc' }, { field : 'lastName', direction : 'asc' } ], options : //I want to insert the list of mails here function() { for(i=0;i<10;i++) { [{email:'dddddddd', firstName:'ssss', lastName:'' } ] } } [ { email : 'nikola@tesla.com', firstName : 'Nikola', lastName : 'Tesla' }, { email : 'brian@thirdroute.com', firstName : '<%= glksdsd %>Brian', lastName : 'Reavis' }, { email : 'pampersdry@gmail.com', firstName : 'John', lastName : 'Pozy' } ], render : { item : function(item, escape) { var name = formatName(item); return ' ' + (name ? '' + escape(name) + '' : '') + (item.email ? '' + escape(item.email) + '' : '') + ' '; }, option : function(item, escape) { var name = formatName(item); var label = name || item.email; var caption = name ? item.email : null; return ' ' + '' + escape(label) + ' ' + (caption ? '' + escape(caption) + '' : '') + ' '; } }, create : function(input) { if ((new RegExp('^' + REGEX_EMAIL + '$', 'i')).test(input)) { return { email : input }; } var match = input.match(new RegExp( '^([^<]*)<' + REGEX_EMAIL + '>$', 'i')); if (match) { var name = $.trim(match[1]); var postSpace = name .indexOf(' '); var firstName = name.substring( 0, postSpace); var lastName = nam…
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29890327
accepted answer: http://stackoverflow.com/a/29890327
has comment: http://stackoverflow.com/comment/47904001
type: Question
score: 0

http://stackoverflow.com/comment/48000556
type: QuestionComment
comment on: http://stackoverflow.com/q/29893852
has text: Oh..... yes you are absolutely right somewhere other ckeditor function insertText override with insertHtml. Now it is fixed.
score: 0
type: Comment

http://stackoverflow.com/q/29880721
tagged with: javascript
tagged with: express
score: 0
linked to: http://stackoverflow.com/q/10005939
answer count: 1
has comment: http://stackoverflow.com/comment/47890460
tagged with: angularjs
has answer: http://stackoverflow.com/a/29884994
tagged with: node.js
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json
has title: How do I set a route for a json response in express?
has body: I am trying to follow this Angular tutorial for handling form submissions with promises. I am running my server on node and I'm using express to handle routes. When the form is submitted and I get to the line var $promise = $http.jsonp('response.json', config) My application responds by trying to find a route for response.json and then redirects to a 404 page. I then get an Uncaught syntax error because it's trying to parse my jade template as the response.json. Is the best way to resolve this to define a route for the json response? Or is there something else I'm missing?
type: Question
accepted answer: http://stackoverflow.com/a/29884994
has comment: http://stackoverflow.com/comment/47885863

http://stackoverflow.com/comment/66912671
has text: If the TypeScript compiler throws an error, I would argue that the code is not *valid* TypeScript, even though the compiler might still emit working JavaScript. If the definition of the "superset" is that any *valid* JavaScript is also *valid* TypeScript, then TypeScript is **not** a superset of JavaScript.
score: 3
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29918421

http://stackoverflow.com/comment/47929530
type: QuestionComment
has text: http://jsfiddle.net/n1514sn7/1/ Possible solution accessing the first of the first .
comment on: http://stackoverflow.com/q/29903434
score: 0
type: Comment

http://stackoverflow.com/comment/47837860
comment on: http://stackoverflow.com/q/29855916
type: QuestionComment
has text: Can you paste a code to clarify the understanding?
type: Comment
score: 1

http://stackoverflow.com/comment/48018150
type: QuestionComment
has text: What do you mean by "tell" async.parallel that hgetall has complete? @Bergi
comment on: http://stackoverflow.com/q/29948474
score: 0
type: Comment

http://stackoverflow.com/q/29913791
type: Question
tagged with: network-programming
tagged with: javascript
score: -1
has body: How accurate is IP based Geolocation? Can it be used for server redirection based on IP address/location? Any other method to get exact zipcode of that location?
has title: IP address and Geolocation
answer count: 1
has comment: http://stackoverflow.com/comment/47949553
tagged with: server-side
favorite count: 0
accepted answer: http://stackoverflow.com/a/29914028
tagged with: php
has comment: http://stackoverflow.com/comment/47949460
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47949515
downvote count: 2
has answer: http://stackoverflow.com/a/29914028
upvote count: 1

http://stackoverflow.com/a/29994348
score: 0
has body: I never liked the object manipulation approach to building html. I like to build the string of html then insert it into the dom. Just my opinion. JS //to uppercase of first letter only String.prototype.toUpperCaseFirstLetter = function() { var s = this; return s.length &gt; 0 ? s.charAt(0).toUpperCase() + s.slice(1) : s; } var materialArray = ['leather','suade','nubuck']; function buildMaterialRadios () { var str = ''; for (var i = 0; i &lt; materialArray.length; i++) { var item = materialArray[i]; str += '&lt;label class="material-label" for="'+item+'_materials"&gt;'+item.toUpperCaseFirstLetter()+'&lt;/label&gt;&lt;input id="'+item+'_materials" class="shoe-materials" type="radio" name="materials" value="'+item+'"&gt;'; }; document.getElementById('material_selections').innerHTML = str; } buildMaterialRadios(); HTML &lt;form name="shoebuilderform"&gt; &lt;div id="material_selections"&gt;&lt;/div&gt; &lt;/form&gt; http://jsfiddle.net/qcmdnd4d/
type: Answer
answers question: http://stackoverflow.com/q/29993931

http://stackoverflow.com/comment/53324263
type: Comment
type: AnswerComment
has text: Did you ever figure out the solution to this?
score: 0
comment on: http://stackoverflow.com/a/29918964

http://stackoverflow.com/a/29937639
score: 2
has body: Assign the ViewBag property to a javascript array using var departments = JSON.parse('@Html.Raw(Json.Encode(ViewBag.Department))'); then you can access it with a normal loop or using a jquery .each() function, for example for (i = 0; i &lt; departments.length; i++) { var dept = departments[0]; // returns `Engeneering` }
accepted answer of: http://stackoverflow.com/q/29937505
has comment: http://stackoverflow.com/comment/47997250
has comment: http://stackoverflow.com/comment/47998414
answers question: http://stackoverflow.com/q/29937505
has comment: http://stackoverflow.com/comment/47997109
has comment: http://stackoverflow.com/comment/48033551
has comment: http://stackoverflow.com/comment/47996784
has comment: http://stackoverflow.com/comment/47997704
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/48040054
has comment: http://stackoverflow.com/comment/47997079
has comment: http://stackoverflow.com/comment/48013577
upvote count: 2
has comment: http://stackoverflow.com/comment/48039828
type: Answer

http://stackoverflow.com/q/29935288
has comment: http://stackoverflow.com/comment/47992621
has comment: http://stackoverflow.com/comment/47992544
downvote count: 0
has comment: http://stackoverflow.com/comment/47993282
has answer: http://stackoverflow.com/a/29935885
tagged with: javascript
has comment: http://stackoverflow.com/comment/47993432
has comment: http://stackoverflow.com/comment/47992441
has comment: http://stackoverflow.com/comment/47992772
answer count: 1
has comment: http://stackoverflow.com/comment/47993218
has comment: http://stackoverflow.com/comment/47993322
has comment: http://stackoverflow.com/comment/47992777
favorite count: 0
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/29935885
has title: How to add some variable to $scope.master object from controller in Angularjs
has comment: http://stackoverflow.com/comment/47993312
upvote count: 1
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47993293
has comment: http://stackoverflow.com/comment/47992518
has comment: http://stackoverflow.com/comment/47992857
has comment: http://stackoverflow.com/comment/47992470
score: 1
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/47993629
has body: My issue is how to add some variable in $scope.master object from the controller. I'm saving some data to db on angular form submit. And the goal is to automatically save 'date_create' variable on form submit. So I need to have it in angular's $scope.master object by default. And for that, as I think, I need to push it to $scope.master in the controller. What I have now and it doesn't work: app.controller('AddController', ['$scope', '$http', '$location', function($scope, $http, $location) { var currentDate = Math.floor(new Date().getTime() / 1000); $scope.master = {}; // I've tried to add variable from here // $scope.master = {date_update: currentDate}; $scope.activePath = null; // function which triggers on form submit $scope.addNew = function(product, AddNewForm) { $http.post('api/add', product).success(function(data){ // And also I've tried to add it from here $scope.master.date_update = currentDate; console.log(data); $scope.reset(); $scope.activePath = $location.path('/products'); }); $scope.reset = function() { $scope.product = angular.copy($scope.master); }; $scope.reset(); }; }]); Logs: Object {name: "123", category_id: "3", date_update: null, id: "11"}
type: Question

http://stackoverflow.com/comment/62607116
score: 0
type: AnswerComment
has text: `Uncaught TypeError: React.findDOMNode is not a function`
type: Comment
comment on: http://stackoverflow.com/a/29981486

http://stackoverflow.com/q/29977407
answer count: 2
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/29977477
has answer: http://stackoverflow.com/a/29977473
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/29977473
has body: I'm in need help in coding a web page in HTML5 where I can browse a file and enter a name in a text box and specify a location so that the portal can rename and save the file at location specified. The problem is I'm not supposed to use any server side languages like PHP or Perl. Is there a way that I can achieve this using JavaScript or jQuery or any Client side executable languages. Any insight is much appreciated.
has answer: http://stackoverflow.com/a/29977477
type: AnsweredQuestion
score: 0
tagged with: web-frontend
has comment: http://stackoverflow.com/comment/48074649
type: Question
has title: Need to modify a file name and location using JavaScript

http://stackoverflow.com/comment/47838577
type: Comment
comment on: http://stackoverflow.com/a/29855148
has text: Thank you for the explanation, now the concept is clear to me.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/47853434
type: Comment
comment on: http://stackoverflow.com/q/29864137
has text: first of all you have to include only one file the min one or the source one, not both
score: 0
type: QuestionComment

http://stackoverflow.com/q/29864387
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29864570
answer count: 4
has body: My submit button becomes disabled but won't go back to being enabled. What's wrong? HTML: JS:
downvote count: 3
has answer: http://stackoverflow.com/a/29864540
upvote count: 1
has comment: http://stackoverflow.com/comment/47854355
type: Question
has comment: http://stackoverflow.com/comment/47854100
has answer: http://stackoverflow.com/a/29864723
has comment: http://stackoverflow.com/comment/47854455
score: -2
has answer: http://stackoverflow.com/a/29864652
has title: JavaScript submit enable on keyup
tagged with: javascript
has comment: http://stackoverflow.com/comment/47855045
tagged with: submit
tagged with: button
favorite count: 0

http://stackoverflow.com/q/29864089
accepted answer: http://stackoverflow.com/a/29864216
tagged with: image
tagged with: src
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/47853390
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47853396
has title: jQuery image src fadeOut fadeIn effect
score: 0
has answer: http://stackoverflow.com/a/29864216
has comment: http://stackoverflow.com/comment/47853324
possible better answer: http://stackoverflow.com/a/29864218
has comment: http://stackoverflow.com/comment/47853414
has body: I have a problem with this code. It simply does not work. The process ends on fadinOut the image. I'm beginner in JS. The code: $(".intro_lg").click(function() { $(".intro_lg").fadeOut(1000, function() { var path = "http://website.com/img/intro2.png"; $(".intro_lg").attr("src", path); }).fadeIn(1000); return false; });
has answer: http://stackoverflow.com/a/29864218
type: AnsweredQuestion

http://stackoverflow.com/q/29873557
tagged with: mongodb
tagged with: sails.js
tagged with: javascript
tagged with: express
accepted answer: http://stackoverflow.com/a/29874088
answer count: 2
has answer: http://stackoverflow.com/a/29874088
favorite count: 0
has answer: http://stackoverflow.com/a/29878985
tagged with: node.js
score: 2
type: AnsweredQuestion
has body: The main interface app will return variables based on those initially POSTED by the client, and subsequent database calculations performed in real time by a dedicated engine. In Sails can we plug the engine into a Controller used for returning the calculated variable? What would be the best way to implement a real time link between the client and the engine ?
has title: In sails js should we plug a mongoDB database calculating app into a POST Controller?
downvote count: 0
possible better answer: http://stackoverflow.com/a/29878985
type: Question
upvote count: 2

http://stackoverflow.com/a/29941079
has body: test[1] will return underlying DOM element and .text() is a jQuery function thus you are getting the error. I think, You need to use .eq() Reduce the set of matched elements to the one at the specified index. Code test.eq(0).text() Note: that the supplied index is zero-based, and refers to the position of the element within the jQuery object, not within the DOM tree. OR, Use textContent test[1].textContent
accepted answer of: http://stackoverflow.com/q/29941039
answers question: http://stackoverflow.com/q/29941039
score: 0
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/comment/47939278
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29899300
has text: That makes a lot of sense. I chose to implement the moment-time-zone-with-data, took out the moment.tz.add, and now I'm getting along list of zones when I run moment.tz.names. However, I'm still getting the error that there's no data for America/New_York. The error: `Moment Timezone has no data for America/New_York. See http://momentjs.com/timezone/docs/#/data-loading/. logError @ moment-timezone-with-data-2010-2020.js:297 fn.tz @ moment-timezone-with-data-2010-2020.js:371 tz @ moment-timezone-with-data-2010-2020.js:315 startTime @ device.js:19 onload @ index.php?q=device&t=10:68`
score: 0

http://stackoverflow.com/comment/47950664
type: Comment
has text: Maybe I was a bit unclear, I will update the question, but I am specifically looking for a way which does not require me to initialize the first level of hash. It will be used dynamially, so there is no way for me to know what that level will be.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29914474

http://stackoverflow.com/q/29919472
has body: Is there any short, dependencies free, lightweight code for such canonicalization? Also, I tried to find open source implementations but found only irrelevant ones. I saw similar question but asker looking for exclusive canonicalization and answerer recommended not pure JS library. Also, there are nice libraries like deoxxa and xml-crypto but both of them doesn't support inclusive canonicalization. Proof: deoxxa, xml-crypto. Does anybody know good JS library for inclusive canonicalization, i.e, where canAlgo!= ...xml-exc-c14n... but canAlgo==...REC-xml-c14n-...
accepted answer: http://stackoverflow.com/a/32537725
linked to: http://stackoverflow.com/q/9308169
has comment: http://stackoverflow.com/comment/47960063
tagged with: javascript
has comment: http://stackoverflow.com/comment/47960343
has comment: http://stackoverflow.com/comment/47960291
type: AnsweredQuestion
score: 1
tagged with: http://stackoverflow.com/tag/xml
favorite count: 0
has answer: http://stackoverflow.com/a/32537725
type: Question
upvote count: 2
has comment: http://stackoverflow.com/comment/47960863
answer count: 1
downvote count: 1
has title: How perform Inclusive Canonicalization of XML in pure JavaScript?
tagged with: canonicalization

http://stackoverflow.com/q/29899218
has body: Here is the line that is throwing the problem: submitInfo(groups, $scope.Tab, other, drug, "Saved", false) .then(function () { }) The strange thing is that that submitInfo (which is an injected service) is recognized (I set a break point there). This error only gets thrown when groups is an empty array. I don't understand why this is happening or how to prevent it. I would like the function to execute even when groups is empty. here is submitInfo: summariesApp.factory('submitInfo', ['$http', '$q', 'validate', 'getInfo', '$rootScope', 'toaster', function ($http, $q, validate, getInfo, $rootScope, toaster) { return function (groups, Tab, other, drug, state, auto) { var deferred = $q.defer(); if (groups.length == 0) { return; } if (state != "Saved") { if (!validate(groups, Tab, other, drug, "submit")) { return; } } var deferral = $q.defer(); $http({ url: "ThirtySecond.aspx/SubmitSummary", method: "POST", data: { type: Tab, groups: groups, summaryState: state, other: other, drug: drug }, headers: { 'Content-Type': 'application/json; charset=utf-8' } }) .success ( function () { getInfo(Tab, other, drug) .then(function (data) { var newGroups = data; for (i = 0; i &lt; groups.length; i++) { var group = groups[i]; var newGroup = $rootScope._.find(newGroups, 'Grouptype', group.Grouptype); newGroup.show = group.show; newGroup.Checked = group.Checked; } switch (state) { case "Saved": if (auto) { successMessage = "Auto Saved"; } else { successMessage = "Saved"; } break; case "SubmittedForReview": successMessage = "Submitted for review"; break; case "NoSummaryWarranted": successMessage = "Summary updated as 'No Summary Warranted'"; break; case "FinalizedButNotRolledOut": successMessage = "Summary updated as 'Finalized but not ready to roll out'"; break; case "Finalized": successMessage = "Summary finalized"; break; default: successMessage = "Draft Entered"; } toaster.pop('success', "Updated", successMessage); angular.extend(groups, newGroups); deferral.resolve(true); }) } ) .err…
tagged with: javascript
has comment: http://stackoverflow.com/comment/47921354
has comment: http://stackoverflow.com/comment/47921478
has answer: http://stackoverflow.com/a/29899519
has comment: http://stackoverflow.com/comment/47921892
has title: angular - strange error 'Cannot read property then of undefined' when one of the arguments is an empty array
has comment: http://stackoverflow.com/comment/47921751
has comment: http://stackoverflow.com/comment/47921635
downvote count: 0
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/47921516
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/29899519
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47921473
score: 1
upvote count: 1
type: Question

http://stackoverflow.com/comment/47920817
comment on: http://stackoverflow.com/a/29898956
score: 0
type: Comment
has text: Mark his answer as Accepted
type: AnswerComment

http://stackoverflow.com/q/29863793
type: UnansweredQuestion
tagged with: php
has title: AMCharts How to color bullets by value?
score: 3
tagged with: amcharts
has body: I am working with amcharts and I tried to color bullets in the chart by the values they have. So I created an array in javascript and passed the values from the database into it. Green is just a value for testing. var chartData = [ &lt;?php foreach($tmp as $row) { echo'{"Wahrscheinlichkeit":'.$row[3].',"Schaden":'.$row[4].',"value":1,"Beschreibung":"'.$row[2].'", "Color":"Green"},'; } ?&gt; ]; Here I create the chart: chart = new AmCharts.AmXYChart(); chart.dataProvider = chartData; Here I draw the chart: var graph = new AmCharts.AmGraph(); graph.valueField = "value"; // größe der Kugeln graph.xField = "Wahrscheinlichkeit"; graph.yField = "Schaden"; graph.maxBulletSize=20; graph.lineAlpha = 0; graph.bullet = "circle"; graph.bulletColor= "Color"; graph.balloonText = "Wahrscheinlichkeit:&lt;b&gt;x&lt;/b&gt; Schaden:&lt;b&gt;y&lt;/b&gt;&lt;br&gt;Beschreibung:&lt;b&gt; Beschreibung&lt;/b&gt;" chart.addGraph(graph); At the point "bulletcolor" I try to get the color out of the array, but it doesn't work. chart.write("chartdiv"); Looking forward getting tips and help from you
upvote count: 3
has answer: http://stackoverflow.com/a/29864093
type: Question
tagged with: javascript
answer count: 1
downvote count: 0
favorite count: 0

http://stackoverflow.com/comment/47838730
has text: @AlekseyMatyushev, you don't need to change that value, you need to figure out WHERE the file lives. JavaScript doesn't have access to your filesystem, it just requests the file from your webserver.
comment on: http://stackoverflow.com/q/29856068
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47935852
score: 0
type: Comment
type: QuestionComment
has text: Really, does Q&A sites defy purpose of having a list of operators and their purposes (or documentation for a language)?
comment on: http://stackoverflow.com/q/29906553

http://stackoverflow.com/q/29897733
has answer: http://stackoverflow.com/a/29898279
score: 0
accepted answer: http://stackoverflow.com/a/29897898
has answer: http://stackoverflow.com/a/29897915
tagged with: navbar
has title: Creating a moving bar (inside the nav bar) which moves to the element the user hovers on?
type: AnsweredQuestion
type: Question
has body: I'm trying to create a nav bar which consists of the regular navigation elements and an indication bar which is located below the current page. My goal is to make this bar move under whichever element the user hovers on and automatically resize itself according to a pre-defined size (according to the word length maybe?). I built the nav bar itself, but I'm kind of clueless how to achieve this effect. Should I always calculate the current position of the mouse and add the difference between the current location and the hover location? Regarding to the resizability, this is a secondary goal, less significant. This is what I've done so far: Html: apples bananas tomatos onions CSS: #nav_ul a{ color: #685e6d; text-decoration: none; display: inline-block; -webkit-transition: color 0.4s ease-in-out; -moz-transition: color 0.4s ease-in-out; -ms-transition: color 0.4s ease-in-out; -o-transition: color 0.4s ease-in-out; transition: color 0.4s ease-in-out; } #nav_ul{ display: inline-block; list-style-type: none; } #nav_ul li{ display: inline-block; position: relative; left: 90px; bottom: 30px; font-size: 19px; margin-left: 40px; font-weight: 100; font-size: 16px; } #nav_ul a:hover{ color: #4ad1fd; } #container{ position: relative; left: 167px; height: auto; width: 530px; top: 5px; } #bar{ position: absolute; left: 0; bottom: 0; height: 7px; width: 107px; background-color: #ffcc00; border-radius: 3px; } JSfiddle Something like in this image:
has comment: http://stackoverflow.com/comment/47918430
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29897898
answer count: 3
has comment: http://stackoverflow.com/comment/47918448
tagged with: http://stackoverflow.com/tag/html
tagged with: css
possible better answer: http://stackoverflow.com/a/29898279

http://stackoverflow.com/comment/48031592
has text: the comma operant is valid "The comma operator chains multiple expressions together, and the result of the operation is the value of the last operand. The only real use for it is when you need multiple side effects to occur, such as assignment or function calls."
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29955313
score: 1

http://stackoverflow.com/comment/48058359
type: AnswerComment
type: Comment
has text: Thank you for your fast answer, i didn't know for the return false and i did try with preventDefault but i didn't prevent on the right call (i did on .call instead of the listerner.. awfull :D) Thanks again! (you were too fast, i can't accept the answer right know, i will asap :))
score: 0
comment on: http://stackoverflow.com/a/29969242

http://stackoverflow.com/q/29986696
type: Question
tagged with: database
tagged with: javascript
has title: JavaScript form submit to database using Ajax and Laravel route
answer count: 2
has answer: http://stackoverflow.com/a/29988932
has answer: http://stackoverflow.com/a/29987409
downvote count: 0
favorite count: 0
tagged with: ajax
has body: I'm making a quiz website using Laravel, Javascript and Ajax and I made an add form function with JavaScript like this: But I want to send the form data (to create a new quiz question) into my Laravel QuizController route using Ajax, after the focus on the form is lost or after an enter.. But I can't figure out how to do it. My JavaScript/Ajax: var limit = 1; var count = 0; var myButton = document.getElementById('myButton'); var container = document.getElementById('container'); function createQuestion() { if(count &lt; limit) { var input = document.createElement("input"); input.type = 'text'; input.id = ''; input.setAttribute('class', 'form-control') container.appendChild(input); count++; } else { alert ('Enter this question first before you can add another question!'); } } function storeQuestion() { var xmlhttp; if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 &amp;&amp; xmlhttp.status==200) { // } } xmlhttp.open("GET","ajax_info.txt",true); xmlhttp.send(); } My Laravel.blade: &lt;div class="form-group"&gt; &lt;div id="container"&gt;&lt;/div&gt; &lt;/div&gt; {!! Form::button('Add Quiz', array('onclick' =&gt; 'createQuiz()', 'class' =&gt; 'btn btn-default', 'id' =&gt; 'myButton', 'value' =&gt; 'Add question')) !!} My QuestionController: public function store(Quiz $quiz) { $input = Input::all(); $input['quiz_id'] = $quiz-&gt;id; Question::create($input); return Redirect::route('quizzes.show', $quiz-&gt;slug)-&gt;with('message', 'Question created.'); } I hope someone can help me because I'm pretty stuck up with this problem for some time..
type: UnansweredQuestion
tagged with: php
tagged with: laravel
score: 1
linked to: http://stackoverflow.com/q/2577868
upvote count: 1

http://stackoverflow.com/comment/48106824
type: Comment
comment on: http://stackoverflow.com/a/29993383
has text: That was my first guess to Steve. I tried editing that value, but all it does is break the script :(
type: AnswerComment
score: 0

http://stackoverflow.com/comment/72430028
type: Comment
has text: You get the params, so look at those to determine what you want to send in the callback. The body of that function doesn't have to be a simple callback(null, 'success');
type: AnswerComment
comment on: http://stackoverflow.com/a/37345527
score: 0

http://stackoverflow.com/q/29989327
has title: how to append data returned from ajax call to a dynamically created div, among many divs of same class name
has comment: http://stackoverflow.com/comment/48099591
upvote count: 1
tagged with: php
has answer: http://stackoverflow.com/a/29989434
type: AnsweredQuestion
score: 1
type: Question
has comment: http://stackoverflow.com/comment/48097993
answer count: 1
has comment: http://stackoverflow.com/comment/48098069
downvote count: 0
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/29989434
favorite count: 0
tagged with: ajax
has body: How do I append data returned from ajax call to a dynamically created div, which is among many divs of the same 'class name' ? My HTML: <?php $connObj = new Connection(); $conn = $connObj->getConnection(); $sql = ("select * from posts "); $result = mysqli_query($conn, $sql); if ( $result ) { echo " "; $rowcount = mysqli_num_rows($result); for($i = 0; $i<$rowcount; $i++){ $row = mysqli_fetch_assoc($result); ?> <?php echo $row['title']." "; ?> <?php echo $row['description']." "; ?> //displaying comments dynamically <input type="button" value="comment" name="submit_comment" class="comm" data-id="<?php echo $present_id; ?>"> <?php $present_id = $row['id']; ?> My ajax call: When I append the data it's appended to all divs--but I want to append it only to the presently clicked div
has comment: http://stackoverflow.com/comment/48098041
has comment: http://stackoverflow.com/comment/48098008

http://stackoverflow.com/q/29907130
has title: How to extract coordinates from Google Maps link (PHP or Javascript)
has body: I have a google map link that looks like this: https://www.google.com/maps/place/Space+Needle/@47.620506,-122.349277,17z/data=!4m6!1m3!3m2!1s0x5490151f4ed5b7f9:0xdb2ba8689ed0920d!2sSpace+Needle!3m1!1s0x5490151f4ed5b7f9:0xdb2ba8689ed0920d How can I extract coordinates from it in PHP or Javascript to get an array: {47.620506, -122.349277}
answer count: 4
accepted answer: http://stackoverflow.com/a/29907484
has comment: http://stackoverflow.com/comment/47936833
has answer: http://stackoverflow.com/a/29907551
upvote count: 1
tagged with: php
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47937482
score: 1
has answer: http://stackoverflow.com/a/65700845
type: Question
tagged with: google-maps
downvote count: 0
has answer: http://stackoverflow.com/a/29907484
tagged with: javascript
favorite count: 0
possible better answer: http://stackoverflow.com/a/29907545
has answer: http://stackoverflow.com/a/29907545

http://stackoverflow.com/comment/48044315
type: Comment
comment on: http://stackoverflow.com/a/29948732
has text: I edited my response to use the $http. If you want to add more complicated logic then You should compose the RiskFacade service with a new factory for each endpoint.
type: AnswerComment
score: 0

http://stackoverflow.com/comment/47819939
type: QuestionComment
comment on: http://stackoverflow.com/q/29847063
has text: `onload` is non-standard event for xhr and is only documented to work in Firefox. Use `onreadystatechange` instead. See: https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest
score: 0
type: Comment

http://stackoverflow.com/comment/48062511
has text: @Musa, I have gone through the 'blob', it supports IE 10 and later versions. It doesn't support IE 9. I need it to support that also..
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29968518
score: 0

http://stackoverflow.com/a/29870171
score: 1
answers question: http://stackoverflow.com/q/29869961
downvote count: 0
type: Answer
upvote count: 1
has body: Do it this way. It should work. function continuePlease() { var at = document.getElementById("emailCheck").value.indexOf("@"); if (at == -1) { document.getElementById("invalidEmail").innerHTML = "Please enter a valid email."; } else { changeData(); } }

http://stackoverflow.com/comment/47973061
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29925133
has text: In that case there must be two different closures because there is no way for anyString to be reset. Is the code that creates `myClosure` run more than once?
type: AnswerComment

http://stackoverflow.com/comment/48059571
type: AnswerComment
comment on: http://stackoverflow.com/a/29969813
score: 0
type: Comment
has text: Thanks, a normal do while loop indeed works, I thought this would not. The callback is necessary because this loop is included in a function, which I edited in the original question. Could you maybe explain what the cb and err in the async.whilst parameters exactly are? This way, I can use them when necessary.

http://stackoverflow.com/q/29994864
has comment: http://stackoverflow.com/comment/48109222
score: 0
has title: Ignoring ' from javascript code, SQLite
tagged with: sqlite
answer count: 1
type: UnansweredQuestion
has body: I have a french category named piqûres d'insectes that I am pulling from a SQLite database. Unfortunately, the ' in the category keeps breaking my javascript code, as seen in my pictures where it turns my breadcrumbs into undefined (half the word is missing as well clearly from the apostrophe). Is there a way I can pull this as just text so it does not break my code? Javascript: function txSuccessListAddSymptoms(tx,results) { //console.log("Read Additional Symptoms success"); var category = getUrlVars().category; var mainsymptom = getUrlVars().mainsymptom; var len = results.rows.length; var addSymp; for (var i=0; i &lt; len; i = i + 1) { addSymp = results.rows.item(i); }; $('#addSymps').listview('refresh'); }
type: Question
has answer: http://stackoverflow.com/a/29994993
has comment: http://stackoverflow.com/comment/48123014
tagged with: javascript

http://stackoverflow.com/comment/48049769
score: 1
has text: you can use `required` property. which is available in the html5.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29964849

http://stackoverflow.com/comment/60993816
type: Comment
comment on: http://stackoverflow.com/a/29925654
score: 0
type: AnswerComment
has text: See Geoff McIver's answer below. This is a huge security risk if you don't want to expose write-access to your Stripe users through an unauthenticated cloudcode request.

http://stackoverflow.com/comment/47870069
score: 0
has text: "[*By default, it is `undefined`](http://expressjs.com/4x/api.html#req.body), and is populated when you use body-parsing middleware such as [body-parser](https://www.npmjs.org/package/body-parser) and [multer](https://www.npmjs.org/package/multer).*"
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29872443

http://stackoverflow.com/q/29929921
has body: I'm extending aurelia's get started app by adding custom moduls. I've got an error "Uncaught SyntaxError: Unexpected token :" while reading a json. But json validator doesn't find any errors. Here is my json { "news": [ { "title": "Lorem Ipsum is simply dummy text", "type": "news", "tags": [ "news", "fish", "loremipsumdolor" ], "text": "Lorem Ipsum is simply dummy text of the printing and typesetting industry." }, { "title": "Lorem Ipsum", "type": "news", "tags": [ "news", "fish" ], "text": "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s." } ] } And here is my module that tries to load that json (basically it's a copy-paste from flickr.js which can be found in example code) ` import {inject} from 'aurelia-framework'; import {HttpClient} from 'aurelia-http-client'; @inject(HttpClient) export class News{ heading = 'News'; items = []; url = '/res/data.json'; constructor(http){ this.http = http; } activate(){ debugger; return this.http.jsonp(this.url).then(response =&gt; { this.items = response.content.news; }); } canDeactivate(){ return confirm('Are you sure you want to leave?'); } } ' When example code is executed it loads json from flikr and wraps it in jsonp_callback_92661(). That's the only difference. May it be the root of my problem?
has answer: http://stackoverflow.com/a/29930550
accepted answer: http://stackoverflow.com/a/29930550
has title: Error during reading json in Aurelia.io example
tagged with: javascript
upvote count: 2
has comment: http://stackoverflow.com/comment/47983108
answer count: 1
favorite count: 0
linked to: http://stackoverflow.com/q/2067472
score: 2
type: AnsweredQuestion
downvote count: 0
tagged with: http://stackoverflow.com/tag/json
type: Question
tagged with: jsonp
tagged with: aurelia

http://stackoverflow.com/q/29912742
tagged with: birt
type: UnansweredQuestion
tagged with: https
type: Question
tagged with: safari
has body: My site is running on SSL. On one of the pages I am calling an external javascript required for integration of Birt iHub into our application. The iHub application is running separately on of o our servers and javascript also resided in same application. Now when I try to acces the javascript without SSL it is blocked as my site is running on SSL. So I also put the iHub app on SSL so tha my website communcate with javascript over SSL. Now it works fine for both Chrome, Firefox and IE but in case of Safari it worked for few days then suddely an SSL error shows up. I have delete the SSL certificates from cache and the access the site again and IT worked again but afeter some days same issue occurs. AndI have to delte it again to make it work. Can anyone tell me whay this is happening and what could be done to avoid this
has comment: http://stackoverflow.com/comment/47958722
tagged with: ssl
has comment: http://stackoverflow.com/comment/48018544
tagged with: javascript
score: 0
has title: Safari SSL certificate issue and external javascript
answer count: 0

http://stackoverflow.com/q/29888878
has title: how do you use virtual-dom gist in browser?
upvote count: 2
has comment: http://stackoverflow.com/comment/50573213
tagged with: javascript
favorite count: 0
score: 2
answer count: 0
downvote count: 0
type: UnansweredQuestion
tagged with: git
type: Question
has body: https://github.com/Matt-Esch/virtual-dom uses require() to load scripts, how do I set this up if I want to use virtual-dom from the browser? I tried including RequireJS [https://github.com/jrburke/requirejs] to do the require() handling but it removes all the script elements in my body. The alert never happens. &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;meta http-equiv="content-type" content="text/html; charset=UTF-8"&gt; &lt;script src="https://raw.githubusercontent.com/volojs/create-template/master/www/lib/require.js"/&gt; &lt;/head&gt; &lt;body&gt; &lt;script&gt; &lt;!-- this script block gets removed by requireJS --&gt; alert(1); // from the example at https://github.com/Matt-Esch/virtual-dom var h = require('virtual-dom/h'); var diff = require('virtual-dom/diff'); var patch = require('virtual-dom/patch'); var createElement = require('virtual-dom/create-element'); // 1: Create a function that declares what the DOM should look like function render(count) { return h('div', { style: { textAlign: 'center', lineHeight: (100 + count) + 'px', border: '1px solid red', width: (100 + count) + 'px', height: (100 + count) + 'px' } }, [String(count)]); } &lt;/script&gt; &lt;/body&gt; &lt;/html&gt;
tagged with: dom

http://stackoverflow.com/a/29899103
answers question: http://stackoverflow.com/q/29899011
has comment: http://stackoverflow.com/comment/47922378
upvote count: 3
has body: If you don't have this markup in DOM yet, just this is enough: var html = " "+ " "+ " "+ " "+ " "+ " " var childs = document.getElementById('childs') childs.innerHTML = childs.innerHTML + html If you need to continuously add checkboxes to childs (better call it children really) you do not want to do that and want to do appendChild(checkbox) you can add hidden tag somewhere on the page and use it. See markup: content add and code: var btn = document.getElementById('btn') , children = document.getElementById('children') , cb = document.getElementById('cb') btn.addEventListener('click', add) function add() { var n = cb.cloneNode(true) n.style.display = ''; children.appendChild(n) } See jsfiddle Be advised though, you are using id attribute in your "template" thus after multiple inserts you are going to have multiple elements with the same id. You probably need to update that and/or use only name attribute. Otherwise you can query DOM for that child node and inset it with one appendChild call.
accepted answer of: http://stackoverflow.com/q/29899011
type: Answer
has comment: http://stackoverflow.com/comment/47921207
has comment: http://stackoverflow.com/comment/47921686
has comment: http://stackoverflow.com/comment/47922048
score: 3
downvote count: 0
has comment: http://stackoverflow.com/comment/47921426
has comment: http://stackoverflow.com/comment/47921114
has comment: http://stackoverflow.com/comment/47922499
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47921876

http://stackoverflow.com/comment/48015916
has text: smart solution but If I have some files with underscore in filename this doesn't works.
type: Comment
comment on: http://stackoverflow.com/a/29947440
score: 0
type: AnswerComment

http://stackoverflow.com/a/29988316
answers question: http://stackoverflow.com/q/29988132
has comment: http://stackoverflow.com/comment/48099733
has comment: http://stackoverflow.com/comment/48100124
has body: According to the w3c spec (emphasis mine): The value must be unique amongst all the IDs in the element's home subtree and must contain at least one character. The value must not contain any space characters. JS is irrelevant in this case. Valid HTML must not include duplicate IDs. If you simply want to associate data or manage identifiers differently, you must use a different attribute. I recommend using [data-*] attributes, especially because you can access them via the dataset API: 0 1 2 3
has comment: http://stackoverflow.com/comment/48223360
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/48223199
type: Answer
score: 2
accepted answer of: http://stackoverflow.com/q/29988132
upvote count: 2

http://stackoverflow.com/a/64212144
answers question: http://stackoverflow.com/q/29977772
has body: If you want to replace with regular html tags and restrict to only specific BB tags. This is how it's done with a little help from jQuery and Regular Expression: const replaceBBCodeAsElements = (jElement, tagMapping = {}) => jElement.html(jElement.html().replace(/\[(?<tag>\w+)\](.+?)\[\/\k<tag>\]/g, (...{ 0: original, 1: tagName, 2: tagContent }) => tagMapping.hasOwnProperty(tagName) ? $(tagMapping[tagName]).html(tagContent)[0].outerHTML : original )); And here is an example of using this function: const replaceBBCodeAsElements = (jElement, tagMapping = {}) => jElement.html(jElement.html().replace(/\[(?<tag>\w+)\](.+?)\[\/\k<tag>\]/g, (...{ 0: original, 1: tagName, 2: tagContent }) => tagMapping.hasOwnProperty(tagName) ? $(tagMapping[tagName]).html(tagContent)[0].outerHTML : original )); const config = { 'a': ' ', 'object': '', 'pre': ' ', 'test': ' ', }; $("#input").bind("input", function() { const jRes = $("#result"); jRes.text(this.value); replaceBBCodeAsElements(jRes, config); }).trigger('input'); #input { width: 400px; height: 100px; } #result { white-space: pre-wrap; } .tag { display: inline-block; background: rgba(0,0,0,.1); padding: 0 4px; border-radius: 5px; font-family: monospace; font-weight: bold; margin: 0; box-shadow: 0 0 10px 0 rgba(0,0,0,.6); } .some-special-a-tag { background: rgba(255,0,0,.1); } .some-special-object-tag { background: rgba(0,255,0,.1); } .some-special-pre-tag { background: rgba(0,0,255,.1); } .some-special-test-tag { background: rgba(0,255,255,.1); } This is a [a]test[/a] text [pre]with[/pre] [b]some[/b] va[test]lu[/test]e. And this is how it looks [object]when a [pre]tag inside[/pre] other[/object] tag The above example, will parse only [a], [object], [pre] and [test] BB tags and convert them according to the creation element they are pointing to. Note, that the minimum required version of JS is ES2018, because of the RegExp Named Group support.
score: 0
type: Answer

http://stackoverflow.com/a/29897413
has comment: http://stackoverflow.com/comment/70883516
has comment: http://stackoverflow.com/comment/47936963
has comment: http://stackoverflow.com/comment/47918209
downvote count: 0
has comment: http://stackoverflow.com/comment/47937479
has comment: http://stackoverflow.com/comment/47918725
has body: In your CSS add the following rule: body.modal-open { overflow: hidden; } Also, use some jQuery so that when modal is open you add .modal-open class to &lt;body&gt; tag, and when it is closed you remove it. $("#myModal").on("show", function () { $("body").addClass("modal-open"); }).on("hidden", function () { $("body").removeClass("modal-open") });
has comment: http://stackoverflow.com/comment/47918365
answers question: http://stackoverflow.com/q/29897300
type: Answer
score: 14
has comment: http://stackoverflow.com/comment/47918895
upvote count: 14

http://stackoverflow.com/comment/47887421
has text: I found a mistype in your JavaScript code: choise1 instead of choice at line 34
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29881622
score: 0

http://stackoverflow.com/q/29878771
type: Question
has comment: http://stackoverflow.com/comment/47881677
tagged with: restful-url
tagged with: javascript
has title: AngularJS Controller Error - : $http.get is not a function in controller section
answer count: 1
downvote count: 0
has body: var hsbc = angular.module('hsbc',['ngResource','ngRoute']); hsbc.config(['$routeProvider','$locationProvider', function ($routeProvider, $locationProvider){ //console.log('config part working'); $routeProvider .when('/login', { controller: 'hsbccontroller', templateUrl: 'modules/authentication/views/login.html', hideMenus: true }) .when('/gloabltranfer', { controller: 'hsbccontroller', templateUrl: 'modules/home/views/gloabltranfer.html' }) .when('/tranferReq', { controller: 'hsbccontroller', templateUrl: 'modules/home/views/TransferRquest.html' }) .when('/reviewdetail', { controller: 'hsbccontroller', templateUrl: 'modules/home/views/Reviewdetails.html' }) .when('/confirmdetail', { controller: 'hsbccontroller', templateUrl: 'modules/home/views/confirmdetails.html' }) .when('/', { controller: 'hsbccontroller', templateUrl: 'modules/authentication/views/login.html' }) .otherwise({ redirectTo: '/login' }); }]).controller('hsbccontroller', ['$scope','$http','$resource', function($scope,$resource,$http){ //console.log('controller part working'); $http.get('http://localhost:8080/1/').success(function(data) { alert(data); $scope.greeting = data; }); }]);
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
tagged with: ngresource
has answer: http://stackoverflow.com/a/29878852
has comment: http://stackoverflow.com/comment/47881597
has comment: http://stackoverflow.com/comment/47881586
score: 7
upvote count: 7

http://stackoverflow.com/q/29970786
tagged with: d3.js
has comment: http://stackoverflow.com/comment/48246597
type: UnansweredQuestion
has body: I want to change the default color of multiBarAndStack. i try to use this code but there is no change please someone help me, this is the code that i used: d3.selectAll("nv-bar positive") .style("fill", function(d, i){ return d.y &gt; 50 ? "red":"blue"; });
has title: How to customize color in multiBarAndStack chart of NVD3
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/48075836
score: 0
tagged with: bar-chart
answer count: 0
tagged with: nvd3.js

http://stackoverflow.com/comment/48098736
comment on: http://stackoverflow.com/q/29989647
type: Comment
type: QuestionComment
has text: yeah its suppose to work but is not.. im using datatables plugin and im building my table dynamically
score: 0

http://stackoverflow.com/q/29860734
has title: Specify range of numbers based on the selected number
accepted answer: http://stackoverflow.com/a/29860823
has comment: http://stackoverflow.com/comment/47847289
type: AnsweredQuestion
score: 3
possible better answer: http://stackoverflow.com/a/29860819
has answer: http://stackoverflow.com/a/29860964
downvote count: 0
type: Question
has answer: http://stackoverflow.com/a/29860824
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47847306
upvote count: 3
has answer: http://stackoverflow.com/a/29860819
has comment: http://stackoverflow.com/comment/47847271
favorite count: 0
answer count: 5
has answer: http://stackoverflow.com/a/29860965
has body: When the user select a number 1000243, I want another option to range 200 numbers from that inputed number. SO it would be: //User Input Number Here 1000243 //Automatically Generate 200 Number Range 1000244 ...INTO... 1000443 OR, the user select a number of 4500123, so another option would range 200 numbers start from 4500124 to 4500323: //User Input Number Here 4500123 //Automatically Generate 200 Number Range 4500124 ...INTO... 4500324 One thing is that the manual number user choose is in a dropdown option on select. How to do this? Thanks in advance.
has answer: http://stackoverflow.com/a/29860823

http://stackoverflow.com/q/29855614
type: Question
tagged with: javascript
tagged with: ionic-framework
has answer: http://stackoverflow.com/a/29860498
score: 0
answer count: 1
has body: The Ionic framework customizes the looks of its features according to which plataform is running the app, Android or iOS, but I know it also has a third look that is unique to Ionic. My question is, is there a way to specify how and especific feature should look like? Like if I want Popovers to look Android style and Action Sheets to look iOS style, all in the same app, no matter to which platform the app is been build? There has to be a way, otherwise there wouldn't be an Ionic style for things, like in this example: http://codepen.io/ionic/pen/GpCst I have tried the setPlatform function like the example without success. $scope.setPlatform = function(p) { document.body.classList.remove('platform-ios'); document.body.classList.remove('platform-android'); document.body.classList.add('platform-' + p); $scope.demo = p; }
tagged with: angularjs
type: UnansweredQuestion
has title: How to specify Ionic features look style?

http://stackoverflow.com/comment/82045410
type: Comment
has text: I imagine it was fastest as proven back in 2015 (ignoring ES6 to allow things to work in IE also, and Rick Edwards just posted 19 days ago), but given browser optimizations, etc., over the years things are bound to change - especially if native calls are used, but (as you pointed out) not necessarily better in memory management for very large nested arrays. If I needed something similar for use in a game engine, I know which one I'd choose. ;) (in fact, this is actually what I use for a WebGL based simulation graph tree in order to flatten the hierarchy and cache it with very low GC overhead)
comment on: http://stackoverflow.com/a/29991836
score: 0
type: AnswerComment

http://stackoverflow.com/comment/47835038
score: 0
has text: then that is your problem. the variable you are using is not an array. the push function you are trying to use is related to an array object.
type: AnswerComment
comment on: http://stackoverflow.com/a/29854397
type: Comment

http://stackoverflow.com/q/29914167
favorite count: 0
accepted answer: http://stackoverflow.com/a/29916628
tagged with: while-loop
upvote count: 2
has answer: http://stackoverflow.com/a/29914260
has title: using an if statement inside a while loop
score: 2
type: AnsweredQuestion
tagged with: if-statement
has answer: http://stackoverflow.com/a/29916628
has answer: http://stackoverflow.com/a/29914203
answer count: 6
has answer: http://stackoverflow.com/a/29914416
type: Question
has body: I just figured out how to test for certain conditions and modify output within a loop. But I noticed that testing for two conditionals with the &amp;&amp; operator only works in an if/else if/else if/else chain if it's the first one tested for. Can someone explain why this works: var number = 0; var counter = 0; while (counter &lt; 100) { number ++; counter ++; if (number % 3 == 0 &amp;&amp; number % 5 == 0) console.log ("FizzBuzz"); else if (number % 3 == 0) console.log("Fizz"); else if (number % 5 == 0) console.log("Buzz"); else console.log(number); } But this does not?: var number = 0; var counter = 0; while (counter &lt; 100) { number ++; counter ++; if (number % 3 == 0) console.log("Fizz"); else if (number % 5 == 0) console.log("Buzz"); else if (number % 3 == 0 &amp;&amp; number % 5 == 0) console.log ("FizzBuzz"); else console.log(number); }
has answer: http://stackoverflow.com/a/29914299
downvote count: 0
has answer: http://stackoverflow.com/a/29914201
tagged with: javascript
possible better answer: http://stackoverflow.com/a/29914416

http://stackoverflow.com/a/33529381
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29872387
accepted answer of: http://stackoverflow.com/q/29872387
type: Answer
downvote count: 0
score: 1
has body: The situation described is likely not the best way to solve your problem in Angular. I am assuming that this is written inside of a controller. If so, making a call to a backend service is best done with the $http service. To do so, controller.js angular.module('example') .controller(['$scope', '$http', '$window', function($scope, $http, $window) { $scope.socialLogin = function(urlEnd) { $http.get(urlBase + '/' + urlEnd) // Should probably be posting here... .then(function(res) { // Your JSON response here $scope.doSomethingWithTheResponse(res.data); }, function(err) { // Handle your error $window.alert("We got us an error!\n" + JSON.stringify(err)); }); } }])
upvote count: 1

http://stackoverflow.com/q/29920404
has answer: http://stackoverflow.com/a/29921074
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json
downvote count: 1
type: Question
upvote count: 0
tagged with: jsp
has title: Dynamically populate Dropdown value and text using ajax json call
tagged with: javascript
tagged with: jquery
score: -1
accepted answer: http://stackoverflow.com/a/29921074
tagged with: ajax
has body: I want to dynamically populate a dropdown list text and value using an ajax call to retrieve a JSONObject. My code populates the dropdown correctly but I want the value to be different from the text because I want to save the id in my database rather than the name. This is my code: function get_landlords(){ $.ajax({ url: "get_landlord_list.jsp", dataType: "json", success: function(data){ var options, index, select, option; select = document.getElementById("landlord"); select.options.length = 0; options = data.data; for(index = 0; index &lt; options.length; ++index){ option = options[index]; if(option.company_name !== null){ select.options.add(new Option(option.landlord)); } } } }); } &lt;select name="landlord" id="landlord" class="form-control" onfocus="javascript:get_landlords();"&gt; &lt;option value="-1" name="-" selected&gt;-&lt;/option&gt; &lt;/select&gt; My json is as follow: 0: {landlord: "John Doe", id: 6} 1: {landlord: "John Doe", id: 4} 2: {landlord: "John Doe", id: 1} 3: {landlord: "John Doe", id: 3} Anyone have a solution?
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/47962192

http://stackoverflow.com/comment/47986280
score: 0
type: AnswerComment
type: Comment
has text: dave provided solution only thing I need now is to regex match every link with # at the end..
comment on: http://stackoverflow.com/a/29931181

http://stackoverflow.com/q/29929507
tagged with: jquery
tagged with: asp.net
has body: I'm creating a dynamic menu that fetches dishes from a database and displays them to the user so he can add them to his order. Whenever I retrieve a row from the database I send it to my menuItems class so the columns can be read and the display format is created and inserted into a cell: foreach (DataRow dr in drc){ //extract the dish data from the row into a cell TableCell c1 = menuItem.makeItemCell(dr); //display it tr.Controls.Add(c1); table1.Controls.Add(tr); } c1 will be a cell that has the dish information along with a quantity dropdownlist and an "add to order" button: public static TableCell makeItemCell(DataRow dr) { TableCell tc = new TableCell(); Image img = new Image(); img.ImageUrl = (string)dr["img"]; tc.Controls.Add(img); //rest of information adding is omitted for brevity String myLiteral = "&lt;p&gt;" + "Name: " + (string)dr["NameofDish"] + "&lt;/br&gt;"; tc.Controls.Add(new LiteralControl(myLiteral)); //add quantity label and dropdownlist populated with possible quantity values Label lb = new Label(); lb.Text = "Quantity: "; DropDownList ddl = new DropDownList(); for (int i = 0; i &lt; 13; i++) { String t = i.ToString(); ddl.Items.Add(new ListItem(t, t)); } //create the add to order button Button btn = new Button(); btn.Text = "Add to order"; tc.Controls.Add(lb); tc.Controls.Add(ddl); tc.Controls.Add(btn); return tc; } My problem is with handling the button click event. All my tries to bind it with an event handler (on the menuItems class or the codebehind itself) have failed. I could only manage to update the postbackURL of the button when it's created in the cell like this btn.PostBackUrl = "./menu.aspx?dish=" + (string)dr["ID"] + "&amp;quantity=" + ddl.SelectedValue; But the .selectedvalue value is rendered when the cell is created hence is always 0 My question is this: how can I handle the button click event in a way that I can get hold of the dishID and the selected value. ((((I would prefer an event handling solution rather than querystrings…
type: UnansweredQuestion
answer count: 0
linked to: http://stackoverflow.com/q/1085801
has comment: http://stackoverflow.com/comment/47981469
type: Question
tagged with: c#
has comment: http://stackoverflow.com/comment/47981427
tagged with: javascript
has title: Get selected value from externally created dropdownlist
score: 0

http://stackoverflow.com/q/29852040
tagged with: callback
type: UnansweredQuestion
has title: Is it possible to add callback to addEvenlistener?
type: Question
has answer: http://stackoverflow.com/a/29852615
has body: I have a question, I want know if is a possible do something like this: document.getElementById('button'). addEventListener('mousedown', myCallback.bind(myCallback2)); function myCallback(e, cb){ var data=5; cb(data) //alert("Hello from Callback"); } function myCallback2(a){ console.log(a)//show 5 } I know of javascript, but not so do some like this: I CAN SOLVED IT :) with BIND() the form that i want no, but i can example: document.getElementById('button'). addEventListener('mousedown', myCallback.bind({cb2:myCallback2, btn:this})); function myCallback(ev){ var elem=this.btn, cb=this.cb2, var data=5; cb(data) } function myCallback2(a){ console.log(a)//show 5 }
tagged with: javascript
score: 0
answer count: 1

http://stackoverflow.com/q/29927228
tagged with: extjs
favorite count: 0
downvote count: 0
score: 2
type: AnsweredQuestion
tagged with: extjs4.1
type: Question
upvote count: 2
has title: How to display total in Donut hole in Ext js Pie Chart
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/29927555
accepted answer: http://stackoverflow.com/a/29927555
has body: How to display total in donut hole of my pie chart ? Here is my example code Ext.onReady(function() { var store = Ext.create('Ext.data.JsonStore', { fields: ['name', 'data'], data: [{ 'name': 'metric one', 'data': 10 }, { 'name': 'metric two', 'data': 7 }, { 'name': 'metric three', 'data': 5 }, { 'name': 'metric four', 'data': 2 }, { 'name': 'metric five', 'data': 27 }] }); Ext.create('Ext.chart.Chart', { renderTo: Ext.getBody(), width: 500, height: 350, animate: true, store: store, theme: 'Base:gradients', series: [{ type: 'pie', angleField: 'data', showInLegend: true, donut: 40, tips: { trackMouse: true, width: 140, height: 28, renderer: function(storeItem, item) { // calculate and display percentage on hover var total = 0; store.each(function(rec) { total += rec.get('data'); }); this.setTitle(storeItem.get('name') + ': ' + Math.round(storeItem.get('data') / total * 100) + '%'); } } }] }); }); Here is my output How to display the total in donut hole

http://stackoverflow.com/comment/48054439
score: 0
has text: done! I still have some issues, so could you consider checking out this thread http://stackoverflow.com/questions/29967481/is-it-possible-to-quicksort-objects-in-an-array-based-on-a-property-javascript
comment on: http://stackoverflow.com/a/29966218
type: Comment
type: AnswerComment

http://stackoverflow.com/comment/48102917
comment on: http://stackoverflow.com/q/29991742
score: 5
type: Comment
type: QuestionComment
has text: @ProgramFOX in the old days this was true, nowadays they also compile to byte code

http://stackoverflow.com/comment/47859176
comment on: http://stackoverflow.com/q/29863915
type: Comment
type: QuestionComment
has text: for example.. distance between three cities
score: 0

http://stackoverflow.com/a/29976340
accepted answer of: http://stackoverflow.com/q/29976068
answers question: http://stackoverflow.com/q/29976068
upvote count: 1
score: 1
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/48072373
type: Answer
has body: It is because keyListen is called on every requestAnimationFrame. The window event listeners are building up, adding on top of eachother. Every time $(window).keydown(fn) is called, the prior event listeners do not go away. Now if I press a button, several hundred event listeners will fire. Move the call to keyListen() out of update and only call it once. I moved it into init like this, and it works fine: function init(){ requestAnimationFrame(update); keyListen(); } function update(){ // clearCanvas(); context.clearRect(0,0,this.width,this.height); sizeCanvas(); player(); this.maze = new Maze(this.context); this.maze.render(); requestAnimationFrame(update); }

http://stackoverflow.com/a/29970678
type: Answer
has body: As Bergi has already noted, you are not doing anything asynchronous and do not need to use whilst at all. I'll further address your specific confusion about how whilst works, however. The second argument to whilst is a function that may perform asynchronous operations. whilst has no way of knowing when the function is "done" with everything it needs to do. The callback parameter is a way to signal to whilst that this function has fully completed all its tasks, and whilst can proceed to the next iteration. Suppose we want to make a series console message each one second apart. (This is a pretty contrived example, but I can't think of a natural example that's easier to explain.) var i = 0; async.whilst( function(){ return i &lt; 5; }, function(cb) { setTimeout(function() { console.log(i++); cb(); }, 1000); }, function(err) { console.err("we encountered an error", err); } ); In this case, we call setTimeout and then whilst does not execute the next iteration until the cb() is called in the setTimeout resolution. If whilst ran the next iteration as soon as the function terminated, all the setTimeout calls would be queued up at the same time, rather than running on second after another. Instead, it waits until the function calls cb(). Since you never call cb() in your code, whilst just assumes that the function has dispatched an async task that is taking a very long time. whilst will not run the next iteration until that first function call confirms that it is done by calling cb(). A call to cb() with no arguments signals that the function completed its tasks with no problems. If the function finished with an error (couldn't read a file, couldn't access a network resource), then you can supply that error as an argument to cb (e.g. cb(new Error("could not reach the server"));) and the error will be supplied to the whilst's third function argument.
has comment: http://stackoverflow.com/comment/48091266
accepted answer of: http://stackoverflow.com/q/29969647
score: 3
answers question: http://stackoverflow.com/q/29969647
has comment: http://stackoverflow.com/comment/48084994
type: AcceptedAnswer
downvote count: 0
upvote count: 3
has comment: http://stackoverflow.com/comment/101293743

http://stackoverflow.com/comment/47864476
type: Comment
has text: Invest in learning `jQuery`. I was once afraid of `jQuery` but I finally gave up and just started to use it. It is very clean and easy to use and the support on the web (and SO :-) is fantastic.
type: QuestionComment
comment on: http://stackoverflow.com/q/29869627
score: 0

google-maps-api-3
tags question: http://stackoverflow.com/q/29927587
tags question: http://stackoverflow.com/q/29903654
tags question: http://stackoverflow.com/q/29957531
tags question: http://stackoverflow.com/q/29982289
tags question: http://stackoverflow.com/q/29896096
tags question: http://stackoverflow.com/q/29875680
tags question: http://stackoverflow.com/q/29975618
tags question: http://stackoverflow.com/q/29869261
tags question: http://stackoverflow.com/q/29993228
tags question: http://stackoverflow.com/q/29915375
tags question: http://stackoverflow.com/q/29893569
tags question: http://stackoverflow.com/q/29980598
tags question: http://stackoverflow.com/q/29848267
tags question: http://stackoverflow.com/q/29948146
tags question: http://stackoverflow.com/q/29939453
tags question: http://stackoverflow.com/q/29963630
tags question: http://stackoverflow.com/q/29947600
tags question: http://stackoverflow.com/q/29855087
tags question: http://stackoverflow.com/q/29898103
tags question: http://stackoverflow.com/q/29962306
tags question: http://stackoverflow.com/q/29925525
tags question: http://stackoverflow.com/q/29962534
tags question: http://stackoverflow.com/q/29969829
tags question: http://stackoverflow.com/q/29973816
tags question: http://stackoverflow.com/q/29849691
tags question: http://stackoverflow.com/q/29887950
tags question: http://stackoverflow.com/q/29855261
tags question: http://stackoverflow.com/q/29973477
tags question: http://stackoverflow.com/q/29863915
tags question: http://stackoverflow.com/q/29899667
tags question: http://stackoverflow.com/q/29992503
tags question: http://stackoverflow.com/q/29938041
tags question: http://stackoverflow.com/q/29859054
tags question: http://stackoverflow.com/q/29970234
tags question: http://stackoverflow.com/q/29892438
tags question: http://stackoverflow.com/q/29937624
tags question: http://stackoverflow.com/q/29974566
tag name: google-maps-api-3
tags question: http://stackoverflow.com/q/29975448
tags question: http://stackoverflow.com/q/29846241
tags question: http://stackoverflow.com/q/29958870
type: Tag
tags question: http://stackoverflow.com/q/29955653
tags question: http://stackoverflow.com/q/29886129
tags question: http://stackoverflow.com/q/29854755
tags question: http://stackoverflow.com/q/29862125
tags question: http://stackoverflow.com/q/29903273
tags question: http://stackoverflow.com/q/29849041
tags question: http://stackoverflow.com/q/29870420
tags question: http://stackoverflow.com/q/29928942
tags question: http://stackoverflow.com/q/29948926
tags question: http://stackoverflow.com/q/29943112
tags question: http://stackoverflow.com/q/29962883
tags question: http://stackoverflow.com/q/29877874
tags question: http://stackoverflow.com/q/29978100
tags question: http://stackoverflow.com/q/29980862

http://stackoverflow.com/comment/47989654
comment on: http://stackoverflow.com/q/29925637
type: Comment
type: QuestionComment
has text: You will get the error "createSVGMatrix is not a function" if `this.svg`is null, or if it points to something that is not an `SVGSVGElement` object. Check that you are not trying to initialise something before it is loaded or the DOM is ready.
score: 0

http://stackoverflow.com/q/29955982
type: Question
tagged with: syntax-error
upvote count: 0
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/48032993
has comment: http://stackoverflow.com/comment/48032806
has title: document.write with img src
type: UnansweredQuestion
downvote count: 2
has answer: http://stackoverflow.com/a/29956037
score: -2
tagged with: javascript
tagged with: document.write
has body: document.write("&lt;img src='" + imgNumber + ".png' alt="' /&gt; ") ; I get a syntax error with this code. "Insert a command that writes this text img src='imgNumber.png' alt='' /> where imgNumber is the value of the imgNumber variable."

http://stackoverflow.com/a/29871349
has body: This is one way you could accomplish what it looks like you're trying to do: function Sprite( spriteX, spriteY, spriteW, spriteH, scale, positionX, positionY, direction ) { this.imagePath = world_sprite; this.spriteX = spriteX; this.spriteY = spriteY; this.spriteW = spriteW; this.spriteH = spriteH; this.scale = scale; this.positionX = positionX; this.positionY = positionY; this.direction = direction; this.speed = 5; this.noGravity = false; this.direction = 0; //Physics stuff this.velX = 0; this.velY = 0; this.friction = 0.98; }; function World( posX, posY, direction, xOffset, yOffset ) { Sprite.call( this, 0, 0, 400, 400, 0.4, posX, posY, direction ); this.xOffset = xOffset; this.yOffset = yOffset; this.lives = 3; };
answers question: http://stackoverflow.com/q/29871261
type: AcceptedAnswer
score: 1
accepted answer of: http://stackoverflow.com/q/29871261
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/47867668
downvote count: 0

http://stackoverflow.com/comment/47858252
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29864482
has text: What kind of WCF service - REST or SOAP? If it's SOAP, you will have a lot of work cut out for you.
score: 0

http://stackoverflow.com/a/29951629
has body: Since you are using jQuery, you can use text() to alter the contents of an existing div (which id is "yourDiv"): setInterval("checkGold()",5000); function checkGold() { $.ajax({ url: 'scripts/checkGold.php', data: "", dataType: 'json', success: function(response){ $('div#yourDiv').text(response); } }); };
answers question: http://stackoverflow.com/q/29951417
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/48025598

http://stackoverflow.com/comment/48041633
has text: I've editted my post
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29959660
score: 0

http://stackoverflow.com/comment/48020055
type: AnswerComment
type: Comment
score: 1
has text: I have an object with about 100 properties. Is there an easier way?
comment on: http://stackoverflow.com/a/29949593

timer
tag name: timer
tags question: http://stackoverflow.com/q/29916797
type: Tag
tags question: http://stackoverflow.com/q/29978674
tags question: http://stackoverflow.com/q/29871971
tags question: http://stackoverflow.com/q/29953271
tags question: http://stackoverflow.com/q/29904299
tags question: http://stackoverflow.com/q/29973200

http://stackoverflow.com/comment/47996896
has text: You don't have to refresh the whole table. Just the rows that are modified. You can assign a generated UUID id for each cell or column or row and update them individually.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29919028

http://stackoverflow.com/q/29898734
tagged with: http://stackoverflow.com/tag/html
has title: I have the JS script that makes one div disappear when showing another one. How to add fadein effect?
tagged with: css
type: Question
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29898829
possible better answer: http://stackoverflow.com/a/29898814
has answer: http://stackoverflow.com/a/29898814
has answer: http://stackoverflow.com/a/29898911
answer count: 3
has comment: http://stackoverflow.com/comment/47920376
has body: Here's my jsfiddle. The script itself is here: $(function () { $(".div1, .div2").hide(); $(".link1, .link2").bind("click", function () { $(".div1, .div2").hide(); if ($(this).attr("class") == "link1") { $(".div1").show(); } else { $(".div2").show(); } }); }); How can I add smooth fadein effect when one div disappears and the other one shows up? Thanks!
tagged with: javascript
tagged with: jquery
score: 0
has answer: http://stackoverflow.com/a/29898829

http://stackoverflow.com/a/29878424
has body: Your html code, more specifically, property value of li is not a valid JSON. Replace this: Item Two With this: Item Two Valid json format is a string quoted.
downvote count: 0
type: Answer
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/29878310

http://stackoverflow.com/q/29926677
has answer: http://stackoverflow.com/a/29927024
tagged with: javascript
score: 0
answer count: 3
linked to: http://stackoverflow.com/q/1184624
tagged with: jquery
has comment: http://stackoverflow.com/comment/47975360
has title: Javascript - Convert Name:ItemName/Value:ItemValue Objects to Regular ItemName:ItemValue JSON
type: AnsweredQuestion
has body: I have JSON data that looks like this: [{"name":"age","value":31}, {"name":"height (inches)","value":62}, {"name":"location","value":"Boston, MA"}, {"name":"gender","value":"male"}] I need it to look like this instead: [{"age": 31}, {"height (inches)": 62}, {"location": "Boston, MA"}, {"gender": "male"}] This is for a jQuery web app. How would I go about this conversion? Not picky about how it gets done, just having trouble finding an existing solution. Thanks!
has comment: http://stackoverflow.com/comment/47975154
has comment: http://stackoverflow.com/comment/47975613
has answer: http://stackoverflow.com/a/29926849
has answer: http://stackoverflow.com/a/29926858
has comment: http://stackoverflow.com/comment/47976831
type: Question
possible better answer: http://stackoverflow.com/a/29927024
has comment: http://stackoverflow.com/comment/47975404
tagged with: http://stackoverflow.com/tag/json
accepted answer: http://stackoverflow.com/a/29926858

http://stackoverflow.com/a/39548147
has body: Had the same problem and checked jquery version. Moving to v1.12 helped me
type: Answer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/29910823
upvote count: 1

http://stackoverflow.com/comment/47920878
has text: Are you sure that you're using insertText and not insertHtml? This result is rather impossible with insertText unless some other things happen.
comment on: http://stackoverflow.com/q/29893852
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/48053708
type: AnswerComment
type: Comment
has text: Try replacing form.onsubmit... with document.getElementById('form1').onsubmit..., and add an id="form1" to your form tag in the HTML.
comment on: http://stackoverflow.com/a/29966664
score: 0

http://stackoverflow.com/comment/47865274
type: AnswerComment
type: Comment
has text: To stick to the problem statement i can only have `ng-model` attribute in the custom HTML tag. I cannot use any other attributes.
comment on: http://stackoverflow.com/a/29870108
score: 0

http://stackoverflow.com/q/29880464
has title: How to pause during middle of animation/transition
type: Question
answer count: 2
has body: I have an image that I want to stretch for 3 seconds, then pause for 2 seconds, then unstretch for 3 seconds. As it stands, I don't know how to pause it; animation-delay only works at the beginning of the animation, not the middle. Here's my code: Page 2 Button 1 Button 2 Button 3
has answer: http://stackoverflow.com/a/29880553
downvote count: 0
tagged with: javascript
tagged with: jquery
upvote count: 8
tagged with: http://stackoverflow.com/tag/html
tagged with: css
favorite count: 0
score: 8
accepted answer: http://stackoverflow.com/a/29880571
possible better answer: http://stackoverflow.com/a/29880553
tagged with: animation
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29880571

http://stackoverflow.com/q/29855374
favorite count: 0
tagged with: ajax
accepted answer: http://stackoverflow.com/a/29855447
has comment: http://stackoverflow.com/comment/47837531
possible better answer: http://stackoverflow.com/a/29855433
has comment: http://stackoverflow.com/comment/47837231
has answer: http://stackoverflow.com/a/29855433
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47836685
has comment: http://stackoverflow.com/comment/47836856
score: 1
tagged with: loops
upvote count: 1
has comment: http://stackoverflow.com/comment/47836720
has answer: http://stackoverflow.com/a/29856694
has body: I am running match() to loop through an array or stop ID's. For each stop ID I am calling a function which loops through another array of route ID's and through the response of the AJAX call to find a match. If it finds a match between the routeID and the RouteID in the array then it adds the result to another array in each loop. My problem is that I can't find a way to determine when the functions called by the match() loop are complete. The reason I need to do this, is that I need to make sure that the jpFromStops array is complete and ready to be processed by another function. What is the best way to do this? function match() { // Array length is 5 for(i=0; i &lt; fromStopsAr.length; i++) { getFromRoutesStopId(fromStopsAr[i]); } console.log("Match Array Output: " + jpFromStops.toString()); } function getFromRoutesStopId(id) { jpFromStops=[]; tempAr = []; jQuery.ajax({ type: "GET", url: 'http://apu-url.com/v1/gtfs/routes/stopid/'+id+'?api_key=API_KEY', dataType: "jsonp", cache: false, crossDomain: true, processData: true, success: function (data) { $.each( matchRoutes, function(index, value) { $.each(data.response, function(key, data) { if(data.route_short_name.toString() == value) { jpFromStops[jpFromStops.length] = id + ":" + value; } }); }); }, error: function (XMLHttpRequest, textStatus, errorThrown) { alert("There is a problem"); } }); } Console log Output: Match Array Output: jp-main.js (line 177) 2 115 jp-main.js (line 199) 2 113 jp-main.js (line 199) 2 087
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/47836802
has title: How to check when the functions initiated by the loop have completed?
answer count: 3
has answer: http://stackoverflow.com/a/29855447
has comment: http://stackoverflow.com/comment/47836673
downvote count: 0
tagged with: jquery

http://stackoverflow.com/q/29917500
has answer: http://stackoverflow.com/a/29940176
has title: trouble rendering SVG elements using phantomjs screen capture
tagged with: phantomjs
has comment: http://stackoverflow.com/comment/47970292
has comment: http://stackoverflow.com/comment/47969968
has body: I'm using phantomjs to capture screen of my webpage. I have SVG elements on my page and sometimes it doesn't render those correctly. var page = require('webpage').create(); var args = require('system').args; var isLoad = false; page.settings.userAgent = "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.90"; var w = parseFloat(args[4]); var h = parseFloat(args[5]); page.viewportSize = { width: w, height: h }; page.open('http://www.facegift.co.il/canvas/?userItemId=' + args[1] + '&amp;Sc=' + args[2] + '&amp;print=' + args[6] + '&amp;width=' + args[4] + '&amp;pageNum=' + args[3] + '&amp;ver=' + args[7], function(status) { var ue = page.evaluate(function(){ return navigator.userAgent; }); console.log("status: " + status); if(status === "success") { setInterval(function(){ var ps = page.evaluate(function() { document.body.bgColor = 'white'; return document.getElementById("pageStatus").innerHTML; }); if(!isLoad){ console.log("wait..."); if(ps == "loaded"){ console.log("loaded"); isLoad = true; page.render('example1.jpg'); console.log("rendered"); phantom.exit(); } } }, 100); } }); here are examples of two results with the same request: here is the link to the actual page I want to render: http://www.facegift.co.il/canvas/?userItemId=17887&amp;sc=987404&amp;print=1&amp;width=4000&amp;pageNum=7 to call phantom I use: phantomjs facegift.js 17887 987404 7 4000 2048.77 1 2335
type: Question
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/47966763
answer count: 1
tagged with: http://stackoverflow.com/tag/svg
has comment: http://stackoverflow.com/comment/47969685
linked to: http://stackoverflow.com/q/29924514
type: UnansweredQuestion

http://stackoverflow.com/q/29976879
has comment: http://stackoverflow.com/comment/48073464
tagged with: php
has body: I am trying to make a theme for wordpress and i am trying to make a sticky header but the sticky header just doesn't seem to work, maybe it is the javascript. Can you help me? this is my javascript: $(document).ready(function(){ var nav = $('.topmenu'); var top = $(".topmenu").height(); $(window).scroll(function () { if ($(window).scrollTop() &gt; top ) { nav.addClass("sticky"); } else { nav.removeClass("sticky"); } }); });
type: UnansweredQuestion
tagged with: wordpress
has answer: http://stackoverflow.com/a/29976949
has answer: http://stackoverflow.com/a/29976985
type: Question
score: 0
answer count: 2
tagged with: javascript
has title: i cannot make sticky header work
tagged with: jquery
has comment: http://stackoverflow.com/comment/48073318
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/a/34115061
has comment: http://stackoverflow.com/comment/55979624
has comment: http://stackoverflow.com/comment/55979606
score: 0
has comment: http://stackoverflow.com/comment/55980842
type: Answer
answers question: http://stackoverflow.com/q/29977261
has comment: http://stackoverflow.com/comment/55979599
has comment: http://stackoverflow.com/comment/55980859
has body: The error message is directly indicating the role/use the python server is running on doesn't have write access to the folder. You need to assign either the role or the web server user. Make sure to give only write access and not write + execute access.
has comment: http://stackoverflow.com/comment/55980874

http://stackoverflow.com/q/29892119
tagged with: android
has body: I'm studying new Cordova 5.0. I'm using Sublime Text. So I'd like to use adb from command line to logcat to debug javascript errors. do you know wich combinations of parameters to use? I tried adb logcat *:S CordovaLog:D as seen in a blog, but in case of JS no line appears Also, I tried this, taht could be what I'm looking for adb logcat SystemWebChromClient:D but in this case it logs everythings, not only the rows of DEBUG type from SystemWebChromClient. What am I doing wrong?
has title: How to use ADB to show javascript errors when programming with Apache Cordova?
possible better answer: http://stackoverflow.com/a/29893089
tagged with: cordova
has answer: http://stackoverflow.com/a/29895982
has answer: http://stackoverflow.com/a/29893089
tagged with: adb
type: Question
accepted answer: http://stackoverflow.com/a/29895982
type: AnsweredQuestion
answer count: 2
tagged with: javascript
score: 0
tagged with: android-logcat

http://stackoverflow.com/q/29871544
has body: have done a lot of searching, and I am not sure why this is not working. I have a jquery dialog in which I am displaying a partial view. When I pass the data back to the controller, it shows up with a blank model. Controller: public ActionResult AddIngredient() { return PartialView(); } public JsonResult AddIngredientJson(Ingredient model) { Ingredient newIngredient = model; return Json(null); } Partial View: Name: @Html.TextBoxFor(x => x.Name, new { @class = "logintextbox" }) Category: @Html.EnumDropDownListFor(x => x.Category, new { @class = "logintextbox" }) Script: $(document).ready(function () { function addIngredient() { $.ajax({ url: "AddIngredientJson", Data: $('#AddIngredientForm').serialize(), Type: "POST" }); } $(function () { $('#modalDialog').dialog({ autoOpen: false, width: 400, resizable: false, modal: true, buttons: { "Save": function () { addIngredient(); }, Cancel: function () { $(this).dialog("close"); } } }); $('#openDialog').click(function () { $('#modalDialog').load("@Url.Action("AddIngredient")", function () { $(this).dialog('open'); }); return false; }); }); }); I have tried hardcoding in data into the script, and that does not get passed either. Thanks for the help.
has title: Getting data from jquery dialog via ajax mvc
has answer: http://stackoverflow.com/a/29871594
score: 0
answer count: 1
accepted answer: http://stackoverflow.com/a/29871594
tagged with: jquery
tagged with: ajax
type: AnsweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/47868138
tagged with: asp.net-mvc
tagged with: javascript

http://stackoverflow.com/comment/47834748
score: 0
type: Comment
type: QuestionComment
has text: Yea, they are all working fine..
comment on: http://stackoverflow.com/q/29853382

http://stackoverflow.com/a/29910709
has body: You need to use "target=_blank" in your hyperlink $(document).ready(function(){ $('#newtab').click(function() { $(this).target = "_blank"; window.open($(this).prop('href')); return false; }); });​ new tab
score: -2
downvote count: 2
answers question: http://stackoverflow.com/q/29910621
has comment: http://stackoverflow.com/comment/47943819
type: Answer
has comment: http://stackoverflow.com/comment/47943659
upvote count: 0

http://stackoverflow.com/comment/47916425
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29895363
has text: Yes :) , when we detect the variable before index '/:locale?/index' , How can I check if it exists in supported languages? because actually when I enter www.example.com/somethingAnything/index.html, it redirects me :/ it consider SomethingAanything as a language and it doesn't automatically check it in the Supported languages, I'm I obluge to make a loop in order to check that.?
type: Comment

http://stackoverflow.com/a/29918379
has body: Generally there is no difference as indicated in the comments. But, if the snippet is embedded in the middle of the HTML in the page and it is not a function, it is executed immediately. Such script segments may have a difference in behavior when moved to a separate JS file when enough care is not taken.
upvote count: 2
type: Answer
answers question: http://stackoverflow.com/q/29918246
score: 2
downvote count: 0

http://stackoverflow.com/a/73423106
type: Answer
has body: Or check the prototypes: Object.getPrototypeOf(i) === Map.prototype
score: 0
answers question: http://stackoverflow.com/q/29924932

http://stackoverflow.com/a/29889024
has comment: http://stackoverflow.com/comment/48256834
type: Answer
upvote count: 0
score: -1
downvote count: 1
answers question: http://stackoverflow.com/q/29888830
has body: First you have to declare the variable as array type as shown below var elements=[]; then get the value from the input feild using below code elements=document.getElementsByName('sid'); and then pass it in you url. hope this will sove your problem

http://stackoverflow.com/comment/47825298
comment on: http://stackoverflow.com/a/29849163
type: Comment
has text: Thank you, this looks like a huge step in the right direction. As a PL/SQL developer I go straight for the loop. so, I added `$("#dtt_2597807651112537_table tbody tr") // select elements .toggleClass('dtt_collapsed_tr', collapsed) // do stuff to them .toggleClass('dtt_expanded_tr', !collapsed);` To my javascript and this collapsed everything - it disappeared. Is there a way to select the correct ones without looping through and checking the level like in my example? (Basically everything where dtt_level is not 1)
score: 0
type: AnswerComment

http://stackoverflow.com/q/29962883
type: Question
has comment: http://stackoverflow.com/comment/48046741
tagged with: javascript
has body: I've got a script working to add markers to a map with an infowindow. The problem is that the images are tiny, yet when you inspect and hover over the img entity the size is correct, and the blue box that shows where the canvas sits in the main window is correctly proportioned, it's just the actual image takes up a fraction of the canvas. I've no idea on what is causing this. Using the Developer Tools I've removed all CSS that appears to be affecting it and nothing changes, except if I remove the 100% width, then the canvas goes full size, but the image is still only a fraction of the canvas. This is the Javascript var startLat = 20; var startLng = 0; var startZoom = 2; var isAddress = false; var distributors = [{"logo":"http:\/\/www.elecro.demomycms.co.uk\/eshop\/files\/images\/distributor-logos\/5.jpg","name":"AG Budget Swimming Pool & Spas","contactNumber":"020 89416618","address":"Unit 10 Wilden Industrial Estate\nWilden Lane\nStourport on Severn\nWorcestershire","postcode":"DY13 9JY","latitude":"52.3504","longitude":"-2.26002"}]; var map; var geocoder; $(function () { var mapOptions = { zoom: startZoom, center: new google.maps.LatLng(startLat, startLng) } var marker, i; $('#map-canvas').height($('#map-canvas').width() / 2); var mapOptions = { zoom: startZoom, center: new google.maps.LatLng(startLat, startLng) } map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions); if ( ! isAddress && $('#country').val() > 0) { GeocodeCountry(); } for (i = 0; i < distributors.length; i++) { var $distributor = distributors[i]; var marker = new google.maps.Marker({ position: new google.maps.LatLng($distributor.latitude, $distributor.longitude), map: map }); var infowindow = new google.maps.InfoWindow(); marker.html = ' \ \ '+($distributor.logo ? ' ' : '')+'\ '+$distributor.name+'\ \ \ '+$distributor.address+' '+$distributor.postcode+' \ '+($distributor.url ? ''+$distributor.url+'' : '')+' '+$distributor.contactNumber+' \ \ '; google.maps.event.addListener(m…
accepted answer: http://stackoverflow.com/a/29965807
has comment: http://stackoverflow.com/comment/48046455
tagged with: google-maps-api-3
answer count: 2
downvote count: 0
score: 1
has title: Google Map images are really tiny inside infowindow
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/29965806
has answer: http://stackoverflow.com/a/29965806
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29965807
upvote count: 1

http://stackoverflow.com/q/29856721
favorite count: 0
type: AnsweredQuestion
downvote count: 0
possible better answer: http://stackoverflow.com/a/74435084
score: 6
has title: new Event('build') vs new CustomEvent('build')
has answer: http://stackoverflow.com/a/29856815
accepted answer: http://stackoverflow.com/a/29856815
type: Question
upvote count: 6
tagged with: javascript
answer count: 2
has answer: http://stackoverflow.com/a/74435084
has body: On this MDN page Creating and Triggering Events it shows an example of creating event with Event or CustomEvent. It explains that CustomEvent allows for custom details, but other than that, it doesn't say much. So, what is the difference? If I'm creating a generic scroll event, should I use CustomEvent? Or is it only for events not exist in javascript? Also, I noticed that MouseEvent is also a child of Event, so if I'm creating a click event, I can just use new MouseEvent('click')? Thanks

http://stackoverflow.com/comment/47856617
comment on: http://stackoverflow.com/a/29865431
has text: use markup property : iframe: { markup: ' '+ ' '+ ' '+ ' ', // HTML markup of popup, `mfp-close` will be replaced by the close button
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/47877656
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29876525
has text: @Viraj Can you send a code snippet for the javascript logic you are mentioning here. It would be a great help. Thanks

http://stackoverflow.com/a/30164869
type: Answer
downvote count: 1
score: -1
answers question: http://stackoverflow.com/q/29923571
has comment: http://stackoverflow.com/comment/48436833
upvote count: 0
has body: problem solved. Website:

http://stackoverflow.com/a/30000867
type: Answer
accepted answer of: http://stackoverflow.com/q/29997493
has body: Even though I'm not completely sure of your code I think this should work: updateActive = (id) -> node.classed("bubble-selected", (d) -> id == idValue(d)) if id for x in data when idValue(x) is id d3.select("#comment").html(commentValue(x)) else d3.select("#comment").html(" Click on a bubble to read its comment. ") Here data is what you supply to d3 through .data().
answers question: http://stackoverflow.com/q/29997493
score: 0
type: AcceptedAnswer

http://stackoverflow.com/comment/48316809
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29925715
score: 0

http://stackoverflow.com/q/29942173
type: UnansweredQuestion
has title: Javascript not working!! cannot redirect to java page
has body: <% String s = (String) itr.next();%> <%=s%> <%=itr.next()%> <%=itr.next()%> <%=itr.next()%> <%=itr.next()%> <input class="dr-input" type="submit" value="Edit" name="edit" onclick="editRecord(<%=s%>)"> <input class="dr-input" type="submit" value="Delete" name="delete" onclick="deleteRecord(<%=s%>);"> <% }%> what I want is, when i click the button(Edit) it should redirect to a servlet page(EditRecord.java). The Above code is in jsp. the Button doesnt redirect to the specified page. what's wrong with the code? Is there any other way to deal with this?
answer count: 0
type: Question
tagged with: jakarta-ee
has comment: http://stackoverflow.com/comment/48046719
tagged with: javascript
tagged with: servlets
score: 0
tagged with: jsp
has comment: http://stackoverflow.com/comment/48047594
has comment: http://stackoverflow.com/comment/48048239
has comment: http://stackoverflow.com/comment/48046934
has comment: http://stackoverflow.com/comment/48046969

http://stackoverflow.com/comment/47875591
has text: Thank you it worked for me.Thank you for your information can yo help me how to create separate markers for each place .
comment on: http://stackoverflow.com/a/29870784
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/47914153
type: Comment
comment on: http://stackoverflow.com/a/29895723
has text: It's better to add the code in your answer. Otherwise this isn't really an answer and should be a comment.
score: 0
type: AnswerComment

http://stackoverflow.com/q/29897176
has title: How to write a jQuery style ng-repeat
answer count: 4
has answer: http://stackoverflow.com/a/29897594
has answer: http://stackoverflow.com/a/29897275
type: AnsweredQuestion
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/29897423
accepted answer: http://stackoverflow.com/a/29897338
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/29897338
upvote count: 1
tagged with: jquery
favorite count: 0
tagged with: angularjs
has body: Im used to using AngularJS for data binding and displaying data to the front end via its directives. Essentially i have written a jQuery fucntion to get some data from a .JSON file: $(document).ready(function() { var myItems; $.getJSON("../assets/data/address.json", function(data) { myItems = data.Addresses.AddressList; console.log(myItems); }); }); How can i repeat all of the items in myItems in an &lt;li&gt; In angular terms, it would look like: &lt;ul&gt; &lt;li ng-repeat="address in myItems"&gt; {{ address.HouseNumber }}, {{ address.Street }}, {{ address.Postcode }} &lt;/li&gt; &lt;/ul&gt; How can i get this to work without needing to use Angular?
possible better answer: http://stackoverflow.com/a/29897275

http://stackoverflow.com/comment/47940469
score: 0
type: AnswerComment
has text: `myObject[data]` should be `myObject.data`. However, I don't see what you are doing vastly different from what the OP already does.
comment on: http://stackoverflow.com/a/29908900
type: Comment

http://stackoverflow.com/a/29857139
score: -2
has comment: http://stackoverflow.com/comment/47840281
answers question: http://stackoverflow.com/q/29856954
downvote count: 2
has comment: http://stackoverflow.com/comment/47840345
has body: Two things: 1. Are you missing a JSON.parse() ? Mydata = JSON.parse(Mydata); // we parse it here alert(Mydata.length); return Mydata; Remember a valid json object must be between comillas ("|'). If you do JSON.parse({ "var1":"v1", "var2":"v2" }); you would get error. Correct way is: JSON.parse('{ "var1":"v1", "var2":"v2" }');
type: Answer
upvote count: 0

http://stackoverflow.com/a/29916621
upvote count: 1
answers question: http://stackoverflow.com/q/29916515
downvote count: 0
type: Answer
has body: you would have to do this: function setData() { dataToStore = document.getElementById('txtStore').value; return dataToStore; } function storeData(dataFunct) { localStorage.setItem('input', dataFunct()); } btnStore.addEventListener('click', storeData(setData), false);
score: 1

http://stackoverflow.com/q/29989647
has comment: http://stackoverflow.com/comment/48098736
score: 1
has answer: http://stackoverflow.com/a/29989750
has comment: http://stackoverflow.com/comment/48098611
has body: really simple question and cant figure it out. I am trying to add a line break here on my table header var text = " "; text += " style='font-size:16px'>Cool \nStuff "; I have tried to add a line break using and \n and no luck, can anyone help me
type: Question
accepted answer: http://stackoverflow.com/a/29989743
tagged with: javascript
answer count: 6
has comment: http://stackoverflow.com/comment/48098759
upvote count: 2
has answer: http://stackoverflow.com/a/29989764
has title: how to add a line break on javascript variable
has answer: http://stackoverflow.com/a/29989769
has answer: http://stackoverflow.com/a/29989743
has comment: http://stackoverflow.com/comment/48098875
downvote count: 1
favorite count: 0
possible better answer: http://stackoverflow.com/a/29989744
has answer: http://stackoverflow.com/a/29989744
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29989782
tagged with: css
linked to: http://stackoverflow.com/q/16595483
has comment: http://stackoverflow.com/comment/48098610
type: AnsweredQuestion

http://stackoverflow.com/a/29996525
type: Answer
has comment: http://stackoverflow.com/comment/48112886
answers question: http://stackoverflow.com/q/29996102
score: 0
has comment: http://stackoverflow.com/comment/48113047
has comment: http://stackoverflow.com/comment/48113155
has body: You want to target the specific &lt;ul&gt; that is a sibling of the target &lt;a&gt; $('.has-sub a').on('focus blur', function() { $(this).siblings('ul').toggleClass('active'); }); Within an event handler this is the element within the selector that the event occurred on. From that element you can use whatever traverses you need to target other specific elements DEMO
has comment: http://stackoverflow.com/comment/48112673
has comment: http://stackoverflow.com/comment/48112704
has comment: http://stackoverflow.com/comment/48113234

http://stackoverflow.com/comment/48020634
score: 1
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29949860
has text: Measure timing of each R process separately and find what is the bottleneck, then try to optimize. Pre-aggregate data on database side to limit number of rows transferred to R. If you are making any transformation in R then use some decent tools like data.table/dplyr. If you use databases extensively you may find [dwtools](https://github.com/jangorecki/dwtools) package useful, it has timing feature for databases queries built-in.

http://stackoverflow.com/comment/47890148
score: 0
has text: Updated post see second part.
type: Comment
comment on: http://stackoverflow.com/a/29882877
type: AnswerComment

http://stackoverflow.com/q/29874050
answer count: 1
has title: Cannot /Post - Login Authentication
tagged with: javascript
tagged with: ejs
upvote count: 1
favorite count: 0
has body: I am creating an app and I need a SignIn / SignUp functionality for the same. Here is my SignIn HTML: Login Don't have an account? Sign Up Here My app.js has the following to route: app.post('/verifySignin', home.verifySignin); app.get('/verifySignin', home.verifySignin); Under routes folder> I have created a home.js file which contains the following: function verifySignin(req,res) { req.session.name=req.param("username"); var password = req.param("password"); console.log("session name:"+req.session.name); var verifyUserQuery="select username, password from Users where Username='"+req.param("username")+"' and Password = '"+req.param("password")+"'"; mysql.fetchData(function(err,results){ if(err){ throw err; } else { if(results.username==req.param("username") && results.password == password){ res.render('kanban', { name: req.param("username") });} else { res.render('ErrorPage'); } } },verifyUserQuery); } exports.verifySignin=verifySignin; When I click on the Login button, I get the error : Cannot POST /verifySignin. Any help would really be appreciated. Thanks.
type: UnansweredQuestion
tagged with: node.js
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/29875547
tagged with: authentication
tagged with: post
type: Question

http://stackoverflow.com/comment/48037067
type: Comment
comment on: http://stackoverflow.com/a/29958137
score: 0
type: AnswerComment
has text: Those URL are public as far as I know since I'm referring to this link https://code.google.com/p/yahoo-finance-managed/wiki/YahooFinanceAPIs

http://stackoverflow.com/comment/47872848
score: 0
type: AnswerComment
has text: @AlexZahir do you want to check whether all of them has the class.... or just any one of them has the class
type: Comment
comment on: http://stackoverflow.com/a/29873870

http://stackoverflow.com/q/29854345
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47834643
has comment: http://stackoverflow.com/comment/47834690
has comment: http://stackoverflow.com/comment/47835229
has title: TypeError: handlers.push is not a function
type: Question
linked to: http://stackoverflow.com/q/1168807
has comment: http://stackoverflow.com/comment/47835095
has body: How to fix this issue? // Add to the element's handler list, delegates in front if ( selector ) { handlers.splice( handlers.delegateCount++, 0, handleObj ); } else { handlers.push( handleObj ); }
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/29854397
upvote count: 1
downvote count: 1
answer count: 1
favorite count: 0

http://stackoverflow.com/comment/48085564
type: Comment
type: QuestionComment
score: 1
has text: +1 to the documentation guess in this case. I figured I'd mention that it would also trigger a getting function if something happened to have defined a getter for `bar` on the prototype, and that could technically have side-effects, though it'd be awful to actually do that.
comment on: http://stackoverflow.com/q/29979203

http://stackoverflow.com/comment/47993291
type: Comment
comment on: http://stackoverflow.com/q/29935513
type: QuestionComment
has text: @Moogs and it would be a pain to invest these 5 minutes to let it do so?
score: 0

http://stackoverflow.com/a/29931905
has body: try something using jquery .map() method like this, text = $('.region_box').find('.my_text').map(function() { return $(this).text(); }).get().join(','); As the site said, "As the return value is a jQuery object, which contains an array, it's very common to call .get() on the result to work with a basic array."
answers question: http://stackoverflow.com/q/29931852
score: 2
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/47987119
upvote count: 2

http://stackoverflow.com/comment/47997633
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29930302
has text: Hmm, it s seems that you need this div in your jsfiddle http://jsfiddle.net/anh7g8eb/3/ because making minor change prevents popup but I dont see how this fits in with what I want

http://stackoverflow.com/q/29923945
type: AnsweredQuestion
score: 1
type: Question
tagged with: c#
tagged with: encoding
has body: I have an application that takes text entered by a user and passes it to the server as part of a URL so that an image containing the text can be rendered. The URL parameter is encoded using encodeURIComponent function. The problem I have is that if the user enters text containing + or foreign characters I cannot get the string decoded correctly server side. For example, If the string is "François + Anna" The encoded URL is previewImage.ashx?id=1&amp;text=Fran%25E7ois%2520%2B%2520Anna On the server Uri.UnescapeDataString( Context.Request.QueryString["text"] ) Throws an "Invalid URI: There is an invalid sequence in the string." exception. If I replace the extended character from the string, it is decoded as "Francois + Anna" However, if I use HttpUtility.UrlDecode( Context.Request.QueryString["text"], System.Text.UTF8Encoding.UTF7 ) the foreign characters are decoded correctly but the encoded + is changed to a space; "François&nbsp;&nbsp;&nbsp;Anna".
downvote count: 0
tagged with: .net
answer count: 1
has title: Decode parameters encoded using the JS encodeURIComponent function
tagged with: javascript
has answer: http://stackoverflow.com/a/29924009
tagged with: asp.net
favorite count: 0
accepted answer: http://stackoverflow.com/a/29924009
upvote count: 1

http://stackoverflow.com/q/29928987
type: Question
answer count: 2
possible better answer: http://stackoverflow.com/a/53248257
tagged with: canvas
downvote count: 0
tagged with: javascript
score: 4
has title: Click and drag from inside canvas element highlights text outside it in some browsers
tagged with: http://stackoverflow.com/tag/html
upvote count: 4
favorite count: 0
has answer: http://stackoverflow.com/a/53248257
accepted answer: http://stackoverflow.com/a/29929298
type: AnsweredQuestion
has body: I have a canvas in a page with some text after it: Some text after the canvas I use JavaScript to draw points/lines. This one's very simple. var canvas = document.getElementById("myCanvas"); var ctx = canvas.getContext("2d"); var drawing = false; canvas.onmousedown = function(e){ if( !drawing ) { drawing = true; ctx.beginPath(); } } canvas.onmousemove = function(e){ var x = e.clientX - canvas.offsetLeft; var y = e.clientY - canvas.offsetTop; if( drawing ) { ctx.lineTo(x,y); ctx.stroke(); } } canvas.onmouseup = function(e){ drawing = false; } canvas.onmouseout = function(e){ drawing = false; } If I click on the canvas and hold, I can move my mouse around in the canvas and draw lines. Great! However, if I keep holding and move my mouse down off the canvas and past the text, I will end up highlighting that text. Not so great! I've noticed this doesn't happen in some browsers. Here is a list of what I've tested on: Firefox 37: no highlighting issue exists IE 9: highlighting issue exists IE 11: highlighting issue exists Chrome 41: highlighting issue exists My question: What can be done to prevent this highlighting issue from occurring?
has answer: http://stackoverflow.com/a/29929298

http://stackoverflow.com/a/29995127
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/29994912
type: Answer
accepted answer of: http://stackoverflow.com/q/29994912
score: 2
upvote count: 2
has body: Use objects instead of separate variables. Then extract the common code from into a function that creates the obect: function getTopBottom(el, de) { var result = {}; var box = el.getBoundingClientRect(); result.top = box.top + window.pageYOffset - de.clientTop; result.bottom = box.bottom + window.pageYOffset - de.clientTop; result.diff = result.bottom - result.top; result.padding = window.innerHeight - result.diff; return result; } Then in your getElementOffset function you can write: var page = getTopBottom(featurePage, de);

http://stackoverflow.com/a/29999721
answers question: http://stackoverflow.com/q/29999097
has comment: http://stackoverflow.com/comment/48141843
has body: Note, calling .css() ellipse .css("background-image", "-[vendorPrefix]-radial-gradient(center bottom, ellipse cover, #ffeda3, #ffc800)"); should not affect non [vendorPrefix] browser display , rendering ; save for possibly opera, which not certain if still utilizes both -o- and -webkit- ? This approach checks for a property of element.style ; replaces given text values within style element text with vendor prefixed value text. Try var ellipse = $('.ellipse') , style = $("style") , prefixes = { "MozAnimation": "-moz-", "webkitAnimation": "-webkit-", "msAnimation": "-ms-", "oAnimation": "-o-" }; // should not affect non `-moz-` browser ellipse .css("background-image", "-moz-radial-gradient(center bottom, ellipse cover, #ffeda3, #ffc800)"); $.each(prefixes, function(key, val) { if (key in ellipse[0].style) { $("style").text(function(i, text) { return text.replace(/(radial-gradient)/g, val + "$1") }) } }); console.log(style.text(), ellipse.css("backgroundImage")); .demo-wrapper div { width: 910px; height: 250px; padding: 10px; margin: 25px auto; border: 5px solid #fff; } .ellipse { background-image: radial-gradient(center bottom, ellipse cover, #ffeda3, #ffc800); } Elliptical Gradient Lorem Ipsum jsfiddle http://jsfiddle.net/cte7ov36/3/
upvote count: 1
type: Answer
downvote count: 0
score: 1

http://stackoverflow.com/q/29954936
tagged with: http://stackoverflow.com/tag/svg
upvote count: 2
type: UnansweredQuestion
type: Question
has answer: http://stackoverflow.com/a/29955051
tagged with: javascript
has body: I am trying to manipulate elements inside svg (such as circle or path). I need to create them dynamically and be able to identify them. I've stolen few functions from some online examples, and came up with following code (it should create circle inside svg on mouse click, and a text tag when the mouse is over the circle). However, it is not working as I expected. When mouse enters the element from left, the elementFromPoint(x, y).id returns valid ID "circle", but when the mouse enters the element from right, it returns it's parent ID "mySVG". I was not able to find a proper solution anywhere, so any advice is welcomed - indeed, I will try to read the specs for svg and learn JS as best as I can, however, it is still a painful process for me to understand these things. Your time and suggestions are highly appreciated! Thanks. k JS Fiddle: https://jsfiddle.net/krisfiddle/2xc3tgdr/6/ The Code
has title: identify dynamically created svg element
answer count: 2
has answer: http://stackoverflow.com/a/29979086
downvote count: 0
favorite count: 0
tagged with: element
tagged with: identify
score: 2

app-store
tag name: app-store
type: Tag
tags question: http://stackoverflow.com/q/29905472
tags question: http://stackoverflow.com/q/29901083

http://stackoverflow.com/a/29992111
answers question: http://stackoverflow.com/q/29991795
type: Answer
has body: Just realized I had the shown.bs.modal called 2x for different things. When I combined, it fixed it. Bah, 30 minutes down the drain!
score: 0

http://stackoverflow.com/comment/47915784
type: Comment
has text: Should be "userName.toString()" fixed.
comment on: http://stackoverflow.com/q/29876351
score: 0
type: QuestionComment

http://stackoverflow.com/comment/48114177
type: Comment
score: 1
type: AnswerComment
has text: 1) It is chainable already because it returns a string. It will chain with other string methods that also return strings. 2) I don't know what you mean by "inside our app". You can add a currLang field to the string itself if you need to, or depend on a global variable or injected context to get that state value. Can you please be more specific with a concrete example of how you would like the API to look?
comment on: http://stackoverflow.com/a/29997293

acrobat
type: Tag
tags question: http://stackoverflow.com/q/29910028
tag name: acrobat
tags question: http://stackoverflow.com/q/29882975
tags question: http://stackoverflow.com/q/29853809

http://stackoverflow.com/q/29929289
has title: javascript. remove items in a nested array
has comment: http://stackoverflow.com/comment/47981591
tagged with: multidimensional-array
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47981182
answer count: 0
has comment: http://stackoverflow.com/comment/47981426
tagged with: google-chrome-devtools
has comment: http://stackoverflow.com/comment/47980985
type: Question
has comment: http://stackoverflow.com/comment/47982016
tagged with: arrays
tagged with: javascript
has body: I was practicing - getting fluent with Arrays. I created two arrays: var arr var arr2 I pushed to them. I spliced to them. I merged them. I removed from them. My objective was to remove the first two indexes (carl and erich) from arr Then put them back into the array in the first two index positions. As you can see, I somehow inserted them as a 'Nested' array. I have tried searching the documentation but have not found the best practice to do this. I know it is simple. While practicing code in the console using the following commands: var arr =['carl','erich','rob','nate']; arr ["carl", "erich", "rob", "nate"] arr.push('joe','tim','steve'); 7 arr ["carl", "erich", "rob", "nate", "joe", "tim", "steve"] var arr2 = ['dan','fred','paul']; arr2 ["dan", "fred", "paul"] Array.prototype.push.apply(arr, arr2); // intermediate testing commands using splice arr ["joe", "tim", "rob", "dan", "fred", "paul", 0, 4, "carl, erich"] // splice the two numbers from the array var removed = arr.splice(6, 4); arr ["joe", "tim", "rob", "dan", "fred", "paul"] // trying to insert carl, erich, nate, rob starting at index 0 var removed = arr.splice(0, 4, ['carl','erich','nate','rob']); arr [Array[4] ,"fred", "paul" 0: "carl" 1: "erich" 2: "nate" 3: "rob" length: 4__proto__ Also, why are does the MDN documentation use 'remove' to insert ? mdn using remove to insert??
score: 0
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/47981214
has comment: http://stackoverflow.com/comment/47981236
favorite count: 0
tagged with: console
has comment: http://stackoverflow.com/comment/47981106

http://stackoverflow.com/a/29989935
score: 1
answers question: http://stackoverflow.com/q/29989817
type: Answer
upvote count: 1
has body: An answer without needing to use JQuery: var test = 'Test Variable'; //initialises the variable 'test' window.onload = function() { alert(test); };
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29989817
downvote count: 0

http://stackoverflow.com/q/29927116
has comment: http://stackoverflow.com/comment/47976104
answer count: 0
upvote count: 2
has title: Why wildcard selectors do not trigger with jquery?
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/48183254
has comment: http://stackoverflow.com/comment/47976108
downvote count: 1
has comment: http://stackoverflow.com/comment/47983871
type: Question
has comment: http://stackoverflow.com/comment/47983760
has body: I have this code: $doc.find('#g').on('click', function(e) { $target = $doc.find('#g form'); $target.toggle(); $doc.find('#g input[type="text"]').focus(); }); I want it to stop triggering on children so this works: $doc.find('#g form').on('click', function(e){ e.stopPropagation(); }); So using #g form works, but selectors like #g * or #g>* or .children() do not work, why? The html structure is like this:
linked to: http://stackoverflow.com/q/5376431
score: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/48183777
tagged with: css
has comment: http://stackoverflow.com/comment/47976120

http://stackoverflow.com/q/29885117
score: 0
type: Question
has answer: http://stackoverflow.com/a/29895837
has comment: http://stackoverflow.com/comment/47894448
tagged with: javascript
tagged with: kendo-ui
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has body: I am trying to use Kendo's free source code. I simply want to display the data-title inside a tabstrip, but so far am unable to. The core code comes with one dataviz and it does not work for me. How can I display the data-title inside a tabstrip? Testing Menu
accepted answer: http://stackoverflow.com/a/29895837
has title: Kendo Core - basic assistance needed
type: AnsweredQuestion

http://stackoverflow.com/comment/76251485
score: 0
type: Comment
type: QuestionComment
has text: @ArunPJohny then why this error occurs? **No 'Access-Control-Allow-Origin' header is present on the requested resource.**
comment on: http://stackoverflow.com/q/29915657

http://stackoverflow.com/comment/48032730
type: Comment
has text: @DavidMulder well there are an awful lot of other languages :) Personally I am not a big fan of exceptions as a fundamental design thing, but if a language does have exceptions then number conversion sure seems like a good time for an exception.
comment on: http://stackoverflow.com/a/29955858
score: 0
type: AnswerComment

http://stackoverflow.com/q/29943918
has answer: http://stackoverflow.com/a/29944817
tagged with: javascript
score: 0
has body: Sign in program not navigating properly, I think the issue is in the .js code and the placement of where it is. I have a title, two text input boxes followed by two buttons that do not work (the issue) the navigation looks ok but it is not working unfortunately. I will post the .js in the comments as I am unfamiliar to the SO layout of posting an issue. Calorific Calorie Counter <!-- ? Calorific Username Password Sign-In Forgot password <script id="templates/nav-stack.html" type="text/ng-template" Javascript: angular.module('calorific', ['ionic']) .run(function($ionicPlatform) { $ionicPlatform.ready(function() { // Hide the accessory bar by default (remove this to show the accessory bar above the keyboard // for form inputs) if(window.cordova && window.cordova.plugins.Keyboard) { cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true); } if(window.StatusBar) { StatusBar.styleDefault(); } }); }) .config(function($stateProvider, $urlRouterProvider) { $stateProvider .state('signin', { url: '/sign-in', templateUrl: 'templates/sign-in.html', controller: 'SignInCtrl' }) .state('forgotpassword', { url: '/forgot-password', templateUrl: 'templates/forgot-password.html' }) .state('tabs', { url: '/tab', abstract: true, templateUrl: 'templates/tabs.html' }) .state('tabs.home', { url: '/home', views: { 'home-tab': { templateUrl: 'templates/home.html', controller: 'HomeTabCtrl' } } }) .state('tabs.tester', { url: '/tester', views: { 'home-tab': { templateUrl: 'templates/tester.html' } } }) .state('tabs.tester2', { url: '/tester2', views: { 'home-tab': { templateUrl: 'templates/tester2.html' } } }) .state('tabs.about', { url: '/about', views: { 'about-tab': { templateUrl: 'templates/about.html' } } }) .state('tabs.navstack', { url: '/navstack', views: { 'about-tab': { templateUrl: 'templates/nav-stack.html' } } }) .state('tabs.contact', { url: '/contact', views: { 'contact-tab': { templateUrl: 'templates/contact.html' } } }); $urlRouterProvider.otherwise('/sign-in'); }) .controlle…
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29945864
tagged with: angularjs
has title: Sign in program not navigating properly, I think the issue is in the .js code and the placement of where it is
type: UnansweredQuestion
tagged with: ionic-framework
tagged with: navigation
type: Question
answer count: 2

http://stackoverflow.com/comment/48004689
type: Comment
has text: Number.BasicPrice is looking up the BasicPrice property of the Number object, which is undefined most probably.
type: QuestionComment
comment on: http://stackoverflow.com/q/29941969
score: 0

http://stackoverflow.com/a/29920109
has comment: http://stackoverflow.com/comment/47993499
answers question: http://stackoverflow.com/q/29919596
score: 10
upvote count: 11
downvote count: 1
has body: I suggest using: https://github.com/umpirsky/country-list It gives you the list of countries in different formats (Text, JSON, PHP ...) Or if you want just a quick HTML list then go to: http://www.textfixer.com/resources/country-dropdowns.php You can literally just copy paste those values into wherever you want, or you can call that page.
type: Answer

http://stackoverflow.com/a/29940356
accepted answer of: http://stackoverflow.com/q/29940142
has body: You can set one Hashmap (actually an object) inside another object as value: var Hz125={}; //(1st Hashmap) var dbHL90={}; // (2nd Hashmap) Hz125['x'] = dbHL90; or Hz125.x = dbHL90; You can't set object as a key (I think that ES6 have weakmap that allow to do this).
type: AcceptedAnswer
score: 0
type: Answer
answers question: http://stackoverflow.com/q/29940142

http://stackoverflow.com/comment/47985526
comment on: http://stackoverflow.com/q/29929022
score: 1
type: Comment
type: QuestionComment
has text: @TheGuest, it is exactly what he is doing, and it should work -> POC -> (OP's code) http://jsfiddle.net/c846e6mo/ Guess it is cache ...1.10.x too -> http://jsfiddle.net/5cvj0t18/

http://stackoverflow.com/q/29852731
has answer: http://stackoverflow.com/a/29872478
score: 0
answer count: 3
possible better answer: http://stackoverflow.com/a/29852891
tagged with: angularjs-directive
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29872478
type: AnsweredQuestion
has body: I have a directive which renders an image as a background image. It works great in Chrome and Safari (as far as I can tell) but seems to not work in Firefox (the background-images don't show up). My research seems to indicate that maybe scope.$watch would help, but I'm not entirely sure how to apply it so that it will make things better. .directive('pictures', function () { return { restrict: 'EA', link: function (scope, element, attrs) { var url = attrs.pictures; element.css({ 'background-image': 'url(' + url +')', 'background-size' : 'cover' }); } }; }); Help or direction would be greatly appreciated. Thank you.
tagged with: angularjs
type: Question
has answer: http://stackoverflow.com/a/29869009
has title: Directive fails in Firefox
has answer: http://stackoverflow.com/a/29852891
has comment: http://stackoverflow.com/comment/47832073

http://stackoverflow.com/comment/48059155
has text: Can you explain your last sentence more detailed please? Do you mean using this ` ` in the html file?
type: AnswerComment
comment on: http://stackoverflow.com/a/29968307
score: 0
type: Comment

http://stackoverflow.com/q/29925178
answer count: 1
tagged with: javascript
score: 0
accepted answer: http://stackoverflow.com/a/29925275
has body: Essentially what I'm doing is trying to pull in Twitter data for use in Javascript app. I have a php file which is calling the API and retrieving JSON data, but I can't seem to access this data within my javascript file. I'm trying to use this method. $.getJSON("tweets_JSON.php?count=1&amp;callback=listTweets"); Then to test it I'm using... console.log(listTweets[0].id_str); This returns a message that listTweets isn't defined. I've tried removing the callback form the url and declaring it as var listTweets = $.getJSON("tweets_JSON.php?count=1&amp;callback=listTweets"); This seems to access the first object in the array, but then I get an error saying the object property I'm looking for (.id_str) can't be found.
tagged with: php
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json
tagged with: twitter
type: Question
tagged with: api
has answer: http://stackoverflow.com/a/29925275
has title: Twitter API 1.1 get json from PHP for use in Javascript

http://stackoverflow.com/a/29878010
answers question: http://stackoverflow.com/q/29876081
downvote count: 0
score: 1
has body: Fixed. Had to add: data-fit="-218" to account for the banner at the top :)
upvote count: 1
type: Answer

http://stackoverflow.com/a/29850811
downvote count: 0
answers question: http://stackoverflow.com/q/29850764
has body: Just use isNaN to check for a number or not: var val = $("#imageid").val(); if (isNaN(val)) { //Not a number! } else { //Number! }
accepted answer of: http://stackoverflow.com/q/29850764
score: 5
has comment: http://stackoverflow.com/comment/47828149
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47828198
upvote count: 5
type: Answer

http://stackoverflow.com/comment/47908151
type: QuestionComment
has text: Thanks Paul, I have 2 scripts to reference ' ' and ' ' how would I reference those in my inline function?
score: 0
comment on: http://stackoverflow.com/q/29886978
type: Comment

http://stackoverflow.com/a/32391185
has body: You data should be exact format like date format should be as like javascript date, so can to one more things for date. you can add a hidden date value with your display date value. i faced same problem with date field and resolved as above solution.
answers question: http://stackoverflow.com/q/29907992
type: Answer
score: 0

http://stackoverflow.com/comment/47913496
has text: @Bolza it is most likely a big part of the issue. The jQuery code shown should really be converted to angular
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29894243

http://stackoverflow.com/a/29871122
has comment: http://stackoverflow.com/comment/47867513
has body: You can use Array.prototype.filter() to remove values that are adjacent to identical values. var myArray = [1, 2, 3, 4, 4, 2, 3, 1, 1, 4, 3, 2]; var deduped = myArray.filter(function (value, index, collection) { return value !== collection[index+1]; }); // deduped is now [1, 2, 3, 4, 2, 3, 1, 4, 3, 2]
has comment: http://stackoverflow.com/comment/47867241
score: 0
has comment: http://stackoverflow.com/comment/47868547
type: Answer
has comment: http://stackoverflow.com/comment/47867210
has comment: http://stackoverflow.com/comment/47867189
has comment: http://stackoverflow.com/comment/47867290
has comment: http://stackoverflow.com/comment/47868189
has comment: http://stackoverflow.com/comment/47868261
answers question: http://stackoverflow.com/q/29871091
has comment: http://stackoverflow.com/comment/47871683
has comment: http://stackoverflow.com/comment/47868929

http://stackoverflow.com/q/29996238
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/29996403
has title: How to make the modal close by clicking anywhere outside of the modal-window
upvote count: 1
has body: I'm currently working on this website. and I would like to add extra function where users can close the modal (which could be opened at the top-right corner of the grey sub-header) by clicking anywhere except for the modal box. Right now I can only close the modal when I click close at the top-right corner of the modal box or the black background. How could I make this possible?
tagged with: modal-dialog
answer count: 1
tagged with: jquery
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/48112255
tagged with: http://stackoverflow.com/tag/html
tagged with: css
downvote count: 0
score: 1

http://stackoverflow.com/comment/47881647
type: Comment
has text: Hmmm - weird - I am not near a computer.
comment on: http://stackoverflow.com/a/29875289
score: 0
type: AnswerComment

http://stackoverflow.com/a/29877754
answers question: http://stackoverflow.com/q/29877690
has body: You should use either event.preventDefault() or a false return value: or Really, though, you shouldn't use inline event handlers like this. You should give your link an id or class and attach the handler to it like this: something This will make it much easier to read and maintain down the road. Here's a simple jsFiddle demo.
accepted answer of: http://stackoverflow.com/q/29877690
upvote count: 1
type: AcceptedAnswer
type: Answer
downvote count: 0
score: 1

http://stackoverflow.com/comment/47995377
score: 1
has text: The reason why 4.4 can be a problem is because WebView has been replaced by Chromium. You may need newer versions of Cordova that fully supports it.
comment on: http://stackoverflow.com/q/29918859
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/47898627
comment on: http://stackoverflow.com/a/29886905
has text: Mousedown: Sets initial `dy`. `renderGame()` uses `dy` to adjust `cary` a tiny amount before using some `gravity`value to adjust `dy` until the car begins to fall and eventually lands.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/30000199
has answer: http://stackoverflow.com/a/30000267
has answer: http://stackoverflow.com/a/30000299
has body: I want to scroll to elements (.list-view-items) inside the following container &lt;div id='list-view'&gt; &lt;ul&gt; &lt;li class='list-view-item'&gt; ... &lt;/li&gt; ... &lt;/ul&gt; &lt;/div&gt; #list-view { height: 100%; border-right: 1px dotted @gray; display: flex; flex-direction: column; align-items: stretch; } #list-view ul { position: relative; overflow: scroll; list-style-type: none; padding: 0px; } I have tried manually scrolling in chrome devtools with $('#list-view ul').scrollTop = 1000 But nothing happens
has title: Scrolling to element inside scrollable container div not working
upvote count: 1
downvote count: 1
accepted answer: http://stackoverflow.com/a/30000267
type: AnsweredQuestion
type: Question
score: 0
answer count: 2
tagged with: javascript
tagged with: jquery
favorite count: 0
possible better answer: http://stackoverflow.com/a/30000299

http://stackoverflow.com/comment/48452662
type: Comment
comment on: http://stackoverflow.com/a/30018407
has text: @sigod whatever is the default, CRLF apparently.
score: 0
type: AnswerComment

http://stackoverflow.com/q/29994718
has body: I am trying to create a playlist of audio files. The html contains three audio tags: so far my javascript(jquery) is: $(document).ready(function(){ var audioElement = document.createElement('audio'); var x = 1; x = parseInt(x); var deisredAudio = $('source:nth(0)').attr('src'); audioElement.setAttribute('src', deisredAudio); $.get(); audioElement.addEventListener("load", function(){ audioElement.play(); }, true); $('#playAudio').click(function(){ audioElement.play(); }); $('#pauseAudio').click(function(){ audioElement.pause(); }); }); This will play the audio track as long as I have an integer in the $('source:nth(0)'). This will play the first audio, $('source:nth(1)') will play the second and so on as expected. What I need to do is insert a variable to eventually create a loop to loop through and play the audio tracks. When I declare a variable x = 1, and then insert it into $('source:nth(x)'), it does not work. Please note that I am self-taught in JavaScript. Any help or insight will be greatly appreciated.
downvote count: 0
score: 1
favorite count: 0
has answer: http://stackoverflow.com/a/29994746
type: Question
has title: why can't I declare a variable, convert it to an integer and use that integer in my code?
tagged with: html5-audio
upvote count: 1
answer count: 1
tagged with: javascript
type: UnansweredQuestion

http://stackoverflow.com/q/29985515
tagged with: javascript
has comment: http://stackoverflow.com/comment/48267694
has body: We have a web-app that allows clients to import some CSV data into our database, e.g. a list of products they sell. The problem is, we'd like to store their data as-is but let the user specify a custom expression so that when they view the data it looks a bit nicer. Some imported data might look like this: product_label,quantity A: Product1- 001,50 A: Product2- 001,80 A: Product3- 001,150 B: Product5- 001,100 In this case, the client might want to strip out the prefix 'A: ' and the suffix ' - 001' in the string 'A: Product1- 001' so that just 'Product1' is displayed. The problem is, every client seems to have a different string format and desired output format. I was thinking of providing the ability to specify a regex to format the string purely on the client-side using javascript but I'm not sure how I would use this regex and how to allow them to specify grouping or back-references. Any suggestions on how to let them specify their own format? e.g. something like: match_pattern = ... // input field text (escaped into a regex) output_pattern = ... // How to let them specify the output from the match results? display_string = applyFormatting(string, match_pattern, output_pattern);
answer count: 1
has comment: http://stackoverflow.com/comment/48213125
tagged with: regex
favorite count: 0
has comment: http://stackoverflow.com/comment/48091132
has answer: http://stackoverflow.com/a/29985685
has comment: http://stackoverflow.com/comment/48212118
upvote count: 2
has title: User customizable regex expression for string formatting
type: AnsweredQuestion
score: 2
accepted answer: http://stackoverflow.com/a/29985685
type: Question
has comment: http://stackoverflow.com/comment/48108784
downvote count: 0

http://stackoverflow.com/comment/47828172
comment on: http://stackoverflow.com/q/29851018
score: 0
type: Comment
type: QuestionComment
has text: `/^[\S\s]+(<\/body>)/i` does that work?

http://stackoverflow.com/q/29936910
type: Question
type: AnsweredQuestion
has body: I've tried the following code for capture a image, it stores image in specified folder but the path of image which i want to store in database doesn't work.The execution of code stops after Uploding... message.Please help me,whats going wrong with my code. &lt;!--test.php--&gt; &lt;?php session_start(); include 'connection.php'; $name = date('YmdHis'); $newname=mysql_real_escape_string("images/".$name.".jpg"); $file = file_put_contents( $newname, file_get_contents('php://input') ); if (!$file) { print "ERROR: Failed to write data to $filename, check permissions\n"; exit(); } else { $sql="Insert into entry(images) values('$newname')"; $result=mysql_query($con,$sql) or die("Error in query"); $value=mysql_insert_id($con); $_SESSION["myvalue"]=$value; } $url = 'http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['REQUEST_URI']) . '/' . $newname; print "$url\n"; ?&gt; &lt;!--index.php--&gt; &lt;?php session_start(); if(isset ($_POST["send"])) { $getname=$_POST["myname"]; include 'connection.php'; $idvalue=$_SESSION["myvalue"]; $sql="update entry set name='$getname' where id='$idvalue'"; $result=mysql_query($sql) or die(mysql_error()); if($result) { echo "Uploaded $_SESSION[myvalue] re ..... "; } else { echo "$_SESSION[myvalue] nahi hua"; } } ?&gt; &lt;form action="&lt;?php echo $_SERVER["PHP_SELF"];?&gt;" method="post"&gt; &lt;input type="text" name="myname" id="myname"&gt; &lt;input type="submit" name="send" id="send"&gt; &lt;/form&gt; &lt;script type="text/javascript" src="webcam.js"&gt;&lt;/script&gt; &lt;script language="JavaScript"&gt; document.write( webcam.get_html(320, 240) ); &lt;/script&gt; &lt;form&gt; &lt;input type=button value="Configure..." onClick="webcam.configure()"&gt; &amp;nbsp;&amp;nbsp; &lt;input type=button value="Take Snapshot" onClick="take_snapshot()"&gt; &lt;/form&gt; &lt;script language="JavaScript"&gt; document.write( webcam.get_html(320, 240) ); &lt;/script&gt; &lt;script language="JavaScript"&gt; webcam.set_api_url( 'test.php' ); webcam.set…
has answer: http://stackoverflow.com/a/29937100
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29937100
upvote count: 1
answer count: 1
tagged with: jquery
favorite count: 0
tagged with: php
downvote count: 0
score: 1
has title: How to store webcam captured image path in mysql database
tagged with: mysql

http://stackoverflow.com/comment/47883998
type: AnswerComment
type: Comment
has text: I don't think that's hard to see. Switching up DOM elements (especially in a case such as this, where the elements are apparently ONLY selectable as children of the parent) means that everything in your CSS/javaScript that selects/acts upon those elements must also switch. If any of these panels needs CSS or jQuery applied specifically to them, it will quickly become very difficult to select them.
comment on: http://stackoverflow.com/a/29879692
score: 0

http://stackoverflow.com/q/30002497
tagged with: javascript
score: 0
answer count: 1
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/30002600
has body: If i have two markers on google maps and i reserve the longitude and latitude of the first marker in variables (fromLan, fromLat) and longitude and latitude of the second marker in variables (toLan, toLat). I want when dragging one of them to change the longitude and latitude of this marker in order to know whether to change the (fromLan, fromLat) variables or the (toLan, toLat) variables .
tagged with: markers
has title: Dragging marker in google maps and changing the coordinates corresponding to it
type: Question
tagged with: google-maps

http://stackoverflow.com/q/29972238
has title: Delay lineTo in for loop
tagged with: javascript
has comment: http://stackoverflow.com/comment/48285765
has body: I'm having a div (#option1) in the shape of a dot animating a graph using an array, Option1[], in which all the heights of the several 'dots' are included. I'm using a for loop to create space between two dots (left: '+=5px') and get the height for the next dot from the array, like so: for (var i = 0; i < Option1.length; ++i) { $('#option1').animate({left: '+=5px',top: Option1[i]}, 200); } As you can see, the div takes 200ms to move to it's next coordinates. This all works fine, but it is just a moving dot. I actually want to make it look like the dot is drawing a line, so I tried to use a canvas and lineTo methods, like so: var xaxis=5; var a = document.getElementById("myCanvas1"); var atx = a.getContext("2d"); atx.beginPath(); atx.moveTo(5, 900); for (var i = 0; i < Option1.length; ++i) { xaxis += 5; $('#option1').animate({left: '+=5px',top: Option1[i]}, 200); atx.lineTo(xaxis, Option1[i]); atx.stroke(); } As you can see the line starts at coordinates 5,900, then moves 5px to the right and to the height of the next value of the Option1[] array. The line comes out correctly. The problem is that the total line shows instantaneously, and then the dot starts moving over the already drawn line. To make it so that a line-section only appears after the dot has past the new coordinates, I've tried the setTimeout function, setting the timeout at 200ms, just like the animate time: $(document).ready(function() { var Option1 = [100, 150, 150, 130, 50, 100, 75, 125, 50, 100]; var xaxis = 5; var a = document.getElementById("myCanvas1"); var atx = a.getContext("2d"); atx.beginPath(); atx.moveTo(5, 400); atx.strokeStyle="green"; for (var i = 0; i < Option1.length; ++i) { xaxis += 5; $('#option1').animate({ left: '+=5px', top: Option1[i] }, 400); setTimeout(drawLines(), 400); function drawLines() { atx.lineTo(xaxis, Option1[i]); atx.stroke(); }; }; }); html, body { width: 100%; height: 100%; background-color: black; } #maindiv { position: absolute; top: 5px; left: 5px; z-index: 5;…
has answer: http://stackoverflow.com/a/30086704
tagged with: for-loop
tagged with: canvas
has comment: http://stackoverflow.com/comment/48220525
tagged with: delay
answer count: 1
downvote count: 0
tagged with: jquery
favorite count: 0
score: 3
accepted answer: http://stackoverflow.com/a/30086704
has comment: http://stackoverflow.com/comment/48096922
type: AnsweredQuestion
upvote count: 3
linked to: http://stackoverflow.com/q/7137401
linked to: http://stackoverflow.com/q/750486
has comment: http://stackoverflow.com/comment/48065473
type: Question

http://stackoverflow.com/q/29922328
has comment: http://stackoverflow.com/comment/47966151
has comment: http://stackoverflow.com/comment/47966427
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/47966079
has comment: http://stackoverflow.com/comment/47965993
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47966146
has answer: http://stackoverflow.com/a/29922381
has comment: http://stackoverflow.com/comment/47966284
upvote count: 3
downvote count: 3
has title: Remove styles from internal style sheet using jQuery
type: Question
has comment: http://stackoverflow.com/comment/47965963
tagged with: javascript
has comment: http://stackoverflow.com/comment/47966084
has body: &lt;html&gt; &lt;head&gt; &lt;style&gt; .containerTitle { background-color:silver; text-align:center; font-family:'Segoe UI'; font-size:18px; font-weight:bold; height:30px; } &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="a"/&gt; &lt;/body&gt; &lt;/html&gt; How do I remove the styles applied to .containerTitle using jQuery?
has comment: http://stackoverflow.com/comment/47966006
linked to: http://stackoverflow.com/q/19627745
score: 0
has answer: http://stackoverflow.com/a/29922442
answer count: 3
has answer: http://stackoverflow.com/a/29922563

http://stackoverflow.com/q/29850033
possible better answer: http://stackoverflow.com/a/29850216
has answer: http://stackoverflow.com/a/29850216
has title: Mutiple css classes with a javascript variable
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29850156
tagged with: javascript
has comment: http://stackoverflow.com/comment/47826165
has comment: http://stackoverflow.com/comment/47826600
type: Question
has comment: http://stackoverflow.com/comment/47828139
tagged with: http://stackoverflow.com/tag/html
tagged with: css
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/29850156
has body: How would I set mulitple CSS classes for an HTML element, with at least one normal class and one or more Javascript variables as classes? Here's how I tried to do it, putting it in like a normal script: Then I saw that someone recommend this: But I'm pretty sure that would only work for one class. Thoughts? Thanks in advance.
has comment: http://stackoverflow.com/comment/47826949

http://stackoverflow.com/comment/47834185
type: AnswerComment
comment on: http://stackoverflow.com/a/29852891
type: Comment
has text: @beardedmike could I know what is your url?
score: 0

http://stackoverflow.com/comment/48039032
has text: http://jsfiddle.net/4aj02qs9/1/ check this one, may be you want something like this
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29942741

http://stackoverflow.com/a/29852083
type: Answer
answers question: http://stackoverflow.com/q/29851636
has body: update your controllers to be: app.controller('schoolsCtrl',['$scope', function($scope) { ... }]); app.controller('urlCtrl', ['$scope', function($scope) { ...}]);
has comment: http://stackoverflow.com/comment/47830311
score: 0

http://stackoverflow.com/q/29932393
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/29932428
score: 0
tagged with: google-chrome-extension
answer count: 1
has body: I am trying to communicate between the popup.js file and the background.js file for a chrome extension. However when retrieving information using the chrome storage, the execution of the callback no longer is received by the client (popup.js) within the background.js file. function getTotals(callback){ chrome.storage.sync.get(LMSCats, function(data){ callback({"results": data}); // does not work }); } chrome.runtime.onMessage.addListener( function(request, sender, sendResponse) { // sendResponse({"message": "hi"}); //works getTotals(sendResponse); } } Within the popup.js referenced from the popup.html file chrome.runtime.sendMessage({action: "total"}, function(data){ console.log(data); }); I am not sure if I'm missing something from the documentation so any help will be appreciated. I came across chrome extension onMessage however I wasn't sure if this is related or how to get around this.
has title: Unable to retrieve message from background in popup of chrome extensions
type: UnansweredQuestion
duplicate of: http://stackoverflow.com/q/20077487
tagged with: google-chrome
linked to: http://stackoverflow.com/q/20077487

http://stackoverflow.com/comment/133786092
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/75797910
has text: Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer).

http://stackoverflow.com/q/29961571
has title: Create file using Java script/jq and save it in user pc
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/30071093
has comment: http://stackoverflow.com/comment/48045274
tagged with: html5-filesystem
type: AnsweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/48044466
has comment: http://stackoverflow.com/comment/48044319
upvote count: 1
has comment: http://stackoverflow.com/comment/48044431
possible better answer: http://stackoverflow.com/a/29961794
has comment: http://stackoverflow.com/comment/48044590
type: Question
has answer: http://stackoverflow.com/a/29961794
has comment: http://stackoverflow.com/comment/48043557
tagged with: javascript
has comment: http://stackoverflow.com/comment/48043821
answer count: 2
linked to: http://stackoverflow.com/q/7160720
downvote count: 0
tagged with: jquery
has body: I wanna do some thing like this: 1 - user insert a name 2 - after that i create a file white the user inserted name, and save file in user drive, like c drive. i need to do this using java script, but i have no idea about it, i saw some example about filesystem in Html5, but this approach, at the final, make u download the file, but i want to save this in a specified place by my self. can u give me some guide or some document about this filed? foe example i try this: http://www.noupe.com/design/html5-filesystem-api-create-files-store-locally-using-javascript-webkit.html but because i can't understood it.
has comment: http://stackoverflow.com/comment/48043881
has comment: http://stackoverflow.com/comment/48043585
favorite count: 0
has answer: http://stackoverflow.com/a/30071093

http://stackoverflow.com/comment/48074533
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29977473
has text: OP specifically said `The problem is I'm not supposed to use any server side languages`
score: 1

http://stackoverflow.com/comment/47945979
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29911926
has text: The jQuery version doesn't really accept an umlimeted amount of arguments, but you could pass in a map instead.
score: 0

http://stackoverflow.com/a/36729383
score: 3
has comment: http://stackoverflow.com/comment/88097629
upvote count: 3
answers question: http://stackoverflow.com/q/29946116
downvote count: 0
has body: You can use something like the following CSS media query: @media screen and (orientation: landscape) { .main-content { display: none; } .use-portrait { display: block; } } Which would hide your main-content and show the use-portrait div when the device is in landscape mode. You can use some additional CSS to rotate the use-portrait div to further entice the user to do that: .use-portrait { -webkit-transform: rotate(90deg); transform: rotate(90deg); } And you may need to translate it to appear correctly.
has comment: http://stackoverflow.com/comment/103190333
type: Answer

http://stackoverflow.com/comment/47835950
type: QuestionComment
comment on: http://stackoverflow.com/q/29854916
has text: @Don'tPanic Sorry, the navigation controls aren't working. The buttons are displayed fine but nothing happens when the next navigation button on the carousel is clicked.
score: 0
type: Comment

http://stackoverflow.com/a/29894694
accepted answer of: http://stackoverflow.com/q/29894462
has comment: http://stackoverflow.com/comment/47912706
has comment: http://stackoverflow.com/comment/47912294
has comment: http://stackoverflow.com/comment/47912726
type: AcceptedAnswer
downvote count: 0
score: 1
has body: You could filter the IDs out based on an array of objects you'd found before. Something like: // Array of IDs already found var existing = []; // Regex to pull the level number from the data attribute var regexp = new RegExp("#submenu-l([0-9]+)-(.*?)", "i"); console.log($(".JS_toggle-submenu[data-submenu^='#submenu-l']").filter(function() { // Get the ID var id = regexp.exec($(this).data("submenu"))[1]; // If we have already found a DOM element for this level, continue if(existing[id]) return false; // Otherwise add it to the existing found elements... existing[id] = true; // Allow it to pass through the filter return true; }).get()); Working Example
has comment: http://stackoverflow.com/comment/47913181
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/29894462

http://stackoverflow.com/a/29962459
has comment: http://stackoverflow.com/comment/48047141
has comment: http://stackoverflow.com/comment/48048736
upvote count: 1
has comment: http://stackoverflow.com/comment/48046180
has comment: http://stackoverflow.com/comment/48047434
type: Answer
has body: You can pass your Javascript array to your controller using an Ajax call : $.ajax({ url : "@Url.Action("MethodName", "ControllerName")", contentType : "application/json; charset=utf-8", dataType : "json", type : "POST", data : JSON.stringify({coordinates: markers}) }) (where markers is your JS array to pass to the controller, I guess) And your controller will look like public ActionResult MethodName(Single[] coordinates) { // ... }
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/29962306
has comment: http://stackoverflow.com/comment/48054580

http://stackoverflow.com/a/29859308
downvote count: 0
type: Answer
upvote count: 3
answers question: http://stackoverflow.com/q/29859265
score: 3
has body: Add .fn.: alert(jQuery.fn.jquery); // or alert($.fn.jquery); Or try using jQuery as a function: alert(jQuery().jquery); // or short: alert($().jquery); Michael pointed out another one: alert(jQuery.prototype.jquery); // so we can also add alert($.prototype.jquery); If you want your code to work: // add somewhere before: jQuery.extend(jQuery, {jquery: jQuery.fn.jquery}); // Than this should work just fine: alert(jQuery.jquery); alert($.jquery); Extend JQuery object ($ or jQuery) by .jquery equal to jQuery.fn.jquery. As you can see we can add any properity to jQuery. Let's do jQuery.version: $.extend($,{version:$().jquery});

http://stackoverflow.com/comment/48084439
comment on: http://stackoverflow.com/q/29982560
score: 1
has text: It doesn't require any extra arguments, you can do `myArray.map(add3)`, same result.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29876018
has title: Update data in mysql with html form inside jquery dialog
has answer: http://stackoverflow.com/a/29876101
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
has answer: http://stackoverflow.com/a/29876159
type: Question
upvote count: 2
tagged with: php
has answer: http://stackoverflow.com/a/29876204
has body: I need a help in making a page where you can see data from a mysql query. Every row is echoed as a div with a unique id. &lt;div class="column" id="&lt;?php echo $row['id']; ?&gt;"&gt; It has the same id as the data in the mysql database. Every div contains an edit button: &lt;a href="edit_column.php?id=&lt;?php echo $row['id'] ?&gt;" class="edit"&gt;Edit&lt;/a&gt; After clicking 'edit', a jQuery script is executed: $('.edit').on('click', function() { var url = this.href; var dialog = $("#dialog"); if ($("#dialog").length == 0) { dialog = $('&lt;div id="dialog" style="display:hidden"&gt;&lt;/div&gt;').appendTo('body'); } dialog.load( url, {}, function(responseText, textStatus, XMLHttpRequest) { dialog.dialog(); } ); return false; }) Then, a dialog box pops up with a HTML form and I even managed to put MySQL data into that form to edit it. But now I don't know how to continue. How should I continue to update the data in the database? I know how to update it with PHP and I even have a PHP script update_column.php but I don't know how to execute it from the dialog box and refresh the respective div element with updated data without refreshing the whole page in the browser. In edit_column.php, I only have the HTML form and the PHP script which returns data from the MySQL database.
answer count: 3
tagged with: mysql
accepted answer: http://stackoverflow.com/a/29876159
score: 2
downvote count: 0
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/29876101

http://stackoverflow.com/q/29883678
favorite count: 0
tagged with: angularjs
tagged with: ng-view
answer count: 0
tagged with: twitter-bootstrap
type: UnansweredQuestion
score: 1
upvote count: 1
has body: I'm trying to build a angular application with node.js and jade. Here's the relevant code block body div(ng-controller='AppCtrl') .navbar.navbar-default.navbar-fixed-top(role='navigation') .container .navbar-header button.navbar-toggle(type='button', data-toggle='collapse', data-target='.navbar-collapse') span.sr-only Toggle navigation span.icon-bar span.icon-bar span.icon-bar a.navbar-brand(href='/') Halló {{name}} .navbar-collapse.collapse ul.nav.navbar-nav li.active a(href='/frettir') Fréttir li a(href='/dagskra') Dagskrá li a(href='/skaramuss') Skaramúss div(ng-view) And then ng-view doesn't work. But when I comment out the navbar the ng-view works. What am I doing wrong?
type: Question
tagged with: javascript
downvote count: 0
has title: Bootstrap navbar stopping ng-view

http://stackoverflow.com/q/29955085
has title: Getting sibling text input value
upvote count: 3
has answer: http://stackoverflow.com/a/29955209
possible better answer: http://stackoverflow.com/a/29955115
has comment: http://stackoverflow.com/comment/48031077
accepted answer: http://stackoverflow.com/a/29955173
has answer: http://stackoverflow.com/a/29955115
type: AnsweredQuestion
score: 3
type: Question
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
has body: I have the following HTML username: {{username}} update And I'd like to get the value of the input field whenever that 's submit button is clicked (not the value of other input fields with the same name). I have the following jQuery, but all of it returns undefined: 'click #update_username': function(ev, template){ ev.preventDefault(); // var username_field = template.$('input[id="username_field"]').val(); // var username_field = $(ev.target).find('[name = message]').val(); var input_field = $(this).siblings($('input[id="username_field"]')).val(); console.log(input_field); // Meteor.call('updateUsername', this._id, username_field); } EDIT this is an issue of the framework Im using (Meteor.js) and the scope of 'this'
has answer: http://stackoverflow.com/a/29955173
answer count: 3
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/48121331
type: QuestionComment
comment on: http://stackoverflow.com/q/30001197
has text: Try this jquery plugin: http://malsup.com/jquery/form/ Worked very well for me.
score: 0
type: Comment

http://stackoverflow.com/comment/47858216
comment on: http://stackoverflow.com/a/29865223
score: 0
type: Comment
has text: My pleasure. There should be a "check" symbol on the left of the first paragraph of my answer, click it and the answer will be marked selected. Thanks. For your next challenge, read the HTML code first, I think they have some `id`s in the tags of the data tables.
type: AnswerComment

http://stackoverflow.com/a/30131957
upvote count: 1
has body: I use window.location.reload() and when the page is reloaded the grid columns are aligned as expected. I have tried doing this inside a recursive method call instead of reloading the page and experienced the issue you describe. If you can refresh the page instead of doing a recursive call then that would solve the problem.
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29991072
type: Answer
answers question: http://stackoverflow.com/q/29991072
score: 1

http://stackoverflow.com/comment/47999235
comment on: http://stackoverflow.com/q/29938445
type: Comment
score: 0
has text: try using json as to bridge the two programing languages
type: QuestionComment

http://stackoverflow.com/a/29876991
type: Answer
upvote count: 4
downvote count: 0
has body: This is not the rest operator but the spread operator, applied to JSX attributes. See JSX Spread Attributes. &lt;RouteHandler {...this.state} /&gt; is equivalent to React.createElement(RouteHandler, Object.assign({}, this.state)). Note that the Object spread and rest operators the JSX spread attributes feature is inspired from are not a part of the ES6 specification. There is a stage 1 proposal to include them in ES7. In the meantime, you can already use them by passing the --harmony option to the JSX compiler CLI, or the --stage 1 option to the babel CLI.
answers question: http://stackoverflow.com/q/29876665
score: 4
accepted answer of: http://stackoverflow.com/q/29876665
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47879026

http://stackoverflow.com/q/29962969
tagged with: angularjs
has body: I have a simple template that uses ng-repeat: template.html &lt;div id='tmpl'&gt; &lt;ul&gt; &lt;li ng-repeat="item in items"&gt;{{ item.desc }}&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; Inside my directive, I am compiling that template with a custom scope. and then that template is added to the page: var element = $('#my-div'); var compiledTemplate = $compile(scope.template)(customScope); element.before(compiledTemplate); $('#tmpl').show(); This works well, however the issue is that after calling the show(), I am trying to access the templates innerHeight(), but at that time ng-repeat inside the template isn't executed yet and I'm getting the value before the elements are rendered. $('#tmpl').innerHeight(); // returns value before ng-repeat is finished So, is there a secure way to do DOM manipulation of the compiled element, after ng-repeat finish processing elements?
tagged with: templates
has title: Manipulate template after compilation
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/48046449
tagged with: angular-directive
upvote count: 1
type: Question
score: 1
has answer: http://stackoverflow.com/a/29963153
downvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0
accepted answer: http://stackoverflow.com/a/29963153
linked to: http://stackoverflow.com/q/19864007

http://stackoverflow.com/comment/47914450
score: 1
has text: @AndreaGiachetto I would think so, the real reason is that DOM manipulation is meant to be done using a directive and not inside the page controller. Anyway i posted a new answer that i hope will work.
type: AnswerComment
comment on: http://stackoverflow.com/a/29894243
type: Comment

http://stackoverflow.com/q/29958079
type: Question
has answer: http://stackoverflow.com/a/29958137
accepted answer: http://stackoverflow.com/a/29958137
answer count: 2
linked to: http://stackoverflow.com/q/12250065
downvote count: 0
tagged with: javascript
linked to: http://stackoverflow.com/q/13755038
tagged with: http://stackoverflow.com/tag/csv
has answer: http://stackoverflow.com/a/29958142
favorite count: 0
has comment: http://stackoverflow.com/comment/48037039
upvote count: 2
has title: Read single data in csv data downloaded from url
has body: I'm trying to fetch the data from Yahoo! Finance to get value for currency exchange with this url assuming I'm getting currency exchange for USD to EUR in javascript http://download.finance.yahoo.com/d/quotes.csv?s=USDEUR=X&amp;f=l1 in the csv, I would receive just the one value I need. Eg. - '0.8994' Now, in same javascript file, I want this value to be pass into a variable var USDEUR; at this point, I'm not sure how to pass the value from the downloaded csv. Could someone enlighten me how to do this properly? Thanks in advance
score: 2
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/29958142

http://stackoverflow.com/a/29999150
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/48117599
downvote count: 1
answers question: http://stackoverflow.com/q/29999113
has comment: http://stackoverflow.com/comment/48117570
score: 0
has body: If you don't want to sort the array, it's better to count the number of times that arr[i] > arr[j] (j > i) and return if count >= 1. Use this as a helper method: function isArraySorted(arr){ for(var i = 0; i &lt; arr.length ; ++i) { if(arr[i] &gt; arr[i+1]) return false; } return true; } This is your new function: function solution(A) { if (isArraySorted(A)) return true; for (var i = 0; i &lt; A.length; i++) //if not sorted lets check { for (var j = i + 1; j &lt; A.length; j++) { if (A[i] &gt; A[j]) //swap only if A[i] &gt; A[j] { var temp = A[i]; A[i] = A[j]; A[j] = temp; return isArraySorted(A); // after one swap check if it's sorted and return that value. } } } }
has comment: http://stackoverflow.com/comment/48117540

http://stackoverflow.com/comment/47956275
has text: i'll edit my code after some changes and the problem persists but the error is not the same now
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29916797

http://stackoverflow.com/q/29871630
type: AnsweredQuestion
score: 3
possible better answer: http://stackoverflow.com/a/29871724
accepted answer: http://stackoverflow.com/a/29871755
has answer: http://stackoverflow.com/a/29871724
type: Question
has comment: http://stackoverflow.com/comment/47868349
answer count: 2
tagged with: arrays
downvote count: 0
has comment: http://stackoverflow.com/comment/47868447
tagged with: javascript
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/29871755
has title: Access element of array inside object jQuery
has comment: http://stackoverflow.com/comment/47868295
has body: I want to fill a canvas with a color that's an element of an array inside an object and the element index should be i but the code seems to be wrong. The variables inside color1 are already declared and contain a string which is the hex value for the color. var colorsObj = { color1: [orange,amber,apricot,tangerine,bittersweet,persimmon,salmon,peach,pumpkin] } function drawCanvas(color) { for(var i = 1; i &lt; 10; i++){ $('.app').append('&lt;canvas class="shadescolors" id="shade'+i+'" width="100" height="100"&gt;'); var canvas = document.getElementById('shade'+i); var context = canvas.getContext('2d'); canvas.width = window.innerWidth / 3; cc = canvas.width; radius = cc/2-10; canvas.height = canvas.width; context.beginPath(); context.arc(cc/2, cc/2, cc/2-10, 0, Math.PI*2, true); alert(colorsObj.color[i]); context.fillStyle = colorsObj.color[i]; context.fill(); context.lineWidth = 2; context.strokeStyle = '#8A8A8A'; context.stroke(); } } drawCanvas('color1'); The alert doesn't fire either.
upvote count: 3

http://stackoverflow.com/comment/48225383
comment on: http://stackoverflow.com/a/29992789
score: 0
type: AnswerComment
type: Comment
has text: Hi @Mackan, thanks for this good answer. I managed to debug my code down to `picker.set('disable', disabledDays);`. This is the part where it stops working. The first call of the disableDates function works and the second call stops at this line. I have no idea why. The disableDays var contains correct data. I will try to find out why..

http://stackoverflow.com/comment/48054573
has text: It didnot work. What i want to do is pass my json object to my script section like when we normally pass a variable to the script section. Is there an easy straight forward way to do this ?
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29966481

http://stackoverflow.com/comment/48048555
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29963784
has text: One last thing, the modal views when should I use it ?
score: 0

http://stackoverflow.com/comment/48086465
type: AnswerComment
comment on: http://stackoverflow.com/a/29982655
type: Comment
has text: I just retried this and am seeing the same thing in the network tab of the tools. Are you running behind a caching service/web service that needs restarting/resetting?
score: 0

http://stackoverflow.com/comment/47941253
type: AnswerComment
type: Comment
score: 0
has text: When bold and/or italic are checked and a new color is picked the bold and italic remain checked but the value gets reset for them.
comment on: http://stackoverflow.com/a/29886635

http://stackoverflow.com/comment/48089788
comment on: http://stackoverflow.com/a/29984896
type: AnswerComment
score: 0
type: Comment
has text: It IS the opposite. What's in `Blog.prototype.signature` might be accessible (for reading) via `blog.signature`, but until you write to `blog.signature`, it's more akin to a static class variable in that that until modified, `blog.signature` doesn't take up any additional space in `blog` like a real instance variable would.

http://stackoverflow.com/comment/48048963
score: 0
has text: I think is the same way to archive my goal, by destroy the select Event on clone and rebuild it again... but I don't know that code... JQuery is new to me.
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29963847

http://stackoverflow.com/a/29943138
type: Answer
answers question: http://stackoverflow.com/q/29942291
score: 0
has body: Solved by trying again from scratch. Can't say what the problem was but I'm glad it got fixed.

http://stackoverflow.com/comment/48101985
type: AnswerComment
has text: tried implmentation but having no effect, Ive added my attempt to the question - any ideas.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29989659

http://stackoverflow.com/comment/47873148
has text: I could be wrong, but my understanding is that loading tags into an HTML page after page load is really bad practice. You can't reliably count on your script being executed by the browser.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29874148

http://stackoverflow.com/q/29940521
tagged with: jquery
has title: Create gray scale effect starting from bottom to top in css3
favorite count: 0
has answer: http://stackoverflow.com/a/29940804
tagged with: http://stackoverflow.com/tag/html
has body: I need to make a picture from gray scale to rgba with CSS. I know I can change it with CSS3, But I need a smooth animation there. I need to fill the color from bottom to top with an animation. I am attaching an image to make it clear. Please check this fiddle, this is what I did so far. HTML: &lt;img src="http://static.wallpedes.com/wallpaper/resolution/resolution-of-wallpaper-pictures-with-green-eyes-hd-best-girls-full-hd-wallpapers-wallpaper-site-for-mobile-android-download-facebook-2012-app-in-the-world.jpg"/&gt; CSS: img { -webkit-animation: mymove 5s; -moz-animation: mymove 5s; -ms-animation: mymove 5s; animation: mymove 5s; width: 400px; } @-webkit-keyframes mymove { 0% { -webkit-filter: grayscale(100%); -mos-filter: grayscale(100%); -moz-filter: grayscale(100%); filter: grayscale(100%); } 100% { -webkit-filter: grayscale(0%); -mos-filter: grayscale(0%); -moz-filter: grayscale(0%); filter: grayscale(0%); } } @-moz-keyframes mymove { 0% { -webkit-filter: grayscale(100%); -mos-filter: grayscale(100%); -moz-filter: grayscale(100%); filter: grayscale(100%); } 100% { -webkit-filter: grayscale(0%); -mos-filter: grayscale(0%); -moz-filter: grayscale(0%); filter: grayscale(0%); } } @-ms-keyframes mymove { 0% { -webkit-filter: grayscale(100%); -mos-filter: grayscale(100%); -moz-filter: grayscale(100%); filter: grayscale(100%); } 100% { -webkit-filter: grayscale(0%); -mos-filter: grayscale(0%); -moz-filter: grayscale(0%); filter: grayscale(0%); } } /* Standard syntax */ @keyframes mymove { 0% { -webkit-filter: grayscale(100%); -mos-filter: grayscale(100%); -moz-filter: grayscale(100%); filter: grayscale(100%); } 100% { -webkit-filter: grayscale(0%); -mos-filter: grayscale(0%); -moz-filter: grayscale(0%); filter: grayscale(0%); } } Thanks in advance.
tagged with: css
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29940804
type: Question
has comment: http://stackoverflow.com/comment/48001896
tagged with: javascript
score: 4
upvote count: 4
downvote count: 0
has comment: http://stackoverflow.com/comment/48001932
answer count: 1

http://stackoverflow.com/a/29915981
downvote count: 0
score: 3
accepted answer of: http://stackoverflow.com/q/29915904
upvote count: 3
answers question: http://stackoverflow.com/q/29915904
type: AcceptedAnswer
has body: Having multiple duplicated IDs is against HTML standards. If however this is out of your control (from a plugin or something), then do: $("[id=a]").addClass("highlightPathStyle"); Otherwise if you have control over the markup, add a class and select on the class: $(".yourClass").addClass("highlightPathStyle")
type: Answer

http://stackoverflow.com/a/29952501
score: 3
type: AcceptedAnswer
downvote count: 0
has body: Typical, as soon as I post a question I find the answer. The problem was a GET route I had specified to the view, the routes override the controller
type: Answer
accepted answer of: http://stackoverflow.com/q/29952234
upvote count: 3
answers question: http://stackoverflow.com/q/29952234

http://stackoverflow.com/comment/47917325
comment on: http://stackoverflow.com/q/29897194
has text: The spaces are there - I'm sure he is displaying them in a browser which shows them as a single space
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/34016480
type: Answer
answers question: http://stackoverflow.com/q/29901341
score: 0
has body: If you are using Smarty template engine and get Uncaught SyntaxError: Unexpected token , use the {literal} tags: &lt;script&gt; {literal} (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-XXXXXXXX-X', 'auto'); ga('send', 'pageview'); {/literal} &lt;/script&gt;

http://stackoverflow.com/comment/48021768
score: 0
comment on: http://stackoverflow.com/q/29908568
has text: Sorry I wasn't aware of this, I'll post my solution tonight.Thanks for the info!
type: Comment
type: QuestionComment

symfony1
tag name: symfony1
tags question: http://stackoverflow.com/q/29917182
type: Tag

http://stackoverflow.com/q/29993223
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29993374
tagged with: css
has answer: http://stackoverflow.com/a/29993327
upvote count: 1
has body: I would like that each option selected on the four lines change to opaque when clicked. Also I need to hide the radio. Sorry for my poor english "/ See here: http://leagueipsum.blogspot.com.br/p/boosting_1.html
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
score: 1
has title: How to make an label opaque when clicked?
favorite count: 0

http://stackoverflow.com/q/29907982
type: UnansweredQuestion
has body: I am very new to MVC and need help how I should go about to create an application with the following features. What I want to do I have a form that asks some questions to users, and for each question users must be able to add as many items as they want as their answers. For example, say the application is a recipe book management (Not my actual project), and a user enters the following information: Recipe Name (e.g. "Orange Lemonade") Description (e.g. "The best lemonade...") Fruit Ingredients Select fruit from an existing list or type fruit (e.g. lemon) Enter quantity (e.g. 3) NOTE: There are many other ingredients or lists such as Vegetable Ingredient list, etc, and they have to be entered the same way as Fruit Ingredient The picture below simply describes the idea... Here's the code I used: JSFIDDLE (I referred to this site) My Question How should I go about to store the list of ingredients like Fruit, Vegetable, and the actual application would have many more lists in one form. Is there a way to call my repository methods to add/delete a list item every time an item is added/deleted? Or should I save each list to an array and store them when the "Save" button for the form was clicked? Edit My question probably wasn't clear but I would like to know if there is a standard way or recommended way to achieve this. If there's none and whichever the method is fine, then I would like to call the repository every time user makes a change to the list. (Users must be able to save the recipe and come back to edit it until they submit the final version of the recipe.) And I'd like to know is how to call the method to save list items to DB from the client side in MVC (not using web controls like ScriptManager).
tagged with: c#
linked to: http://stackoverflow.com/q/29837547
has answer: http://stackoverflow.com/a/29909172
type: Question
has title: How to save list items to DB in MVC when add/delete list items is managed on the same page
tagged with: asp.net-mvc-5
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/68678578
score: 0
linked to: http://stackoverflow.com/q/23049902
has comment: http://stackoverflow.com/comment/47938504

list
type: Tag
tags question: http://stackoverflow.com/q/29942579
tags question: http://stackoverflow.com/q/29871445
tag name: list
tags question: http://stackoverflow.com/q/29980053
tags question: http://stackoverflow.com/q/29979066
tags question: http://stackoverflow.com/q/29916714
tags question: http://stackoverflow.com/q/29848054
tags question: http://stackoverflow.com/q/29916816

http://stackoverflow.com/q/29996394
upvote count: 1
has title: Regex to discard exceeding input while allowing optional digits and partial match
favorite count: 0
has body: I'm working on a regex to implement these features: Allow an optional digit; Discard part of input that exceeds desired length; If there isn't a full match, allow partial matches. UPDATE: Know when there's only a partial match, or a complete match (it would be complete when all required digits are present) Currently I'm handling this 4th requirement counting optional digits in pattern, but unfortunately this is out of place (handled in consumer code instead of service code) END OF UPDATE I have the following input and desired output: +-------+--------+ | input | output | +-------+--------+ | 1 | 1 | +-------+--------+ | 12 | 12 | +-------+--------+ | 123 | 123 | +-------+--------+ | 1234 | 123 | +-------+--------+ I have designed this generic regex: ^(\d*?)(\d?)(\d?).*?$ For every input, however, I got 12. How should I change it to have the desired output? Sample: https://www.regex101.com/r/vS3bH3/1
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29996570
tagged with: regex
has answer: http://stackoverflow.com/a/29996504
downvote count: 0
score: 1
type: Question
tagged with: javascript
answer count: 2

http://stackoverflow.com/comment/47885018
type: QuestionComment
comment on: http://stackoverflow.com/q/29879384
has text: Ignore the first comment, that happens when you have multiple directives on a html element. I am asking you to console the value of the scope.query before and after you assign it the selected value. Now select different options from the dropdown and see if the previous changes are reflected or not. Means, the scope variable inside the directive might be updating with each selection of option. This tells you , it is a child/parent scope issue. Try this.
score: 0
type: Comment

dreamweaver
type: Tag
tag name: dreamweaver
tags question: http://stackoverflow.com/q/29906396
tags question: http://stackoverflow.com/q/29968991
tags question: http://stackoverflow.com/q/29884873

http://stackoverflow.com/a/29863575
type: Answer
answers question: http://stackoverflow.com/q/29863361
has body: I believe the issue is in your data being passed in: data: "{'Name :' + nm + 'code :' + cde +'category :'+ cat +'date :'+ dt +'price :'+ pr +'img_name :' + f3}" I see two possible issues there. First, your '+' are being treated as literals there as they are surrounded by double quotes that are never escaped. What you are trying to achieve, I believe, is: data: "{'Name :'"+ nm +"'code :'"+ cde +"'category :'"+ cat +"'date :'"+ dt +"'price :'"+ pr +"'img_name :'"+ f3 +"}" However that still has a potential problem as I believe that json will be malformed. The expected syntax of a json string, with string variables at least, is '{"key1":"value1","key2":"value2"}'. A better way to make sure your right and to save yourself work is to use JSON.stringify to do the work for you. var temp = {}; temp.Name = nm; temp.code = cde; temp.category = cat; temp.date = dt; temp.price = pr; temp.img_name = f3; var data = JSON.stringify(temp);
score: 0
has comment: http://stackoverflow.com/comment/47865350
has comment: http://stackoverflow.com/comment/47865715

http://stackoverflow.com/a/29996897
has body: Javascript setTimeout(function(){ $.ajax({url: "get_message.php", success: function(result){ var num_records = result.length, i, content; for(i=0;i&lt;num_records;i++){ if (result[i]['character_name'] !== null){ content += "&lt;div class='left'&gt;" + result[i]['character_name'] +": &lt;/div&gt;"; } else{ content += "&lt;div class='left'&gt;" + result[i]['user_name'] +": &lt;/div&gt;"; } content += "&lt;div class='center'&gt;" + result[i]['message'] + "&lt;/div&gt;&lt;div class='right'&gt;" + result[i]['time'] + "&lt;/div&gt;"; } $('.read_chat').html(content); }}); }, 5000); get_message.php $get_m = "select user_name, message, time, character_name from Chat NATURAL JOIN User LEFT OUTER NATURAL JOIN Character where Chat.game_id =".$_SESSION[game_id]." ORDER BY Chat.chat_id;"; $messages = $db-&gt;query($get_m); $response = array(); foreach ($messages as $row) { $response[] = $row; } echo json_encode($response);
type: Answer
has comment: http://stackoverflow.com/comment/48113781
answers question: http://stackoverflow.com/q/29996761
has comment: http://stackoverflow.com/comment/48113706
score: 0

http://stackoverflow.com/q/29914372
type: Question
has title: Can css-loader return just a string?
tagged with: webpack
tagged with: javascript
score: 0
has body: In my webpack config if I wanted to use css-loader to then use file-loader how can I get css-loader to do it's magic and then still return what file-loader wants so it can save it as a .css Example config { test: /\.scss$/, loaders: [ 'file-loader?name=[name].css', 'css-loader', 'autoprefixer-loader', 'sass-loader' ] } Can it be done?
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47996373
has comment: http://stackoverflow.com/comment/48008221
answer count: 0

http://stackoverflow.com/q/29930637
score: 0
has title: Using Bootstrap 3, how can I make dropdown menus expand with the same animation that the mobile toggle uses?
linked to: http://stackoverflow.com/q/26267207
favorite count: 0
has comment: http://stackoverflow.com/comment/47984896
upvote count: 2
tagged with: twitter-bootstrap
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47984747
tagged with: http://stackoverflow.com/tag/html
tagged with: css
duplicate of: http://stackoverflow.com/q/12115833
answer count: 0
linked to: http://stackoverflow.com/q/12115833
downvote count: 2
has body: By default, the mobile toggle expands to reveal the menu with a slideout animation. I want the dropdown menus to open using the same animation. I was able to get close by changing their classes from .dropdown-menu to .collapse as shown here, but this requires me to set a different ID for each dropdown which I'm trying to avoid. Is there any way to add the animation without having to create separate IDs?
type: Question
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/a/29930879
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/47985643
has comment: http://stackoverflow.com/comment/47985647
accepted answer of: http://stackoverflow.com/q/29930648
upvote count: 2
has comment: http://stackoverflow.com/comment/47985657
type: Answer
has comment: http://stackoverflow.com/comment/47985302
score: 2
has comment: http://stackoverflow.com/comment/47985574
has comment: http://stackoverflow.com/comment/47985259
has comment: http://stackoverflow.com/comment/47985401
has body: You need to change the dataType to jsonp to avoid the CORS restriction. JSONP is a technique used in JavaScript programs running in web browsers to request data from a server in a different domain. Typically this is prohibited by web browsers because of the same-origin policy. Wikipedia provides a far better description than I possibly could. See here. When it comes to making GET requests to APIs, this is something you will encounter regularly, so it's worth knowing. The jquery code allows you to view the JSON object in the console, which you can then manipulate as you please. The way I have currently included will change the div to the timestamp as returned by the JSON object. This jsfiddle should demo what you are looking for http://jsfiddle.net/zmxv2j7q/ $(document).ready(function(){ $("button").click(function(){ $.ajax({ type: 'GET', url:"http://bustime.mta.info/api/siri/vehicle-monitoring.json", data: {key: '##################', OperatorRef:'MTA%20NYCT', LineRef:'B54', VehicleRef:'9531' }, dataType: 'jsonp', async: false, success: function(result){ console.log(result.Siri) $("#div1").html(result); $("#div1").html(result.Siri.ServiceDelivery.ResponseTimestamp) }}); }); });
answers question: http://stackoverflow.com/q/29930648

http://stackoverflow.com/comment/48369420
has text: Done! This will solve your problem.. took a lot of work haha!
score: 0
type: Comment
comment on: http://stackoverflow.com/a/30081579
type: AnswerComment

http://stackoverflow.com/comment/47860749
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29867847
has text: the fiddle appears to not be doing what i would like either. it is not sticking and i scroll right past it. I'm pretty new to javascript, what do you mean by including jQuery?
score: 0

http://stackoverflow.com/q/29987041
score: 0
answer count: 2
tagged with: css
has answer: http://stackoverflow.com/a/29987135
has answer: http://stackoverflow.com/a/29987472
has title: Add an icon to html through css
has comment: http://stackoverflow.com/comment/48093430
has comment: http://stackoverflow.com/comment/48093317
tagged with: javascript
type: UnansweredQuestion
has body: I was wondering what the possibility of adding an icon to a item through css. Currently in my table (using angular) if a certain value (score) is greater that 75% I make the row in the table red. That is a bit intrusive so since I am using font-awesome elsewhere on the page I though maybe I might try adding a star next to the score. To change to red I am using ng-style and calling a method which evaluates the score, then sets the css accordingly. {{$index + 1}} {{item.name.replace("_"," ")}} {{item.score.toFixed(3)}} And here is the setColor() method in the js: $scope.setColor = function(score){ if (score >= 75){ return { background: '#FF4747', color : '#FFFFFF' } }else if( score >= 50 && score < 75){ return {background : '#FFFF47' } } }; I was wondering the possibility of maybe using an ng-show though I didnt know if inside ng-show you could call a method. Like show if it's greater than 75% kinda thing? I would just ideally like to show next to {{item.score.toFixed(3)}} when greater than 75%. What is the best solution to this? Thanks in advance.
tagged with: http://stackoverflow.com/tag/html
tagged with: angularjs
type: Question

http://stackoverflow.com/q/29960077
has title: How to show callback response in browser
score: 4
has comment: http://stackoverflow.com/comment/48041276
answer count: 1
tagged with: javascript
favorite count: 0
type: UnansweredQuestion
has body: I want to do this simple thing. Please can anybody help me this out. Any positive answer will be appreciated.My simple question is how do I print final array to the browser. I am trying to display it to the browser but unable to do so. Please help me in the regard. I am new to the system. var http = require('http'); var mysql = require('mysql'); http.createServer(function(req, res) { var connection = mysql.createConnection({ host : 'localhost', user : 'DB_USER', password : 'DB_PASS', database : 'DB_NAME', }); connection.connect(); var resp = []; async.parallel([ function(callback){ setTimeout(function(){ soap.createClient(url, function(err, client) { client.setSecurity(new WSSecurity('USER_NAME', 'PASSWORD')); client.SubmitMessage(strContent1, function(err, result) { resp.push(result.message.payload.unit_of_business_results['premium_details']); }); }); }, 200); }, function(callback){ setTimeout(function(){ soap.createClient(url, function(err, client) { client.setSecurity(new WSSecurity('USER_NAME', 'PASSWORD')); client.SubmitMessage(strContent2, function(err, result) { resp.push(result.message.payload.unit_of_business_results['premium_details']); }); }); }, 100); }, function(callback){ setTimeout(function(){ soap.createClient(url, function(err, client) { client.setSecurity(new WSSecurity('USER_NAME', 'PASSWORD')); client.SubmitMessage(strContent3, function(err, result) { resp.push(result.message.payload.unit_of_business_results['premium_details']); }); }); }, 100); } ], // optional callback function(err, results){ // the results array will equal ['one','two'] even though // the second function had a shorter timeout. }); res.writeHead(200); res.end(JSON.stringify(resp)); }).listen(8020);
tagged with: node.js
has comment: http://stackoverflow.com/comment/48041107
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/29961105
upvote count: 5

http://stackoverflow.com/comment/47954866
comment on: http://stackoverflow.com/a/29916580
has text: Nothing gets printed out. I get this instead The requested URL /92507 was not found on this server.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/29924793
type: Question
has title: How to draw to google charts in one div?
tagged with: charts
tagged with: google-visualization
tagged with: javascript
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
has body: I'm using google Charts API to draw some charts of my data. I have something like: Obj1: At1, at2, etc. Obj2: ... Objx: So, i don't know how many objets come from the web service i'm using. How can i draw more than one google chart inside of a single div? I have this: var chart = new google.visualization.ColumnChart(document.getElementById('chart_div')); for (var i = 0, len = vessels.vessel.length; i &lt; len; i++) { var data = new google.visualization.DataTable(); data.addColumn('string', 'Vessel'); data.addColumn('number', 'RPM'); data.addRow([ vessels.vessel[i].vesselname, parseFloat(vessels.vessel[i].rpm) ]); chart.draw(data); } But only draw the last item. Any help?
tagged with: frontend
type: UnansweredQuestion
answer count: 0
downvote count: 0
score: 1

http://stackoverflow.com/comment/47904038
type: QuestionComment
score: 0
has text: I added the hierachy to the question.
comment on: http://stackoverflow.com/q/29883534
type: Comment

http://stackoverflow.com/comment/47928980
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29902837
has text: What error are you getting? is it sending? does the php run by itself? does it receive? any errors in the console?

http://stackoverflow.com/comment/47859517
comment on: http://stackoverflow.com/q/29866010
score: 0
has text: @RobinL: that totally did it. I should have thought of that haha. Thanks!
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29927024
type: Answer
answers question: http://stackoverflow.com/q/29926677
score: 0
has body: var jsonData = [{"name":"age","value":31}, {"name":"height (inches)","value":62}, {"name":"location","value":"Boston, MA"}, {"name":"gender","value":"male"}]; var newObj = []; jsonData.forEach(function(d){ var obj = {}; obj[d.name] = d.value; newObj.push(obj) }); console.log(JSON.stringify(newObj))

http://stackoverflow.com/comment/47850330
type: AnswerComment
type: Comment
score: 0
has text: Open your browser console and let me know which errors occur?
comment on: http://stackoverflow.com/a/29862397

http://stackoverflow.com/a/42039494
score: 2
answers question: http://stackoverflow.com/q/29922088
upvote count: 2
has body: var output = HtmlService.createHtmlOutput('Hello, world!'); output.addMetaTag('viewport', 'width=device-width, initial-scale=1'); this will help
accepted answer of: http://stackoverflow.com/q/29922088
type: AcceptedAnswer
downvote count: 0
type: Answer

http://stackoverflow.com/comment/47937062
has text: Oh, so it works now? It was kinda difficult to work with `localStorage` on JSFiddle because it sometimes used the domain `jsfiddle.net` and sometimes `fiddle.jshell.net`…
comment on: http://stackoverflow.com/q/29906228
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47997420
type: AnswerComment
has text: The AJAX request seems to work out right, but I'm confused about the respond_to action. When I add it to the votes controller, I get this error message: `Missing template votes/create, application/create with {:locale=>[:en], :formats=>[:html], :variants=>[], :handlers=>[:erb, :builder, :raw, :ruby, :coffee, :jbuilder]}.`
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29937623

http://stackoverflow.com/comment/47893839
type: QuestionComment
score: 0
has text: hey, thanks for the quick response. Ive gone ahead and run the JSON through a another couple validators and nothing has told me its invalid.
comment on: http://stackoverflow.com/q/29884780
type: Comment

http://stackoverflow.com/comment/48122447
comment on: http://stackoverflow.com/a/29998501
type: AnswerComment
has text: @SMcCrohan As it happens, I'm mostly splitting strings with lots of separators, so this will be fastest for me. Many thanks for the performance testing.
type: Comment
score: 0

http://stackoverflow.com/q/29985506
has title: WKWebView wait for DOM rendering before triggering native code
has answer: http://stackoverflow.com/a/30014944
tagged with: ios
downvote count: 0
tagged with: javascript
type: UnansweredQuestion
has body: I have a hybrid iOS app which contains a WKWebView, and I have a JavaScript function callNative can call Objective C native code in the main thread. In my JavaScript, I have the following structure modifyDOM(); // e.g. .show(), and .hide() stuff callNative('animateWKWebViewFrame'); For some reason, animateWKWebViewFrame (native code) is called before modifyDOM completes and is fully rendered. (This causes a visual glitch.) How can I force full rendering of DOM modifications before calling native code?
tagged with: wkwebview
has answer: http://stackoverflow.com/a/30044430
score: 6
favorite count: 0
type: Question
tagged with: objective-c
upvote count: 6
answer count: 2
has comment: http://stackoverflow.com/comment/48408086
tagged with: hybrid-mobile-app

android
tags question: http://stackoverflow.com/q/29922297
tags question: http://stackoverflow.com/q/29924588
tags question: http://stackoverflow.com/q/29931532
tags question: http://stackoverflow.com/q/29878486
tags question: http://stackoverflow.com/q/29848084
tags question: http://stackoverflow.com/q/29966517
tags question: http://stackoverflow.com/q/29867715
tags question: http://stackoverflow.com/q/29850805
tags question: http://stackoverflow.com/q/29922621
tags question: http://stackoverflow.com/q/29884635
tags question: http://stackoverflow.com/q/29977285
tags question: http://stackoverflow.com/q/29856670
tags question: http://stackoverflow.com/q/29967496
tags question: http://stackoverflow.com/q/29966086
tags question: http://stackoverflow.com/q/29949928
tags question: http://stackoverflow.com/q/29998033
tags question: http://stackoverflow.com/q/29973318
tags question: http://stackoverflow.com/q/29919633
tags question: http://stackoverflow.com/q/29965452
tags question: http://stackoverflow.com/q/29969714
tags question: http://stackoverflow.com/q/29873355
tags question: http://stackoverflow.com/q/29991207
tags question: http://stackoverflow.com/q/29982764
tags question: http://stackoverflow.com/q/29985958
tags question: http://stackoverflow.com/q/29991962
tags question: http://stackoverflow.com/q/29961956
tags question: http://stackoverflow.com/q/29999106
tags question: http://stackoverflow.com/q/29864115
tags question: http://stackoverflow.com/q/29966519
tags question: http://stackoverflow.com/q/29991065
tags question: http://stackoverflow.com/q/29964357
tags question: http://stackoverflow.com/q/29940742
tags question: http://stackoverflow.com/q/29882460
tags question: http://stackoverflow.com/q/29931809
tags question: http://stackoverflow.com/q/29992561
tags question: http://stackoverflow.com/q/29930066
tags question: http://stackoverflow.com/q/29978082
tags question: http://stackoverflow.com/q/29936825
tags question: http://stackoverflow.com/q/29864585
tags question: http://stackoverflow.com/q/29870519
tags question: http://stackoverflow.com/q/29905821
tags question: http://stackoverflow.com/q/29846318
tags question: http://stackoverflow.com/q/29857179
tags question: http://stackoverflow.com/q/29918859
tags question: http://stackoverflow.com/q/29892119
tags question: http://stackoverflow.com/q/29968081
tags question: http://stackoverflow.com/q/29919609
tag name: android
tags question: http://stackoverflow.com/q/29934054
tags question: http://stackoverflow.com/q/29906818
tags question: http://stackoverflow.com/q/29959598
tags question: http://stackoverflow.com/q/29935705
type: Tag
tags question: http://stackoverflow.com/q/29910478
tags question: http://stackoverflow.com/q/29886352
tags question: http://stackoverflow.com/q/29857285

http://stackoverflow.com/a/29966901
type: Answer
accepted answer of: http://stackoverflow.com/q/29966382
score: 1
upvote count: 1
has body: With a small fixation you can leave this as that: Demo function fromSeconds(seconds, showHours) { if(showHours) { var hours = Math.floor(seconds / 3600), seconds = seconds - hours * 3600; } var minutes = ("0" + Math.floor(seconds/60)).slice(-2); var seconds = ("0" + parseInt(seconds%60,10)).slice(-2); if(showHours) { var timestring = hours + ":" + minutes + ":" + seconds; } else { var timestring = minutes + ":" + seconds; } return timestring; } var video = $('#home_explainer_placeholder'); video.bind("timeupdate", function () { $('#currentTime').html(fromSeconds(video[0].currentTime)); $('#remTime').html(fromSeconds(video[0].duration - video[0].currentTime)); $('#totalTime').html(fromSeconds(video[0].duration)); });
answers question: http://stackoverflow.com/q/29966382
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/29866145
favorite count: 0
has comment: http://stackoverflow.com/comment/47857358
has comment: http://stackoverflow.com/comment/47857378
has body: I've been writing Javascript for years, but just now realized I don't entirely understand how these "HTML-y" methods actually interact with the DOM. My assumption is that when HTML is interpreted into the DOM, the browser keeps references as to which HTML element became which DOM node. So for .getElementById when you select an element, the browser returns the relevant node by reference. Why not just do .getNodeById then and be more correct? My assumption is that .innerHTML is interpreted by the browser into the DOM at runtime. However, in older browsers like IE7, .innerHTML cannot be used to create table nodes. This suggests to me that it was originally intended just to modify the text properties of existing nodes, but then it seems strange that it exists at all, and we don't just use .innerText. I guess I'm just confused by some Javascript history.
accepted answer: http://stackoverflow.com/a/29866183
has title: How do .getElementById() and .innerHTML() bridge between HTML and the DOM?
score: 5
linked to: http://stackoverflow.com/q/29798949
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29866302
upvote count: 5
has comment: http://stackoverflow.com/comment/47857321
type: Question
possible better answer: http://stackoverflow.com/a/29866302
answer count: 2
has answer: http://stackoverflow.com/a/29866183
has comment: http://stackoverflow.com/comment/47857388
downvote count: 0
tagged with: javascript

underscore.js
tags question: http://stackoverflow.com/q/29999972
tags question: http://stackoverflow.com/q/29963412
type: Tag
tags question: http://stackoverflow.com/q/29955054
tag name: underscore.js
tags question: http://stackoverflow.com/q/29985568
tags question: http://stackoverflow.com/q/29940875
tags question: http://stackoverflow.com/q/29878380
tags question: http://stackoverflow.com/q/29929066
tags question: http://stackoverflow.com/q/29889163
tags question: http://stackoverflow.com/q/29935254
tags question: http://stackoverflow.com/q/29965038
tags question: http://stackoverflow.com/q/29991444
tags question: http://stackoverflow.com/q/29976138
tags question: http://stackoverflow.com/q/29872840
tags question: http://stackoverflow.com/q/29884182
tags question: http://stackoverflow.com/q/29862292
tags question: http://stackoverflow.com/q/29903524

http://stackoverflow.com/q/29990378
upvote count: 1
has answer: http://stackoverflow.com/a/29990833
accepted answer: http://stackoverflow.com/a/29990833
tagged with: asynchronous
favorite count: 0
tagged with: angularjs
has body: I am trying to loop through an object and then pulling in data for each iteration from two service API functions which will then return data and populate my current iteration object with the results that are returned. Now, as these service functions are using the $http object, promises are returned and therefore I need to wait for the response in order to populate my object. It is my first time using the $q AngularJS library and I am not sure whether I am able to use it in the manner I am using it. It us not returning correctly so I assume I am not and I can't seem to get my code working. Here is my code: Controller function $scope.returnTasksAndPayments = function() { var defer = $q.defer(); var promisesTasks = []; var promisesPayments = []; for(var i in $scope.projects) { promisesTasks[i] = ProjectService.fetchTaskData($scope.projects[i].project_id); promisesPayments[i] = ProjectService.fetchPaymentsData($scope.projects[i].project_id); } $q.all(promisesTasks, promisesPayments).then(function(promiseArray) { console.log(promiseArray); }); }; and my service functions: this.fetchProjectsData = function(options) { return api().get("http://dashboards.blurgroup.dev/src/projectPayments/services/JSONdata.json", { order : options.order, page : options.page, page_size : options.page_size, status : options.status, search : options.search, assigned : options.assigned }); }; this.fetchTaskData = function(options) { return api().get("http://dashboards.blurgroup.dev/src/projectPayments/services/JSONdataTasks.json", { }); }; this.fetchPaymentsData = function(options) { return api().get("http://dashboards.blurgroup.dev/src/projectPayments/services/JSONdataPayments.json", { }); }; As you can see, I am trying to loop through my $scope.projects object, calling the two functions for each iteration and putting them into separate promise object and then using $q.all to check these two promise objects are fulfilled. This doesn't seem to be working as it should and it seems the data stored…
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29990628
downvote count: 0
score: 1
type: Question
possible better answer: http://stackoverflow.com/a/29990628
answer count: 2
has title: Pass multiple promises to $q.all not working.
tagged with: javascript

http://stackoverflow.com/q/29988940
tagged with: oracle-apex
has body: I have problem with displaying address in text field in one of the apex pages region. Currently I have longitude and latitude text fields, which read their values from draggable marker from the google map. (When you drag the marker, the program automatically retrieve geocode and it assigns it directly to appropriate text fields, it works perfectly fine). Now I want to do the same for address, when I drag the marker into any position I want to receive the closes matching address, which will go to the text field. The problem is that I do not know how to format and set right function to display this marker in the text field, all I have now is that when I type the address to the text field and I drag the marker the address is being automatically formatted but it is not updating its current position. The way I used to get the geocode into the text fields is by using procedure in the database, which is later called by apex page using PL/SQL and JavaScript. Here is my code so far: create or replace PROCEDURE SHOW_LOCATION ( map_div IN VARCHAR2 DEFAULT 'map-canvas', issue_street_address IN VARCHAR2, issue_post_code IN VARCHAR2, city IN VARCHAR2, lat_item IN VARCHAR2, long_item IN VARCHAR2) is a_mapstr VARCHAR2 (32000); begin a_mapstr := ' &lt;script src="https://maps.googleapis.com/maps/api/js?v=3.exp&amp;sensor=false"&gt; &lt;/script&gt; &lt;script type="text/javascript"&gt; var map; var marker; function initialize(myAddress, myLat, myLng) { var mapOptions = { zoom: 12, mapTypeId: google.maps.MapTypeId.ROADMAP } map = new google.maps.Map(document.getElementById('||''''|| map_div ||''''||'),mapOptions); geocoder = new google.maps.Geocoder(); geocoder.geocode( { '||''''||'address'||''''||': myAddress}, function(results, status) { if (status == google.maps.GeocoderStatus.OK) { var markerOptions = { map: map, draggable: true, animation: google.maps.Animation.DROP, flat: false, position: results[0].geometry.location } map.setCenter(results[0].geometry.location); marker = new go…
type: UnansweredQuestion
has title: Closes matching address (Google maps) APEX procedure
answer count: 0
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/48181502
has comment: http://stackoverflow.com/comment/48107477
score: 0
tagged with: plsql
tagged with: geocode
tagged with: google-maps

http://stackoverflow.com/comment/48050043
has text: @SebastianTroy it's loading template with data. So `x` is being passed via `template` method.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29965038

http://stackoverflow.com/a/29921778
type: AcceptedAnswer
downvote count: 0
has body: You can also use openByUrl() in your scripts, so users can just paste a link. but if you must validate the ID: ss = SpreadsheetApp.getActiveSpreadsheet(); function validate(){ //"sheetRef" is the name of the cell where you enter the id //this function takes the string value of "sheetRef" //and replaces it with the validation result. var sheetRefCell = ss.getRangeByName("sheetRef"); var sheetRefString = sheetRefCell.getValue(); var validationResult = '{' + sheetRefString + '}'; try { validationResult = validationResult + ' \n $ references: \n [' + SpreadsheetApp.openById(sheetRefString).getName() + ']'; } catch (e) { validationResult = validationResult + ' \n $ is an invalid reference: \n [' + e + ']'; } finally { sheetRefCell.setValue(validationResult); } } when you run this it will replace the value entered in your 'sheetRef' (ID) cell with the validation result message. I recommend that you also add a time-based trigger to contininuously revalidate your ID. Then you can add another cell to your spreadsheet which will extract the validated ID from 'sheetRef'. This cell should contain the formula: = IF (IFERROR( SEARCH( 'invalid' , sheetRef ), 0 ) &gt; 0, "Invalid", IFERROR( REGEXEXTRACT( sheetRef,"{(.*?)}" ), "Undetermined" ) ) So the cell with the above formula will EITHER display a valid id or "Invalid"/"Undetermined".
answers question: http://stackoverflow.com/q/29907943
type: Answer
accepted answer of: http://stackoverflow.com/q/29907943
upvote count: 1
has comment: http://stackoverflow.com/comment/48123759
score: 1
has comment: http://stackoverflow.com/comment/48135758

http://stackoverflow.com/q/29982993
has comment: http://stackoverflow.com/comment/48085260
tagged with: javascript
has answer: http://stackoverflow.com/a/29983305
answer count: 2
downvote count: 0
tagged with: jquery
favorite count: 0
accepted answer: http://stackoverflow.com/a/29983305
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/29983156
tagged with: checkbox
tagged with: css
has answer: http://stackoverflow.com/a/29983156
type: AnsweredQuestion
score: 2
upvote count: 2
has comment: http://stackoverflow.com/comment/48085355
has title: checkbox unique id conflict with script for styling
type: Question
has body: This is the style I want to achive: http://jsfiddle.net/f07t3qkn/ My current checkboxes has same id which is 'level'. There's a script below that identify the id(level) to perform certain task so I cannot have unique id. However in the checkbox style that I want to achieve, ids are unique for each checkbox.This is being the drawback as it doesn't allow the script to function if the checkbox style achieved. Now, how to alter the script so that it can allow unique id for checkbox for the purpose of styling as well as to perform that function. Or is there a way for the script to identify the checkboxes, which id starting with the word 'level' instead of by a fixed id like 'level'? If can, maybe I can use id like 'level_1', 'level_2'....I'm worn out trying this..Exact code would be very helpful.Thanks in advance. My current HTML for checkboxes Primary Upper Secondary University Lower Secondary Pre University Other Script that make use of the id to perform other task

http://stackoverflow.com/q/29858599
accepted answer: http://stackoverflow.com/a/29858791
score: 0
has comment: http://stackoverflow.com/comment/47843090
answer count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/47843598
has comment: http://stackoverflow.com/comment/47843187
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has answer: http://stackoverflow.com/a/29858791
type: AnsweredQuestion
has body: I have seen many sites with a navigation bar that will convert to a button that opens a menu if the page is scaled down too much. An example of this: www.aurelswonderland.com (Scale the windows width down and watch the nav bar dissapear) How can I implement this myself?
type: Question
has title: How can I make a navigation bar that converts to a button for a sidebar when scaled down too much?
has comment: http://stackoverflow.com/comment/47844423
tagged with: javascript

http://stackoverflow.com/comment/48109977
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29994908
has text: Your code is 100% fine, there must be a problem with the other API your using that converts the data-path attr to an image etc. What are you using?
score: 0

http://stackoverflow.com/comment/47984467
type: Comment
type: QuestionComment
has text: Hmm, yeah that's not a typical hierarchy, I'll look at it again later when I get off
comment on: http://stackoverflow.com/q/29903426
score: 0

passport-local
tags question: http://stackoverflow.com/q/29988569
type: Tag
tags question: http://stackoverflow.com/q/29970008
tag name: passport-local

http://stackoverflow.com/a/33139159
type: Answer
upvote count: 1
has body: I've meet the same situation that some items was missing. What I have done was set the typeahead option limit to 10. And it works for me.
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/29925753
has comment: http://stackoverflow.com/comment/57145000
has comment: http://stackoverflow.com/comment/71865122

http://stackoverflow.com/comment/48178673
score: 0
type: Comment
has text: Yes, this scenario may happen, but in this case you can do nothing with the current connection, the client can retry by establishing another connection and send the necessary data, the currently received data is dropped.
type: AnswerComment
comment on: http://stackoverflow.com/a/29900282

http://stackoverflow.com/comment/48003322
has text: http://stackoverflow.com/questions/7742781/why-javascript-only-works-after-opening-developer-tools-in-ie-once
comment on: http://stackoverflow.com/q/29941156
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29894543
tagged with: forms
has answer: http://stackoverflow.com/a/29894954
has answer: http://stackoverflow.com/a/29894760
has title: Form is not submitting in jQuery ajax success
has comment: http://stackoverflow.com/comment/47912169
has comment: http://stackoverflow.com/comment/47912289
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47912201
tagged with: ajax
score: 0
answer count: 3
has comment: http://stackoverflow.com/comment/47912063
has comment: http://stackoverflow.com/comment/47912591
type: UnansweredQuestion
has body: I am making a simple form of single text input.I want to cross check from db that is it exist or not.So my html is Zone Name* and my javasript is $('document').ready(function(){ $("[name=submit]").click(function(e){ e.preventDefault(); if ($('#zone_name').val().length <= 0) { $('#zone_name').addClass("errMsg"); $('#zone_name_error').addClass("errMsgDngr"); $('#zone_name_error').html('Please enter Zone name!'); //isStepValid = false; } else if(!$('#zone_name').val().match(/^[a-zA-Z\s-, ]+$/)){ $('#zone_name').addClass("errMsg"); $('#zone_name_error').addClass("errMsgDngr"); $('#zone_name_error').html('Please use only alphabats!'); //isStepValid = false; }else{ var data = {'zone':$('#zone_name').val()} $.ajax({ type:"post", data:data, url:"<?php echo site_url('zone/checkZoneName');?>", success:function(err){ if(err == 0) { console.log('hello'); $('#zone_name_error').html(''); $('#zone_name_error').removeClass("errMsg"); $('#zone_name_error').removeClass("errMsgDngr"); //document.forms["zoneAdd"].submit(); $('form#zoneAdd').submit(); //console.log($('form#zoneAdd').submit()); } else { $('#zone_name').addClass("errMsg"); $('#zone_name_error').addClass("errMsgDngr"); $('#zone_name_error').html('Zone Name already existed!'); } } }); } }); }); every thing is going right. My problem is my form is not submit in ajax success
tagged with: php
has comment: http://stackoverflow.com/comment/47912043
type: Question
has answer: http://stackoverflow.com/a/29895224

http://stackoverflow.com/comment/47885045
score: 0
type: Comment
type: QuestionComment
has text: @underdog right, sorry - my fault :)
comment on: http://stackoverflow.com/q/29880224

http://stackoverflow.com/q/29914202
has comment: http://stackoverflow.com/comment/47950304
favorite count: 0
tagged with: angularjs
upvote count: 2
type: UnansweredQuestion
has body: I have been working with angularjs material now and I want to add scope inside of config file module. When I insert the scope it gives me error. Is there way can I add scope element like this. app.config(function($mdThemingProvider, $scope) { $scope.color = 'red' $mdThemingProvider.theme('default') .primaryPalette($scope.color) }; I tried $provider method but i could not. Could you help me
linked to: http://stackoverflow.com/q/10486769
answer count: 0
score: 1
tagged with: angular-material
downvote count: 1
type: Question
tagged with: angularjs-directive
has comment: http://stackoverflow.com/comment/47950453
has title: How can I inject scope inside of config
has comment: http://stackoverflow.com/comment/47950423
tagged with: javascript
has comment: http://stackoverflow.com/comment/47950326
has comment: http://stackoverflow.com/comment/47950410
has comment: http://stackoverflow.com/comment/47950305
has comment: http://stackoverflow.com/comment/47950282

http://stackoverflow.com/q/29969993
downvote count: 0
tagged with: javascript
score: 1
favorite count: 0
tagged with: angularjs
type: Question
has answer: http://stackoverflow.com/a/29970120
has answer: http://stackoverflow.com/a/29970113
has answer: http://stackoverflow.com/a/29970079
has answer: http://stackoverflow.com/a/29970080
upvote count: 1
has body: I've been learning angular.js, and I keep running into the same problem. A simple hello world comes up easy enough: Hello,! This comes up fine with the proper scripts in the , but as soon as I add a controller it breaks: Hello,! Not only does this not put my name in place of "world", it no longer evaluates the handlebars, instead it leaves the handlebars as raw text. This happens whether it's in the or in a different file. If I remove the reference to the ng-controller, angular works again. Can't figure out what I'm doing wrong... Here is a jsfiddle of both cases: https://jsfiddle.net/74t2q2kL/1/ https://jsfiddle.net/74t2q2kL/2/ Thanks for the help!
type: UnansweredQuestion
has title: Everytime I add the ng-controller, my app breaks
answer count: 4

http://stackoverflow.com/comment/47844171
type: AnswerComment
type: Comment
has text: @Mahadevan My bad.. 2 things to be noted. The event bound should be `blur` and not `click` .. And the second option under the Extensions of jsFiddle should be `onLoad` or `in body` as the element should be available when the event is bound. I have edited the fiddle for your reference.
comment on: http://stackoverflow.com/a/29858751
score: 0

http://stackoverflow.com/comment/47915009
score: 1
has text: @AlexanderTobiasHeinrich But it's not. By that logic, I should point out that `var json = {` is invalid JSON, but I didn't because it's not JSON at all :)
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29896142

http://stackoverflow.com/a/29944651
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29944593
type: Answer
answers question: http://stackoverflow.com/q/29944593
has body: Use .filter to select just the elements with the height you want: $(".class").filter(function() { return $(this).height() &gt; 200; }).addClass("padding"); In your code, n.height() just returns the height of the first element selected, it doesn't change what n refers to in the n.addClass() call.
score: 4
upvote count: 4

http://stackoverflow.com/comment/48058772
type: Comment
comment on: http://stackoverflow.com/a/29968016
has text: `{{AppData}}` returns nothing. FWIW, I noticed if I change `Template.registerHelper` to `Template.myTemplate.helpers` everything works as expected for `myTemplate`.
type: AnswerComment
score: 0

http://stackoverflow.com/comment/48163550
type: Comment
comment on: http://stackoverflow.com/a/29845448
type: AnswerComment
has text: It is not on select color change, I want to change the background color permanently, even after deselection.
score: 0

http://stackoverflow.com/a/29858714
has body: Fiddle for you $(document).ready(function () { $('.chzn-select').change(function () { alert( $('.chzn-select option:selected').text()); }); }); one two This is based on the css3 psuedo-class :selected. It's very similar to :checked, I couldn't find docs for :selected
score: 6
type: Answer
upvote count: 6
answers question: http://stackoverflow.com/q/29858641
has comment: http://stackoverflow.com/comment/47843439
downvote count: 0

http://stackoverflow.com/comment/47993427
type: QuestionComment
comment on: http://stackoverflow.com/q/29935510
has text: Hi ganesh do you know javascript 64 encoding function?please give me reference for that
score: 0
type: Comment

http://stackoverflow.com/comment/47866126
comment on: http://stackoverflow.com/a/29870366
score: 0
type: Comment
has text: Tried that (both the code to disable and to hide it), but still doesn't work unfortunately
type: AnswerComment

http://stackoverflow.com/comment/47904114
type: Comment
has text: I tried that too, since my appController doesn't have a specific route or page, it's just shared among many pages, I couldn't inject anything into it using this approach: angular.module('myApp').controller("appController", ["$scope", "AppData", ... function ($scope, AppData ...) { // use AppData here }]);
comment on: http://stackoverflow.com/a/29890209
score: 0
type: AnswerComment

http://stackoverflow.com/q/29929760
tagged with: jquery
favorite count: 0
accepted answer: http://stackoverflow.com/a/29929906
has comment: http://stackoverflow.com/comment/47981775
tagged with: http://stackoverflow.com/tag/html
tagged with: regex
score: 2
upvote count: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29929892
possible better answer: http://stackoverflow.com/a/29929892
type: Question
has title: How to Grab Selected str.replace Value From Regex in JS
answer count: 2
has body: Ok, I understand how the title might be a bit confusing, let me elaborate. So to start I am making a BBCode input section. Then it will transfer the code from BBCode to HTML. Now the problem is I am having MINIMAL issues. Let me post my code before I continue: var newer = $('#my_textarea').val().replace(/\[b\]/gi, '&lt;b&gt;'); Now let me say this, it replaces the [b] tags correctly with the &lt;b&gt; tags. My problem is I do not know how to do that for all tags. I have tried shortening the code by using this: var newer = $('#my_textarea').val().replace(/\[(?:b|u|i)\]/gi, '&lt;???&gt;'); Then it will replace all tags (bold, underline, and italicize) with the correct HTML tags. Yet how would I go about doings this? How would I replace the HTML tag with the the BBCode tag found? What I mean is with this part of the regex (?:b|u|i) where it selects any of the three letters, how could I add that same letter to the HTML tag? Do you understand what my problem is? :) Please Help, Thank You!!
has answer: http://stackoverflow.com/a/29929906
downvote count: 0
tagged with: javascript

http://stackoverflow.com/comment/47891519
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29883260
has text: It should really be okay to run against every user. I tested the function I posted below and I can run it against an array of 100,000 users in 27 miliseconds.

http://stackoverflow.com/a/29994189
upvote count: 2
score: 2
accepted answer of: http://stackoverflow.com/q/29993926
has body: Content scripts live in an isolated world. You define x outside the context of the page, and as such it's invisible to scripts running in it. See this answer for more details, too. Adding a script through a &lt;script&gt; tag, however, places the script into the page's context. As such, it does not see the variable. You have 3 possible solutions. Work with x entirely in the page's context. So you need to define it in a &lt;script&gt; tag: script = document.createElement("script"); script.textContent = 'x = [];'; (document.getElementsByTagName('head')[0] || document.body).appendChild(script); Let the page-level script and the content script communicate (and, say, pass x around). One way to achieve this is via custom DOM events. Another is described in the docs (with postMessage). Finally, as suggested by xwhyLikeThis, you can store a value in a hidden DOM node. Load the external script in the content script context. This will require fetching it with XHR from the background script and injecting it programmatically. Or, if you can include a static version of the file with the extension - just inject it the usual way along with your content script. Personally, I would recommend 2.
type: AcceptedAnswer
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/29993926

http://stackoverflow.com/a/29882189
has body: The first example - foo, is a function. The second example - foo is an object. in the second example, bar becomes an new instance without a constructor. See - https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Object/create, to add the constructor. As a side note, it common best practice that constructors should begin with a capital letter.
upvote count: 0
answers question: http://stackoverflow.com/q/29881934
type: Answer
score: -1
downvote count: 1

http://stackoverflow.com/comment/47976484
comment on: http://stackoverflow.com/a/29886534
type: AnswerComment
has text: Your solution is giving me an extra letter at times @erkaner
score: 0
type: Comment

http://stackoverflow.com/comment/48015106
comment on: http://stackoverflow.com/q/29938393
has text: Same experience on Chrome for Android.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29893571
has answer: http://stackoverflow.com/a/29893731
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/47910287
favorite count: 0
type: UnansweredQuestion
score: -4
has title: Calculate all dates in between given start and end date using javascript
upvote count: 0
type: Question
linked to: http://stackoverflow.com/q/13146418
downvote count: 4
has comment: http://stackoverflow.com/comment/47910190
has comment: http://stackoverflow.com/comment/47911598
has body: I have a start-date and end-date and I want to calculate array of dates between these days based on a given duration. for example, if start date is 01/01/2015 and end date is 01/06/2015 and if I give duration as 3 months then out put should be: 01/04/2015 01/06/2015 How to achieve this using JavaScript and I need to display it in a form.
tagged with: javascript

http://stackoverflow.com/q/29891031
type: Question
answer count: 2
upvote count: 1
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/29891231
accepted answer: http://stackoverflow.com/a/29891231
has comment: http://stackoverflow.com/comment/47905906
possible better answer: http://stackoverflow.com/a/29891154
tagged with: angularjs
downvote count: 0
has body: I have these line on my view: ..... And on my app.js file: var ngApp = angular.module("localjhourlad", ['ngRoute']); ngApp .config(['$interpolateProvider', function ($interpolateProvider) { $interpolateProvider.startSymbol(''); $interpolateProvider.endSymbol(''); }]); //Custom Directives ngApp .directive('ngCarouselItem', function() { return { restrict: 'E', replace: true, template: ' ' + ' ' + ' ' + ' title ' + ' content ' + ' ' + ' ' + ' ' } }); Everything works as intended as I am seeing the custom directive element being replaced by the directive's template, only the expression bindings are not being replaced by the attributes values, to wit: I'm out of ideas right now. Any help would be very much appreciated.
has title: AngularJs: Custom Directive's dynamic template not substituting attribute values
tagged with: angularjs-directive
type: AnsweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/47905686
has answer: http://stackoverflow.com/a/29891154

http://stackoverflow.com/q/29875865
tagged with: javascript
has answer: http://stackoverflow.com/a/49132606
favorite count: 0
tagged with: zooming
answer count: 3
has title: Setting zoom level doesn't work on Google Map
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/49046863
has answer: http://stackoverflow.com/a/29876005
accepted answer: http://stackoverflow.com/a/29876005
type: AnsweredQuestion
has body: I'm learning web developing and I'm using JavaScript to show Google Map. Here is my code: Google Map I'm trying to change the zoom level, but it doesn't work. I tried to set, for example, 6 or 8 but it doesn't change. What could be the reason?
score: 4
type: Question
has answer: http://stackoverflow.com/a/49046863
upvote count: 4
linked to: http://stackoverflow.com/q/9099345
tagged with: google-maps
downvote count: 0

http://stackoverflow.com/q/29935390
accepted answer: http://stackoverflow.com/a/29935808
has comment: http://stackoverflow.com/comment/47992585
has comment: http://stackoverflow.com/comment/47992750
type: Question
has comment: http://stackoverflow.com/comment/47993018
has answer: http://stackoverflow.com/a/29935808
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/47993365
tagged with: jquery
has title: background-image: url not working properly
has comment: http://stackoverflow.com/comment/47992935
score: 0
has comment: http://stackoverflow.com/comment/47993447
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/5271316
has comment: http://stackoverflow.com/comment/47992783
has comment: http://stackoverflow.com/comment/47992699
has body: The problem I am encountering is that when I use javascript to get the html file inside another html file, the background image turns invisible. But when I open the file with the background image the image is visible. To make this understandable, I want to include second.html (with background image) in first.html using javascript without the image being invisible. First.html (main) Second.html (with image)
has comment: http://stackoverflow.com/comment/47993929
type: AnsweredQuestion

http://stackoverflow.com/a/29912558
downvote count: 0
answers question: http://stackoverflow.com/q/29907536
type: Answer
upvote count: 12
has body: Let's say meshToRotate needs to be rotated by 90 degrees in X axis. Then do the following. var meshToRotate = new THREE.Mesh( geometry, material ); //Rotating mesh by 90 degree in X axis. meshToRotate.rotateX( Math.PI / 2 );
score: 12

http://stackoverflow.com/comment/48030860
has text: Well it's possible you could submit the video file directly to Wistia via javascript but the problems is that it would expose your Wistia Credentials to the world and a bunch of CORS issues.
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29945058

http://stackoverflow.com/comment/48116529
has text: Is the path to the file correct? Ideally it should load.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29998590

http://stackoverflow.com/comment/47893030
type: Comment
score: 0
has text: Please understand that the controllerAs syntax is NOT a different scope. All it does is makes the controller available on the scope under a specific variable name. A more Angular way to do what you want would be to move the logic in your controller into a Service and inject that service into the directive.
comment on: http://stackoverflow.com/a/29883652
type: AnswerComment

http://stackoverflow.com/q/29947811
has body: I'm currently working on a C# MVC application. I'm using Twitter's Bootstrap's modal boxes as a 'popup' window. This has worked flawlessly in the past, but for some reason it doesn't right now. The result I get right now is shown below. Don't mind the blur, I did that. Naturally the background is supposed to get grey, faded out like always, though for some reason it doesn't right now. I've basically copy pasted the code that works elsewhere and changed the values. I double and triple checked to make sure I didn't make a mistake somewhere, but I honestly can't see it. I've pasted the relevant code below. JQuery gets loaded in the layout file. This is a partial view for the record &lt;button id="btnAddNewSecureFolder" onclick="openTheCreateWindow()" data-toggle="modal" data-target="#modal-new-secFolder" class="btn btn-md btn-default giveMeSomeSpace leaveMeAlone"&gt;Add a secure folder&lt;/button&gt; @*&lt;button onclick="openTheCreateWindow()" class="btn btn-md btn-default giveMeSomeSpace leaveMeAlone" id="btnAddNewSecureFolder"&gt; Add a secure folder &lt;/button&gt;*@ &lt;div class="modal" id="modal-new-secFolder" tabindex="-1" role="dialog" aria-labelledby="modal-new-secFolder" 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 cancel" data-dismiss="modal"&gt;&lt;span aria-hidden="true"&gt;&amp;times;&lt;/span&gt;&lt;span class="sr-only"&gt;Close&lt;/span&gt;&lt;/button&gt; &lt;h4 class="modal-title"&gt;Add a new secure folder&lt;/h4&gt; &lt;/div&gt; &lt;div class="modal-body"&gt; @Html.Partial("CreateNewSecureFolder") &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;script&gt; function openTheCreateWindow() { $('#modal-new-secFolder').modal('show'); } &lt;/script&gt;
answer count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/48017724
favorite count: 0
tagged with: razor
has comment: http://stackoverflow.com/comment/48017418
accepted answer: http://stackoverflow.com/a/29948426
type: AnsweredQuestion
downvote count: 0
tagged with: twitter-bootstrap
score: 1
has answer: http://stackoverflow.com/a/29948426
type: Question
tagged with: asp.net-mvc
tagged with: javascript
has title: Bootstrap's Modal box - background doesn't fade out on show
upvote count: 1

http://stackoverflow.com/comment/48100880
type: Comment
comment on: http://stackoverflow.com/a/29990572
score: 0
type: AnswerComment
has text: `append()` would work to as it does not escape any characters. I think `text()` is the only jQuery method which has that behaviour.

http://stackoverflow.com/comment/78947120
comment on: http://stackoverflow.com/a/32671263
score: 1
type: AnswerComment
has text: @DanielHerr We don't modify prototypes for very good reason. Because this breaks encapsulation and provides global changes in code behaviour. Sometimes it may be a matter of principle, but in this case the pitfall is obvious - if (when) objects will become iterable, reassigned `Object.prototype[Symbol.iterator]` can break any other spec-compiant piece of code. If you need to customize built-in class behaviour, subclass it, it's always as simple as that. E.g. [same thing but done right](https://stackoverflow.com/a/35819888/3731501).
type: Comment

http://stackoverflow.com/q/29846162
answer count: 3
upvote count: 1
has answer: http://stackoverflow.com/a/29846457
has comment: http://stackoverflow.com/comment/47818042
tagged with: javascript
type: UnansweredQuestion
tagged with: dom
has comment: http://stackoverflow.com/comment/47818134
downvote count: 0
score: 1
tagged with: jquery
favorite count: 0
has title: Javascript code works in console but not HTML (Click Function)
has answer: http://stackoverflow.com/a/29849081
type: Question
has body: document.getElementById('hello').click(); The above code works when inserted into the google chrome console - It displays the dropdown of 'hello' - What I'm trying to do is open up a dropdown when I click a whole table row, using the following code &lt;tr onclick="document.getElementById('hello').click();"&gt; Here is the dropdown I'm trying to activate &lt;a href="#" id="hello" data-toggle="dropdown" class="btn dropdown-toggle"&gt;&lt;i class="icon-cog"&gt; Infact I do see the button being clicked when I click the row, but the dropdown does not toggle. Whats the best way to toggle the dropdown (The dropdown works if I simply click it, I'm trying to toggle it using javascript) Thanks!
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29847233
has comment: http://stackoverflow.com/comment/47818309

http://stackoverflow.com/a/29924733
type: AcceptedAnswer
downvote count: 0
score: 6
answers question: http://stackoverflow.com/q/29908569
type: Answer
upvote count: 6
accepted answer of: http://stackoverflow.com/q/29908569
has comment: http://stackoverflow.com/comment/48037297
has comment: http://stackoverflow.com/comment/48017916
has comment: http://stackoverflow.com/comment/47986525
has body: app.selection returns an array of Objects, so each item in the array can be of a different type, and the properties and methods available to it will differ. When using the Extendscript Javascript Console you can see what a particular item in the array is on the fly by just typing app.selection[0] (or whatever number). The result will be something like [object TextFrame]. While looping through the selection array, you could use app.selection[0].constructor.name to determine the type of each. Or, if you're only interested in certain types, if (app.selection[i] instanceof TextFrame){} At that point you'll know more about which properties you can access, depending on the type. To answer the second part of the question, there isn't an allTextFrames property, but there is an allPageItems property. This returns an array of pageItems (textFrames, groups, etc.), and you can work with it similarly to app.selection. So, if I have three text frames grouped on the first page of my document (and nothing else), I can see that the following are all true: app.activeDocument.pages[0].textFrames.length == 0; app.activeDocument.pages[0].allPageItems.length == 4; app.activeDocument.pages[0].allPageItems[0] instanceof Group; app.activeDocument.pages[0].allPageItems[1].constructor.name == "TextFrame"; So you could probably cycle through that array if it's more useful to you than the textFrames collection. Just keep in mind that you don't have access to the special collection properties of TextFrames (like everyItem()).

http://stackoverflow.com/q/29846471
tagged with: javascript
score: 4
has comment: http://stackoverflow.com/comment/47819136
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
has comment: http://stackoverflow.com/comment/47819009
has answer: http://stackoverflow.com/a/29846978
linked to: http://stackoverflow.com/q/1191865
tagged with: php
has comment: http://stackoverflow.com/comment/47819586
type: AnsweredQuestion
type: Question
upvote count: 4
has body: I'm trying to display an alert message on my main page which is index.php. I use a second file to insert the amount of times the button has been pressed. But the user should only be able to vote every 5 minutes. It should display them an alert message if the vote failed or succeeded. Right now it always displays both buttons on the index.php. Index.php <?php include_once 'resources/method.php'; ?> method.php <?php // if (5mins passed) { // } elseif (time <= 5mins) { // insert query; // } // if (5mins passed) { ?> Wait 5mins <?php // } else { ?> Success! <?php // } ?> <?php header ( 'Refresh: 5; URL=/project/index.php' ); ?> Here's the fiddle to what I'm currently stuck with. Fiddle (Its not really necessary) It should only display the "Wait 5mins" button when 5 minutes have not passed yet and the "Success!" button should be displayed when 5 minutes have passed. If the user did not click the "Vote" button none of them should be displayed.
accepted answer: http://stackoverflow.com/a/29846978
has title: Display alert on main page when function is called
answer count: 1
downvote count: 0

http://stackoverflow.com/q/29908644
tagged with: jquery
tagged with: ajax
has comment: http://stackoverflow.com/comment/47939804
accepted answer: http://stackoverflow.com/a/29908739
has body: I have a button that adds an input box where you can type an address. For the address, I'm using the geocomplete plugin. In all input boxes that were not generated with ajax the geocomplete works. If the input was generated by ajax, it doesnt. This is my code to generate the input box: $('.add-drop').on('click', function(){ $.ajax({ url : '/ajax/get-location-input', success : function(data){ $('#additional-drop').append(data); } }); }); This is my geocomplete code: $(".get-location").geocomplete({ details : "form", types : ["geocode", "establishment"] }).bind("geocode:result", function(event, result){ console.log(result); }); The problem is not with the class. I was trying to do something like $(".get-location").on("geocomplete"... but it wasn't working. Any idea? Thanks
type: AnsweredQuestion
type: Question
tagged with: javascript
tagged with: geocoding
has answer: http://stackoverflow.com/a/29908739
score: 0
tagged with: geocomplete
answer count: 1
has title: Use geocomplete function after ajax event

http://stackoverflow.com/a/32711125
score: 2
upvote count: 2
has body: In the reactive tables docs, there's an example of how to delete rows from the table. Adapting the example in the docs for your needs, your event should look like this: Template.moviestable.events({ 'click .reactive-table tbody tr': function (event) { event.preventDefault(); var objToDelete = this; // checks if the actual clicked element has the class `deletebtn ` if (event.target.className == "deletebtn") { Movies.remove(objToDelete._id) } } }); The problem you are having is that you are trying to find the _id property on the button click instead of the row click. If you do console.log(this) on your button click event (as you have it in your question above) you will get something like this Object {key: "delete", label: "", fieldId: "2", sortOrder: ReactiveVar, sortDirection: ReactiveVar} which does not contain the property _id It is easier to register the row click, where the row object is the actual document you are trying to delete, and then check if the event's target has the delete class you added.
has comment: http://stackoverflow.com/comment/66050418
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/29886550

http://stackoverflow.com/comment/48436833
type: AnswerComment
has text: This reads more like a game of spot-the-difference than an answer. What did you change? Why does it help?
score: 0
type: Comment
comment on: http://stackoverflow.com/a/30164869

http://stackoverflow.com/a/66372081
downvote count: 0
type: Answer
upvote count: 2
answers question: http://stackoverflow.com/q/29858699
has body: sample code. limitation: can only *guess* if some code is pure = can only give a hint, but no guarantee /* programmatically guess if some javascript code is pure or impure npm install acorn acorn-walk license is CC0-1.0 */ const acorn_parse = require("acorn").parse; const acorn_walk = require("acorn-walk"); // the code to analyze const content = ` ['k1'].map(key => { const val = data[key]; let local1; var local2 = 2; var local3, local4; global1[key] = val; // find me global2.key = val; // find me global3.push(val); // find me global4.pop(); // find me global5.shift(); // find me global6 = 'impure'; // find me const local7 = global7[1234]; var local8 = global8.map(x => 2*x); var local9 = global9.filter(Boolean); const local10 = global10.pop(); // find me local1 = 'ok'; local2.push('ok'); return [key, val]; }) `; // method names for our educated guess const write_method_set = new Set(['push', 'pop', 'shift']); const read_method_set = new Set(['map', 'filter', 'reduce', 'forEach']); const is_write_method = method_name => write_method_set.has(method_name); const is_read_method = method_name => read_method_set.has(method_name); const is_local = name => (name != undefined && local_var_set.has(name)); const get_src = node => content.substring(node.start, node.end); function test_assign(node, left_name) { if (left_name == undefined) { console.log(`TODO implement: detect write access in:`); console.dir(node); return; } if (!is_local(left_name)) console.log(`impure write access to global ${left_name}: ${get_src(node)}`); else console.log(`pure? write access to local ${left_name}: ${get_src(node)}`); } function test_call(node, left_name, method_name) { if (left_name == undefined) { console.log(`TODO implement: detect write access in:`) console.dir(node); return; } if (is_read_method(method_name)) return console.log(`pure? access to ${left_name}: ${get_src(node)}`); if (!is_local(left_name)) { if (is_write_method(method_name)) console.log(`impure write access to global ${left_n…
score: 2

http://stackoverflow.com/comment/47931141
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29903920
has text: That is Javascript in which case the semicolon goes on the end.
score: 0

http://stackoverflow.com/q/29870081
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47865622
has answer: http://stackoverflow.com/a/29973492
has comment: http://stackoverflow.com/comment/47868626
has comment: http://stackoverflow.com/comment/47869085
has comment: http://stackoverflow.com/comment/47865320
score: 4
has comment: http://stackoverflow.com/comment/47866208
has comment: http://stackoverflow.com/comment/47866012
has comment: http://stackoverflow.com/comment/47865825
has comment: http://stackoverflow.com/comment/47869369
has body: Let's say I have two pages, cloud and settings. I have the following code set up: var routerApp = angular.module('APP', ['ui.router']); routerApp.config(function($stateProvider, $urlRouterProvider, $locationProvider) { $locationProvider.html5Mode(true); $urlRouterProvider.otherwise('/cloud'); $stateProvider .state('cloud', { url: '/cloud', templateUrl: 'pages/templates/cloud.html', controller: 'cloud', }) .state('settings', { url: '/settings', templateUrl: 'pages/templates/settings.html', controller: 'settings' }); }); routerApp.controller('cloud', function($scope, $http, $state) { alert("cloud"); }); routerApp.controller('settings', function($scope, $http, $state) { alert("settings"); }); HTML TITLE Cloud Settings Regardless of what page I load, settings or cloud, the each controller will run no matter what. Meaning I will get 2 alerts, regardless, when I reload the page. Could anyone help explain what I need to do so that if I reload my website on /settings, only the code in my settings controller will run and vice versa?
type: Question
has comment: http://stackoverflow.com/comment/47865224
tagged with: angular-ui-router
tagged with: javascript
has comment: http://stackoverflow.com/comment/47870771
has comment: http://stackoverflow.com/comment/47866236
has comment: http://stackoverflow.com/comment/47869356
has title: Angular UI-Router loading controller only when route is selected
has comment: http://stackoverflow.com/comment/47865970
upvote count: 4
has comment: http://stackoverflow.com/comment/47865347
answer count: 1
downvote count: 0
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/47869388
tagged with: angularjs

http://stackoverflow.com/a/52245981
type: Answer
has comment: http://stackoverflow.com/comment/91440131
answers question: http://stackoverflow.com/q/29968116
downvote count: 1
has comment: http://stackoverflow.com/comment/91440109
upvote count: 5
score: 4
has body: You can use the string version of the constructor: console.log(new Date("0001-01-01"));

lifecycle
tags question: http://stackoverflow.com/q/29873730
tag name: lifecycle
type: Tag
tags question: http://stackoverflow.com/q/29931998

http://stackoverflow.com/q/29952743
score: 4
accepted answer: http://stackoverflow.com/a/29952857
upvote count: 4
tagged with: ecmascript-6
has comment: http://stackoverflow.com/comment/48029337
linked to: http://stackoverflow.com/q/28798330
answer count: 1
downvote count: 0
has body: Why does o.foo() print the global object to the console? let o = { foo: () =&gt; console.log(this), bar() { console.log(this); } }; o.foo(); // Global object / undefined o.bar(); // o I thought the equivalent of the arrow function might be something like this (but it's not): let o = { foo: function() { console.log(this); }, bar() { console.log(this); } }; o.foo(); // o o.bar(); // o
favorite count: 0
has title: Arrow functions - why does this print the global object to the console?
duplicate of: http://stackoverflow.com/q/28798330
has comment: http://stackoverflow.com/comment/48029385
linked to: http://stackoverflow.com/q/29942120
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29952857
tagged with: javascript

http://stackoverflow.com/comment/48090138
type: QuestionComment
has text: I took a basic Bootstrap3 starter template, I tried to trigger a non remote modal and it triggers.Forked it here : http://laravel.io/bin/mGJom
comment on: http://stackoverflow.com/q/29976869
score: 0
type: Comment

http://stackoverflow.com/comment/47874145
type: Comment
has text: Thanks vihan1086, your code was extremely helpful! I made a couple small changes to it, and now it works like a charm. `this.notes` is an array, so I was able to just use `this.notes.length`. Also, the `runIteration()` function didn't seem to have access to `this.notes`, so I added the line `var myArray = this.notes;` before defining `runIteration()`, and then I just substituted `myArray[j]` for `this.notes[j]`. That did it! Thanks again!
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29872596

http://stackoverflow.com/comment/48237204
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/29998551
type: Comment
has text: there seems to be a browser issue? works fine in Chrome and Safari. doesn't in Firefox (Mac OS 10.10.3)

http://stackoverflow.com/comment/47877534
has text: ah, ok cool. so the root then is my `/var/www/html` where my `index.html` file is located, and everything needs to start from there? It seems like java class path, isn't it?
comment on: http://stackoverflow.com/a/29876640
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/48084276
type: AnswerComment
has text: I understand your explanation, but I expected that even though I use isolated scope, 'angular' would search for the `toggle` function in the isolated scope and not in the `MainCtrl`. It's a bit strange that I have to use template to be so. Anyway, thank you for the answer.
score: 0
comment on: http://stackoverflow.com/a/29982055
type: Comment

http://stackoverflow.com/a/29892500
has comment: http://stackoverflow.com/comment/47909856
has comment: http://stackoverflow.com/comment/47909813
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29891666
has comment: http://stackoverflow.com/comment/47959973
upvote count: 2
has comment: http://stackoverflow.com/comment/47909100
has comment: http://stackoverflow.com/comment/47908514
type: Answer
has comment: http://stackoverflow.com/comment/47909614
accepted answer of: http://stackoverflow.com/q/29891666
has comment: http://stackoverflow.com/comment/47908801
score: 2
has comment: http://stackoverflow.com/comment/47984656
has body: updates Js fiddle demo for the above code
has comment: http://stackoverflow.com/comment/47909745
has comment: http://stackoverflow.com/comment/47909641
downvote count: 0
has comment: http://stackoverflow.com/comment/47939602

http://stackoverflow.com/a/29923739
answers question: http://stackoverflow.com/q/29923487
has comment: http://stackoverflow.com/comment/47976924
score: 0
has body: Open the file before your loop and write to it incrementally inside the loop. Then close it after the loop. Assuming you are using the standard Node File System API: Use fs.open() to asynchronously open a file or fs.openSync() to synchronously open a file Use fs.write() to asynchronously write to a file or fs.writeSync() to synchronously write to a file. If you are using a buffer, be sure to use the method signature that takes a buffer. If you are using data, then be sure to use the method signature that takes data. Also note the warning in the docs about using the asynchronous version multiple times without waiting for the callback! If you need to do that, use fs.createWriteStream() etc. rather than these functions. That will return a Writable Stream so read the documentation for that instead/in addition. Use fs.close() or fs.closeSync() to close the file. What you can't use is fs.writeFile() or fs.writeFileSync() because those will replace the file on each write.
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29923487
type: Answer

http://stackoverflow.com/comment/47983603
has text: Also can you post your chart config?
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29930602

http://stackoverflow.com/comment/47843317
type: AnswerComment
type: Comment
has text: I'm accepting this one as you were first, but I found you don't need to add one to the modulus. My brain is a bit dead from work, I kept doing index/col and getting 3.2, which didn't equal the 4.2 I was expecting. I didn't think to add one...
comment on: http://stackoverflow.com/a/29858508
score: 0

http://stackoverflow.com/q/29876149
has body: I added two draggable ContainerSurfaces (dragbox1 &amp; dragbox2) onto another transparent ContainerSurface (panLayer), which is also draggable. This enables panning while also enabling single dragging of the two boxes. This worked in Famo.us 0.2, but ever since I started using version 0.3 dragging a box also activates panning. How do I stop the drag-event from propagating? define(function(require, exports, module) { var Engine = require('famous/core/Engine'); var ContainerSurface = require('famous/surfaces/ContainerSurface'); var StateModifier = require('famous/modifiers/StateModifier'); var Transform = require('famous/core/Transform'); var Draggable = require('famous/modifiers/Draggable'); var mainContext = Engine.createContext(); var dragbox1 = new ContainerSurface({ size: [200,200], properties: { backgroundColor: '#FF0000' } }); var dragbox2 = new ContainerSurface({ size: [200,200], properties: { backgroundColor: '#0000FF' } }); var dragMod1 = new Draggable({}); var dragMod2 = new Draggable({}); var panMod = new Draggable({}); var contentLayer = new ContainerSurface({ size: [undefined, undefined], properties: { backgroundColor: '#00FFFF' } }); var panLayer = new ContainerSurface({ size: [undefined, undefined], properties: { backgroundColor: 'rgba(0, 0, 0, 0)' } }); panMod.subscribe(contentLayer); dragMod1.subscribe(dragbox1); dragMod2.subscribe(dragbox2); contentLayer.add(panMod).add(panLayer); panLayer.add(dragMod1).add(dragbox1); panLayer.add(dragMod2).add(new StateModifier({transform: Transform.translate(300,0,0)})).add(dragbox2); mainContext.add(contentLayer); });
favorite count: 0
type: Question
tagged with: panning
tagged with: famo.us
upvote count: 1
tagged with: drag
has title: Famo.us: Issue with Dragging and Panning
type: UnansweredQuestion
answer count: 0
downvote count: 0
tagged with: javascript
score: 1

http://stackoverflow.com/a/29921986
accepted answer of: http://stackoverflow.com/q/29921272
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 3
has body: It's a very big question. In short way it's a holy war about server-side vs client-side, so I'm only going to write several pros: Server-side: User doesn't need to have JavaScript enabled on the browser. Nowadays it's a bit old manner, but sometimes when you deliver only information it's great. It is easier to maintain and error catching. You can catch on the server most of the problems Don't need additional code/application for monitoring errors on client side Better SEO optimization for Google and other bots Client-side: Interactive pages - For instance, you might have a form that includes text inputs as well as an image upload/edit feature. Let's say the user writes some information on the text fields, then wants to upload/edit the photo without losing or submitting the information on the form fields. With AJAX / AJAJ you can have the user select the photo, crop, rotate, upload, you update the &lt;img&gt; element without reloading the page and losing the information in the forms. Smaller data are downloaded by client because html has same overhead as a xml Thiner server and cleaner API you can develop More on topic you can read here.
score: 3
answers question: http://stackoverflow.com/q/29921272

http://stackoverflow.com/q/29914305
accepted answer: http://stackoverflow.com/a/29922350
type: Question
tagged with: http://stackoverflow.com/tag/html
score: 1
favorite count: 0
answer count: 2
upvote count: 1
has answer: http://stackoverflow.com/a/29922350
has answer: http://stackoverflow.com/a/29914444
has title: JQuery Mobile: How to change data-collapsed with a button
possible better answer: http://stackoverflow.com/a/29914444
type: AnsweredQuestion
downvote count: 0
tagged with: jquery-mobile
tagged with: javascript
tagged with: jquery
has body: I am trying to change data-collapsed of a div (with data-role= "collapsible") with a button. My div that I tried to change its data-collapsed is: and the button that i want to change the div's data-collapsed using onclick is: Collapse/ Expand I also tried to change my code, but i can't: Collapse/ Expand Or: Collapse/ Expand Or: Collapse/ Expand Please help me! Note: I include this on the :

http://stackoverflow.com/comment/48170904
type: Comment
has text: Maybe I incorrectly read this, but really... In your code I see that you have a widget instance, so the only thing you need to do is to get [`widget.id`](http://docs.ckeditor.com/#!/api/CKEDITOR.plugins.widget-property-id). You want to say that you haven't tried this? The same with setting custom data - I linked to [`element.setCustomData()`](http://docs.ckeditor.com/#!/api/CKEDITOR.dom.domObject-method-setCustomData), I mentioned `setAttribute()`. Do you want to say that you haven't found complementary `getCustomData()` and `getAttribute()`? I can hardly believe this.
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/29967614

http://stackoverflow.com/comment/47998084
comment on: http://stackoverflow.com/q/29938423
type: Comment
type: QuestionComment
score: 3
has text: since this is a conceptual question it seems more appropriate for https://programmers.stackexchange.com/

http://stackoverflow.com/q/29895277
has answer: http://stackoverflow.com/a/29914330
accepted answer: http://stackoverflow.com/a/29914330
has body: I am trying to write a Custom Matcher that tests if a string contains a special number of occurrences of a different string. This is what I did. var matcher = { toContainTimes: function (expected, num) { return { compare: function(actual){ actual.match(new RegExp(expected, "g") || []).length == num; } } } } But I get an error when executing this: TypeError: Cannot read property 'pass' of undefined My test looks like this: expect(queryString).toContainTimes("&amp;", 2); It should return true if the string "&amp;" occurs exactly twice in queryString. What did I do wrong?
score: 1
type: AnsweredQuestion
tagged with: testing
tagged with: javascript
has title: How to write a Jasmine custom matcher
tagged with: matcher
type: Question
upvote count: 2
answer count: 1
downvote count: 1
tagged with: jasmine
favorite count: 0
has comment: http://stackoverflow.com/comment/47913418

http://stackoverflow.com/a/29907942
answers question: http://stackoverflow.com/q/29905932
type: Answer
has body: You need to read the doc on how to use readline in Node --https://nodejs.org/api/readline.html#readline_readline: var main = function() { "use strict"; var readline = require('readline'); var rl = readline.createInterface({ input: process.stdin, output: process.stdout }); rl.question("What is your name? ", function(answer) { console.log("Hello ", answer); rl.close(); }); }();
score: 1
upvote count: 1
downvote count: 0

http://stackoverflow.com/q/29897555
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47919829
downvote count: 0
has answer: http://stackoverflow.com/a/29898636
has comment: http://stackoverflow.com/comment/47919891
type: Question
has body: I have a button in every item of my ng-repeat list. The button is hidden by default, I want to show the button when the user selects the list item and hide the button when the user selects another list item. I am not able to get this to work, the button stays hidden when the user selects the list item. Here are the relevant bit of code from what I have tried so far. The HTML: Name: {{thing.name}} Delete The JS code: $scope.selectthing = function(idx) { $(this).find('ul.btn').show(); // this is not working . . . // do some awesome stuff with the selected thing. } My question is: How do I get the button to show when the user selects the list item and hide the button when the user another list item ?
has comment: http://stackoverflow.com/comment/47919045
has comment: http://stackoverflow.com/comment/47921491
tagged with: javascript
has answer: http://stackoverflow.com/a/29898826
upvote count: 2
answer count: 2
has title: Show and hide button in ng-repeat list
favorite count: 0
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/29898636
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/29898826
score: 2

http://stackoverflow.com/q/29974001
tagged with: css
has answer: http://stackoverflow.com/a/29974326
upvote count: 3
type: UnansweredQuestion
type: Question
score: 3
has comment: http://stackoverflow.com/comment/48069771
answer count: 1
downvote count: 0
tagged with: javascript
has title: Get overflow height with js
favorite count: 0
has body: when you have a div with overflow: hidden and a longer div/element/image behind it, is it possible to get the length of the hidden element that is left at the bottom? For instance in the following image the dotted line is the hight value I need. Because this image scrolls, I need to know how much more I can scroll up. because there is a changing height to the top of the overflow I cant just subtract the size visible by the images height.

http://stackoverflow.com/a/29870475
has body: One way to do this is to use the window.setInterval function. With this function, we can perform the animation every hour. However, one problem which arises is that, according to the P5.js documentation, the draw() function executes continuously after the setup() function is called. We can fix this by taking advantage of the noLoop() and loop functions. The noLoop() function call will stop the draw() function from executing and the loop() function will start the execution again. So, let's take a look at how we can code this: Note: According to the documentation, there can only be one draw function for each sketch. So, if you have other things animating throughout the course of the hour this approach may not be the best choice. //stores the position of the element on the x-axis of the screen var xPos = 0; var delay = 60000 * 60; //1,000 milliseconds in a second window.setInterval(function(){ //code to be called every hour; make draw function loop loop(); }, delay); function setup(){ //create your canvas or div or whatever createCanvas(400, 400); } function draw(){ // clear the current background background(255); // set the fill color of your element fill(255, 0, 0); //change the x position so it can move across the screen xPos = xPos + 1; // if the circle moves off screen, it's finished animating for the hour if(xpos &gt; width) { xPos = 0; //reset back to 0; noLoop(); //end the looping of the draw function } //draw your element to the correct location and size; here I'll use an ellipse ellipse(xPos, 100, 25, 25); } I'm not the most familiar with P5.js as I've stated but hopefully this gives you enough an idea to get it working. Edit: An alternative approach would be to use CSS animations. With CSS animations you wouldn't even need P5.js to get your desired effect. HTML: &lt;div id="my-div" class="my-div"&gt;&lt;/div&gt; CSS: .my-div { /* animation name followed by how long the animation takes to perform */ /* browser prefixes for more browser support */ animation: s…
type: Answer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/29869910
upvote count: 1
has comment: http://stackoverflow.com/comment/47869019
has comment: http://stackoverflow.com/comment/47866063

http://stackoverflow.com/q/29985079
has answer: http://stackoverflow.com/a/29985386
linked to: http://stackoverflow.com/q/12190119
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/48089395
has answer: http://stackoverflow.com/a/29985625
has title: bootsprap 2.1 modal autofocus not working
type: Question
has body: ISSUE : Auto focus is not applying to my pop up form of bootstrap 2.1 I am using twitter bootstrap 2.1 trying to autofocus on first input element when click and a pop up is show. I need guidance to resolve this issue. I have try with JavaScript focus function and also try with html autofocus property but it is not applying. Bootstrap modal show event I tried this stack overflow question but it require to update my bootstrap to 3.0 but it is not possible for me to update as it require huge time. I want similar autofocus with bootstrap 2.1 please guide me towards this. Thanks in advance
possible better answer: http://stackoverflow.com/a/29985625
accepted answer: http://stackoverflow.com/a/29985386
tagged with: javascript
score: 0
answer count: 2
tagged with: jquery
tagged with: twitter-bootstrap
tagged with: http://stackoverflow.com/tag/html
tagged with: twitter-bootstrap-2

http://stackoverflow.com/q/29849579
tagged with: jquery
has comment: http://stackoverflow.com/comment/47825496
favorite count: 0
has answer: http://stackoverflow.com/a/29912504
possible better answer: http://stackoverflow.com/a/29849837
tagged with: http://stackoverflow.com/tag/html
downvote count: 1
answer count: 4
upvote count: 0
has comment: http://stackoverflow.com/comment/47825420
has body: I need to unbind previous click handler. Here is my HTML code: &lt;div style="display:block; float:right; width:auto; color:#7c7c7c;"&gt; &lt;a href="javascript:void(0);" class="favourate_dextop" title="Add to Favorites" id="fav'.$data[$k]['id'].'" data-sess_id="'.$data[$k]['id'].'" data-name="'.$name_event.'" data-city="'.$event_city.'" data-country="'.$event_country.'" data-event_url="'.$event_urls.'" &gt; &lt;/a&gt; &lt;/div&gt; $(document).ready(function(){ if (localStorage.getItem('eventData') !== null) { $.each(eventData = JSON.parse(localStorage.getItem('eventData')), function(id){ $('#' + id).addClass('faved'); }); } $(".favourate_dextop").bind("click", function() { $(".favourate_dextop").unbind("click"); console.log() favorite(this); }); }); function favorite(item){ if (eventData[item.id] !== undefined) { delete eventData[item.id]; } else{ eventData[item.id] = $(item).data(); } $(item).toggleClass('faved'); localStorage.setItem('eventData', JSON.stringify(eventData)); } The problems I'm having are: when i click on class on async loading divs then some times double click persisits. therefore i handle using bind and unbind function. solution worked from me is i passes function name on href like : &lt;a href="javascript:void(0);" onclick="favorite(this)"&gt; but this wrong solution. 2 solution i tried $('.favourate_dextop').on("click", function(){ console.log("ajax call"); favorite(this); }); but this script fails sometimes . Any suggestions are most welcome. i also tried with this solution but noting works for me. function doStuff() { alert("before ajax"); console.log("onload call"); favorite(this); } $('.favourate_dextop').on('click', doStuff); $('.favourate_dextop').off('click', doStuff); 2 . ajax file loading data dynamically i need to replicate same script . $(document).ready(function(){ if (localStorage.getItem('eventData') !== null) { $.each(eventData = JSON.parse(localStorage.getItem('eventData')), function(id){ $('#'+id).addClass('faved'); }); } funct…
type: Question
type: AnsweredQuestion
has title: how to bind and unbind click in jquery
has answer: http://stackoverflow.com/a/29849837
score: -1
has comment: http://stackoverflow.com/comment/47825477
has answer: http://stackoverflow.com/a/29850037
accepted answer: http://stackoverflow.com/a/29850037
has answer: http://stackoverflow.com/a/29849866
has comment: http://stackoverflow.com/comment/47825547
tagged with: javascript
has comment: http://stackoverflow.com/comment/47825715

http://stackoverflow.com/comment/47858995
type: AnswerComment
has text: @VincenzoPiromalli My answer addresses all of those
type: Comment
comment on: http://stackoverflow.com/a/29866966
score: 0

http://stackoverflow.com/a/29871904
answers question: http://stackoverflow.com/q/29871391
has comment: http://stackoverflow.com/comment/47887585
score: 0
has body: If I understood your question: First of all what does this: if ($(this).hasClass('active')) $(this).find('span') else $(this).find('span') if it has the .active class then find the span, and if it didn't then find the span anyway? and then do what with it? Secondly, in an stateless mode you can't retrieve the information of any type (like for example if the user has tried to login already or not) from the last session, so you need to either have it don in your back-end (PHP, Node, etc.) or save the data on users browser (cookies, localstorage) which in your case (authentication) is NOT recommended. So you're gonna need to let your server answer to your Login request, then according to its answer, use JavaScript (or even simpler and more preferably CSS) to show a visual presentation to user, and NEVER try to check for the validation of the user login information in front-end. I hope it helps.
type: Answer
has comment: http://stackoverflow.com/comment/47887932

http://stackoverflow.com/comment/47969328
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29923661
has text: Actually, document. is not JQuery way..
score: 0

http://stackoverflow.com/a/61860802
has comment: http://stackoverflow.com/comment/126185402
has comment: http://stackoverflow.com/comment/112669085
has comment: http://stackoverflow.com/comment/137187268
score: 51
has comment: http://stackoverflow.com/comment/134577102
has comment: http://stackoverflow.com/comment/129385491
has comment: http://stackoverflow.com/comment/132955916
downvote count: 1
has comment: http://stackoverflow.com/comment/138758101
has comment: http://stackoverflow.com/comment/112763685
has comment: http://stackoverflow.com/comment/136807241
has comment: http://stackoverflow.com/comment/119391608
has comment: http://stackoverflow.com/comment/137248836
has comment: http://stackoverflow.com/comment/122604057
has comment: http://stackoverflow.com/comment/115063409
answers question: http://stackoverflow.com/q/29879267
has body: My answer seems like less code and it works for me: class Nose { constructor() { this.booger = 'ready'; } pick() { console.log('pick your nose') } } class Ear { constructor() { this.wax = 'ready'; } dig() { console.log('dig in your ear') } } //class Butt { // left as an exercise for the reader class Gross extends Classes([Nose,Ear]) { constructor() { super(); this.gross = true; } } function Classes(bases) { class Bases { constructor() { bases.forEach(base =&gt; Object.assign(this, new base())); } } bases.forEach(base =&gt; { Object.getOwnPropertyNames(base.prototype) .filter(prop =&gt; prop != 'constructor') .forEach(prop =&gt; Bases.prototype[prop] = base.prototype[prop]) }) return Bases; } // test it var grossMan = new Gross(); console.log(`booger is ${grossMan.booger}!`); console.log(`was is ${grossMan.wax}!`); grossMan.pick(); // eww! grossMan.dig(); // yuck!
upvote count: 52
type: Answer

http://stackoverflow.com/a/29973193
has comment: http://stackoverflow.com/comment/48158164
has comment: http://stackoverflow.com/comment/48096517
score: 0
type: AcceptedAnswer
has body: I cant get to the page but I'm guessing you have images that are messing you up try $(window).load(function() { // executes when complete page is fully loaded, including all frames, objects and images resizefunction(); });
accepted answer of: http://stackoverflow.com/q/29973029
answers question: http://stackoverflow.com/q/29973029
has comment: http://stackoverflow.com/comment/48086202
type: Answer
has comment: http://stackoverflow.com/comment/48080958
has comment: http://stackoverflow.com/comment/48068412
has comment: http://stackoverflow.com/comment/48097665

http://stackoverflow.com/q/29878525
type: AnsweredQuestion
has title: Disable dates in pickadate-picker and refresh it
has answer: http://stackoverflow.com/a/30983805
tagged with: pickadate
possible better answer: http://stackoverflow.com/a/29984130
type: Question
has body: I try to disable some dates after I have initialised the Date Picker. I am initialising the picker like this: $( document ).ready(function() { $('#inputDatetime').pickadate({ format: 'dd. mmmm yyyy', formatSubmit: 'yyyy-mm-dd', min: dt, selectYears: 2, selectMonths: true }); }); The user now performs some action that triggers an onChange() event. The disableDates() function prepares some more dates to disable and sets it to the picker using the set method: function disableDates() { var disabledDays = []; $.ajax({ url: 'partners/getInactiveDays', dataType: 'json', async: false, success: function(data) { $.each(data.days, function(i, d) { disabledDays.push(parseInt(d.Day.id)); }); } }); var $input = $('#inputDatetime').pickadate(); var picker = $input.pickadate('picker'); picker.set({ disable: disabledDays }); } Please note that in my case disableDays contains integers (reffering to weekdays) and dates according to the documentation (http://amsul.ca/pickadate.js/date/#disable-dates). When the disableDates() function is triggered for the first time, it correctly disables the dates that I retrieved with AJAX. As soon as it is triggered a second time, the picker does not seem to be updated anymore. I guess the picker has to be rendered again somehow to reflect the changes. I tried to .stop() and .start() and .render(), without any effect. How can I disable dates and refresh the picker correctly?
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/48087466
has comment: http://stackoverflow.com/comment/48087463
downvote count: 1
has answer: http://stackoverflow.com/a/29984130
score: 8
favorite count: 0
upvote count: 9
has answer: http://stackoverflow.com/a/29992789
accepted answer: http://stackoverflow.com/a/29992789
has answer: http://stackoverflow.com/a/67648833
answer count: 4

http://stackoverflow.com/comment/57040906
score: 2
has text: Check this out: http://stackoverflow.com/a/20927897/1291428
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29942328

http://stackoverflow.com/comment/47829372
type: Comment
comment on: http://stackoverflow.com/a/29851589
has text: I tried this and now my datepicker isn't showing up. @Cobote
score: 0
type: AnswerComment

http://stackoverflow.com/comment/47923496
has text: your expected result is invalid structure
score: 3
comment on: http://stackoverflow.com/q/29900404
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29991957
has body: Nowadays most javascript engines are JIT compilers. More here: What does a just-in-time (JIT) compiler do? So yes, javascript is compiled (not interpreted), and most major browsers do it differently.
score: 0
answers question: http://stackoverflow.com/q/29991742
type: Answer

http://stackoverflow.com/comment/48104431
has text: You will have to bind each event on the document as a queue then only you can use clearQueue. You can do it like as follows:$(document).queue(function(){ $(this).keypress(function(){ }) });
type: Comment
comment on: http://stackoverflow.com/a/29991240
score: 0
type: AnswerComment

http://stackoverflow.com/comment/47873471
type: QuestionComment
comment on: http://stackoverflow.com/q/29874093
type: Comment
has text: The url you marked it as duplicate of (your own answer) is not really the same.
score: 0

http://stackoverflow.com/a/29872273
type: AcceptedAnswer
has body: There seems to be several problems. You need to use &lt;script src="https://apis.google.com/js/client.js?onload=googleApiClientReady"&gt;&lt;/script&gt; instead of &lt;script src="https://apis.google.com/js/client.js?onload=onClientLoad" type="text/javascript"&gt;&lt;/script&gt; because you need to make sure the initialization function googleApiClientReady() in auth.js is called. However, the Google API also reports that there exists no OAuth client with the ID trusty-sentinel-92304. Edit: If don't have an OAuth client ID, but rather an API key, you shouldn't use the auth API at all. Instead, you need to add the API key as parameter to each API call (as described here: https://developers.google.com/youtube/v3/docs/standard_parameters). Try this as a start: gapi.client.load('youtube', 'v3', function() { var request = gapi.client.youtube.search.list({ key: "YOUR_API_KEY", q: "cats", part: 'snippet' }); request.execute(function(response) { var str = JSON.stringify(response.result); console.log(str); }); });
type: Answer
answers question: http://stackoverflow.com/q/29872204
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/47869597
accepted answer of: http://stackoverflow.com/q/29872204
downvote count: 0
has comment: http://stackoverflow.com/comment/48120980

http://stackoverflow.com/a/29942881
type: Answer
has body: || condition for both object will return only first object if it has value to it. If you wish to use it as separator, you need to concatenate it in both data and then set it to span: $('#spanid').text(data[i].phonenumber +"||"+ data[i].mobilenumber);
score: 0
upvote count: 1
downvote count: 1
answers question: http://stackoverflow.com/q/29942823
has comment: http://stackoverflow.com/comment/48006641

http://stackoverflow.com/comment/48020126
type: AnswerComment
comment on: http://stackoverflow.com/a/29949628
has text: you are using different different units; for example `vh` `px` `%`. please be consistent .
type: Comment
score: 0

rasterize
type: Tag
tags question: http://stackoverflow.com/q/29864245
tag name: rasterize

http://stackoverflow.com/a/29934988
type: Answer
answers question: http://stackoverflow.com/q/29934317
has body: you can try this: child1.style.height= "50px"; OR child1.setAttribute("style", "height: 50px;");
score: 0

http://stackoverflow.com/a/29947842
upvote count: 1
score: 1
downvote count: 0
has body: You can just create a new array with your computed values var a = {key:'animals', options: ['dog','cat','penguin']}; var b = [ a.key, a.options.join('') ]; document.write(JSON.stringify(b));
answers question: http://stackoverflow.com/q/29947740
type: Answer

http://stackoverflow.com/a/29945743
has body: For those of you that like my approach and looking for a solution for this, Here is how I come up with. I convert my PDF to an image (.PNG). Adjust your HTML structure Wrap them around a div or span. &lt;span id="web"&gt; &lt;!-- Whole HTML structure --&gt; &lt;/span&gt; &lt;span id="print" style="display: none;" &gt; &lt;img src="img/Image.png" width="90%"&gt; &lt;/span&gt; Link to a print stylesheet. Add this to the top of your page. &lt;link rel="stylesheet" media="print" href="css/print.css" /&gt; Recap I hide my image as a start. `&lt;span id="print" style="display: none;" &gt;&lt;img src="img/Image.png" width="90%"&gt;&lt;/span&gt;` Then, I show it back when the user is in the print mode, another word media =print, then my print.css will kick in. print.css /*Hide the whole page*/ #web{ display: none; } /*Show Image back*/ #print{ display:block!important; background-color: white; } Result When the user trying to print, now they should see something like this : This should work on any browsers, since it just an image.
type: AcceptedAnswer
type: Answer
score: 0
accepted answer of: http://stackoverflow.com/q/29928206
answers question: http://stackoverflow.com/q/29928206

http://stackoverflow.com/comment/48029389
type: Comment
type: QuestionComment
has text: Did you try running the string through `JSON.parse` first ?
score: 0
comment on: http://stackoverflow.com/q/29954287

http://stackoverflow.com/q/29963007
score: -1
tagged with: angularjs
has body: I get a message " Error: [ng:areq] Argument 'curController' is not a function, got string " when I try to put a variable into ng-controller param &lt;div ng-include="templates[selected-1]" ng-controller='curController'&gt; controller for(i=0;i&lt;$scope.cours.length;i++){ switch($scope.cours[i].type){ case "c1": $scope.controllers[i]="cours1Display" $scope.templates[i]="views/cours/cours1.html" break; case "c2": $scope.controllers[i]="cours2Display" $scope.templates[i]="views/cours/cours2.html" break; case "c3": $scope.controllers[i]="cours3Display" $scope.templates[i]="views/cours/cours3.html" break; case "c4": $scope.controllers[i]="cours4Display" $scope.templates[i]="views/cours/cours4.html" break; case "exo1": $scope.controllers[i]="exo1Display") $scope.templates[i]="views/exos/exo1Decorator.html" break; case "exo2": $scope.controllers[i]="exo2Display" $scope.templates[i]="views/exos/exo2Decorator.html" break; case "exo3": $scope.controllers[i]="exo3Display" $scope.templates[i]="views/exos/exo3Decorator.html" break; } curController = $scope.controllers[0] $scope.pageChanged=function(){ alert($scope.selected) curController = $scope.controllers[$scope.selected-1] }
answer count: 1
downvote count: 1
has title: ng-controller doesn't work when its parameter is a variable
type: UnansweredQuestion
tagged with: ng-controller
upvote count: 0
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/29963258
type: Question

http://stackoverflow.com/q/29969625
has title: Why do max and min get called after subscription yields values?
has answer: http://stackoverflow.com/a/30295449
has comment: http://stackoverflow.com/comment/48178789
upvote count: 1
type: AnsweredQuestion
score: 1
type: Question
accepted answer: http://stackoverflow.com/a/30295449
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: rxjs
has comment: http://stackoverflow.com/comment/48075178
favorite count: 0
has body: I have a collection of objects that I need to know what the number range is before I process any items in the collection. I came up with code similar to what is below, and it seems to give the correct answer: var arr = Rx.Observable.fromArray([10,-10,4,-5,20,4,7]), //In actual code this is an array of objects, so have a custom compare function numberComparer = function(a,b) { return a-b; }; //In actual code this is prefixed by a filter and mapping operation arr.flatMap(function(x) { return Rx.Observable.zip( arr.max(numberComparer), arr.min(numberComparer), function(max, min) { return { stats: {max: max, min: min}, item: x }; } ); }) .subscribe(function(item) { DoStuffWithItem(item.item, item.stats); }); But I'm a bit confused about what is going on behind the scenes. The comparer functions are giving the right answers when the first item is yielded to the subscribe method, but then they continue to be called between item yields. Here is a JSBin showing what I mean. Am I doing something wrong here? Is there a better, more Rx-y way to do this? What I was expecting to happen was that the max and min values would be computed first, and then the subscription function would be invoked with no other calls to max or min. Edit: It looks like maybe the behavior is that it is continuously recomparing with what hasn't been output yet, which explains partially why I'm seeing the behavior. I just don't understand why it is doing that (and how to make it stop) :)

http://stackoverflow.com/q/29924032
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29924267
has body: I want to be able to iterate through a number of ids called "#option1", "#option2" etc. The problem is its for an interactive form and I don't know how many options there will be. So I need a way to iterate through the amount in the DOM when the user clicks ("#dothis"). Then I need to get the values of the those options, put into an array called arraylist. $("#doThis").on("click", function() { var optionone = $("#option1").val(); var optiontwo = $("#option2").val(); var optionthree = $("#option3").val(); var optionfour = $("#option4").val(); var optionfive = $("#option5").val(); var arrayList = [optionone, optiontwo, optionthree, optionfour, optionfive]; var decide = arrayList[Math.floor(Math.random() * arrayList.length)]; $("#verdict").text(decide); }); // end of dothis click event
score: 0
accepted answer: http://stackoverflow.com/a/29924277
tagged with: iterated-function
has comment: http://stackoverflow.com/comment/47969747
has answer: http://stackoverflow.com/a/29924277
possible better answer: http://stackoverflow.com/a/29924267
linked to: http://stackoverflow.com/q/23223526
has title: Iterate through Id's, store values, put into an array
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47970180
type: Question
answer count: 2
tagged with: arrays

http://stackoverflow.com/comment/47892129
score: 1
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29883966
has text: Is that getScript being sent more than once? Easy enough to check in network tab of dev tools console. Or is `$('.modifier').live('click'` inside some other event handler?

http://stackoverflow.com/comment/48191960
has text: Essentially it works, but I thought you wanted to add more bulbs, as in a few bulbs next to eachother.. for that to work you still need to rewrite your code a bit. Or did I misunderstand that, do you only need the one bulb, and just need to change the `devider`?
comment on: http://stackoverflow.com/q/29995337
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/48077525
type: QuestionComment
comment on: http://stackoverflow.com/q/29976787
type: Comment
score: 0
has text: Hm, have you checked all the urls in `chrome.tabs.create` are Fully-qualified URLs which include a scheme (i.e. 'http://www.google.com', not 'www.google.com'). Relative URLs will be relative to the current page within the extension.

http://stackoverflow.com/q/29853333
downvote count: 0
tagged with: url
tagged with: javascript
tagged with: express
favorite count: 0
score: 9
has title: Importing a json file from a url using node js (express)
has body: I'm a node.js beginner. I'm trying to request a json file from a url (i.e 'http://www.example.com/sample_data.json'). My goal is to download/request the file only once when the server loads and then save it on the client side so I can manipulate/change it locally. I tried var file = request('http//exmaple.com/sample_data.json') but it returns an import module error. If anyone could give me a start that would be great! thanks
type: AnsweredQuestion
type: Question
has answer: http://stackoverflow.com/a/29853436
upvote count: 9
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/29853445
possible better answer: http://stackoverflow.com/a/29853436
answer count: 2
accepted answer: http://stackoverflow.com/a/29853445

http://stackoverflow.com/comment/47922830
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29899721
has text: @FrédéricHamidi, you're right. It's returning the object not a string. By taking the quotes out, I'm able to get the first_name. Now I need to get "null" out of the output when the representative doesn't have a nickname. Probably something like an else if...

http://stackoverflow.com/q/29875706
answer count: 0
tagged with: twitter-bootstrap
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47875826
has body: I'm having an issue with opening collapsed menus for pages that aren't located in the root folder. The navbar is part of the masterpage and it works fine on all pages located in the root folder but when the page is located in a subfolder the button to open the collapsed menu won't respond (For instance: For ./Default the menu appears and when collapsed the button drops down a menu as intended, but for ./Admin/Default the menu is visible but onced it is collapsed the button is unresponsive). Being that it's part of the code for the masterpage, I don't understand why this is only occuring on certain pages. <%@ Master Language="VB" CodeFile="MasterPage.master.vb" Inherits`="MasterPage" %> <asp:ContentPlaceHolder id="head" runat="server"></asp:ContentPlaceHolder> <asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" ShowStartingNode="false" /> Toggle navigation SLPL Automated Circulation System <asp:Menu ID="menu_Master" runat="server" EnableViewState="false" IncludeStyleBlock="false" Orientation="vertical" StaticMenuStyle-CssClass="nav navbar-nav" StaticSelectedStyle-CssClass="active" DynamicMenuStyle-CssClass="dropdown dropdown-menu" DataSourceID="SiteMapDataSource1"></asp:Menu> <asp:LoginStatus ID="LoginStatus1" runat="server" LogoutPageUrl="~/Default.aspx" /> <asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server"></asp:ContentPlaceHolder> <asp:ContentPlaceHolder id="ContentPlaceHolder2" runat="server"></asp:ContentPlaceHolder>
type: Question
has comment: http://stackoverflow.com/comment/81189490
has title: Collapsed Bootstrap navbar button won't work on pages that aren't located in the root folder
has comment: http://stackoverflow.com/comment/47891110
score: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/47877312
tagged with: asp.net

http://stackoverflow.com/comment/48082943
score: 0
type: AnswerComment
has text: @JoeEnzminger, I checked the code of the master branch, albeit briefly, so I may have been mistaken. I'll take a look again.
comment on: http://stackoverflow.com/a/29979580
type: Comment

http://stackoverflow.com/comment/47918443
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29896900
has text: Yeah. It gets kind of tough then. Can you tell different conventions (day, month, year - month, day, year etc.) apart? That could be another problem for you.
type: Comment

http://stackoverflow.com/comment/66637656
has text: This seems right. Same proposed solution here: https://github.com/ftlabs/fastclick/issues/466
comment on: http://stackoverflow.com/a/30652257
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/29890242
tagged with: javascript
score: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/47904387
type: Question
tagged with: cordova
linked to: http://stackoverflow.com/q/27652554
tagged with: file
upvote count: 1
has comment: http://stackoverflow.com/comment/47905805
type: UnansweredQuestion
has body: is it possible to download a file in the inappbrowser? This my simple web programm. i open it in my inappbrowser and will download a file after click the download button. But atm notting happends.. function startWrapper(result) { iabRef = window.open(result, "_blank", 'location=no'); iabRef.addEventListener('loadstart', iabLoadStart); iabRef.addEventListener('loadstop', iabLoadStop); iabRef.removeEventListener('loaderror', iabLoadError); iabRef.addEventListener('exit', iabClose); } Is it possible and how?
has title: Inappbrowser download a file in the browser
has comment: http://stackoverflow.com/comment/47904295
tagged with: inappbrowser
downvote count: 0
answer count: 0

http://stackoverflow.com/comment/48051486
type: Comment
has text: Aaaa, I think I get it now. Your problem isn't just "should you show toggle button" but also what divs should you hide? I'll update my answer. Let me know have I understood you correctly this time :)
comment on: http://stackoverflow.com/a/29962357
score: 0
type: AnswerComment

http://stackoverflow.com/comment/47987133
type: AnswerComment
has text: Okay thanks, I was trying to understand how Firebase is able to detect that the same anonymous user is visiting again. From my own testing it appears that loging the user in on Chrome and then closing the browser window and opening it again, Firebase is able to remember that it's the same user. But firefox is treated as a new user so it must be based on the browser client rather than the machine. This wasn't clear to me in the Firebase docs.
type: Comment
comment on: http://stackoverflow.com/a/29924117
score: 1

http://stackoverflow.com/comment/48077636
type: QuestionComment
has text: All references to the match would have to be removed for it to get garbage collection (which also doesn't happen instantly). What does `init` look like?
comment on: http://stackoverflow.com/q/29978971
score: 0
type: Comment

http://stackoverflow.com/q/29916030
upvote count: 1
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/48033858
score: 1
type: Question
has comment: http://stackoverflow.com/comment/47994670
accepted answer: http://stackoverflow.com/a/30073315
has title: What is famous-gl ?
downvote count: 0
has comment: http://stackoverflow.com/comment/48038084
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/48023598
answer count: 1
has body: In a lot of of codepen samples of Famo.us I see people including famous-gl references for rendering things, but I cannot find which library is to be referenced to use it nor I can find any documentation on it can someone guide me in the correct direction ?
tagged with: famo.us
has comment: http://stackoverflow.com/comment/48019877
has answer: http://stackoverflow.com/a/30073315

http://stackoverflow.com/comment/47935661
has text: Alternatively, you can iterate through the array and modify the properties properties of `checklogs.logs[i]` if you want additional properties for each item element.
type: QuestionComment
type: Comment
score: 0
comment on: http://stackoverflow.com/q/29888424

http://stackoverflow.com/q/29987956
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/48095253
upvote count: 1
has comment: http://stackoverflow.com/comment/48095224
favorite count: 0
linked to: http://stackoverflow.com/q/7954831
linked to: http://stackoverflow.com/q/29992310
answer count: 0
has body: <?php for($i = 0; $i < $pin_num_rows; $i++){ ?> <form action="/group/<?php echo $group_id ?>?Comment=<?php echo $pin_id[$i] ?>" method="post" id="group-comment-form"> <?php } ?> This is the some part of my code. As you can see, I am passing the value of pin_id in my form action. The problem is, whenever I post comment, the form submits the value with /group/?Comment=1 but it supposed to submit with 1, when I comment to the first post. So, when I comment to the second post, it supposed pass 2 but it doesn't. It always passes /group/?Comment=1 I did echo this right after my textarea and I see that for every comment form, the number increments as it should be but when I submit, it submits with value 1. I am going crazy. <?php echo "/group/<?php echo $group_id ?>?Comment=$pin_id[$i]" ?> I have also this part in my code in the same loop above and it has the same logic but it works. I don't understand why the form part doesn't work. <a href="/group/<?php echo $group_id ?>?Edit=<?php echo $pin_id[$i] ?>" title="Edit" id="group-edit-button">Edit <a href="/group/<?php echo $group_id ?>?Delete=<?php echo $pin_id[$i] ?>" title="Delete" id="group-delete-button">Delete EDIT I wrote this simple program which demonstrates the same logic that I used for the site and this simple program works but website. I guess the problem is not about the names of form or textarea. <?php $inputValue = NULL; $id = [1,2,3]; if(isset($_POST['inputName'])){ $inputValue = $_POST['inputName']; echo " Input Value: " . $inputValue; } if(isset($_GET['id'])){ $getValue = $_GET['id']; echo " Get Value: " . $getValue; } ?> Multiple Forms in One Page Main Page <?php for($i = 0; $i < 3; $i++){ ?> <form action="index.php?id=<?php echo $id[$i] ?>" method="post" name="formName"> <?php } ?> FOUND THE PROBLEM (BUT STILL NEED FIX) I use this script to submit my forms. I don't have a submit button to submit. If I use submit button, everything works perfect but if I use this script above to submit the form, it won't w…
type: UnansweredQuestion
tagged with: php
has comment: http://stackoverflow.com/comment/48095572
has title: Passing url parameters in form action attribute
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/48098207
tagged with: forms
has comment: http://stackoverflow.com/comment/48099102
has comment: http://stackoverflow.com/comment/48095233
type: Question

http://stackoverflow.com/q/29970316
has title: How to access functions of a controller from within another controller via scope?
type: UnansweredQuestion
tagged with: angularjs-controller
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/48061680
has body: I have the following problem, I want to call a function of another controller from within a controller I want to use for a guided tour (I'm using ngJoyRide for the tour). The function I want to call in the other controller is so to say a translator (LanguageController), which fetches a string from a database according to the key given as parameter. The LanguageController will, if the key is not found, return an error that the string could not be fetched from the database. In my index.html fetching the string works, but I want to use it in the overlay element of my guided tour, which does not work, but only shows the "not fetched yet"-error of the LanguageController. My index.html looks like this: ... {{lc.getTerm('system_lang_edit')}} ... The controller I'm using for the guided Tour looks like this: guidedTourModule.controller('GuidedTourCtrl',['$scope', function($scope) { $scope.startJoyRide = false; this.start = function () { $scope.startJoyRide = true; } $scope.config = [ { type: "title", ... }, { type: "element", selector: "#groups", heading: "heading", text: " \ "\ + $scope.lc.getTerm('system_navi_messages') + "\ text text text text\ \ \ \ ", placement: "right", scroll: true, attachToBody: true } ]; ... }]); And the output I ultimately get looks like this for the overlay element: not fetched yet: system_navi_messages text text text text ... I hope someone can see the error in my code. Thanks in advance!
tagged with: angularjs-scope
score: 0
has comment: http://stackoverflow.com/comment/48060497
answer count: 1
tagged with: angularjs
has comment: http://stackoverflow.com/comment/48060621
has comment: http://stackoverflow.com/comment/48217424
has answer: http://stackoverflow.com/a/30025097

http://stackoverflow.com/q/29990660
tagged with: jquery
score: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/48101093
type: Question
answer count: 2
tagged with: http://stackoverflow.com/tag/html
tagged with: php
tagged with: css
has answer: http://stackoverflow.com/a/29990936
has title: Run JavaScript From Dynamically Created Links
upvote count: 1
has comment: http://stackoverflow.com/comment/48100991
has comment: http://stackoverflow.com/comment/48101155
has body: I am creating a blog style website in which it pulls information from a database to create each post dynamically. Once all the posts have been created the header from each of the posts will open an overlaid div which brings up the whole article for that particular post. How the posts are created... <?php $sql = 'SELECT * FROM posts ORDER BY Post_ID DESC'; $result = mysqli_query($conn, $sql); if($result){ while($row = mysqli_fetch_assoc($result)){ ?> <td class="<?php if($row['Post_Featured'] == 0) {echo 'visualPost';} else {echo 'featuredPost';} ?>" id="<?php echo $row['Post_ID']; ?>"> <a id="openOverlay" name="<?php echo $row['Post_ID']; ?>" href="#"> <?php echo $row['Post_Title']; ?> <img src="images/<?php echo $row['Post_Image_Embed']; ?>" width="100%"> <?php echo $row['Post_Blurb']; ?> Votes:<?php echo $row['Post_Votes']; ?> <?php } } ?> JavaScript var createOverlay = document.getElementById("openOverlay"); var destroyOverlay = document.getElementById("closeOverlay"); createOverlay.onclick = toggleOverlay; destroyOverlay.onclick = toggleOverlay; function toggleOverlay() { var postID = $(this).attr('name'); var specialBox = document.getElementById('specialBox'); var container = document.getElementById('container'); if (container.style.display == "block") { document.body.style.overflowY = "hidden"; container.style.display = "none"; specialBox.style.display = "none"; $("body").mousewheel(function (event, delta) { this.scrollLeft -= (delta * 20); event.preventDefault(); }); $('div#postOverlay').empty(); } else { document.body.style.overflowX = "hidden"; container.style.display = "block"; specialBox.style.display = "block"; $("body").unmousewheel(); $.ajax({ type: "POST", url: "overlayFill.php", data: { 'id': postID }, success: function (data) { $('div#postOverlay').append(data); } }); } event.preventDefault(); } I tried using document.getElementById('openOverlay') to grab the link and run the JavaScript needed to bring up the overlay depending on the post and running…
downvote count: 0
accepted answer: http://stackoverflow.com/a/29990936
has comment: http://stackoverflow.com/comment/48100952
tagged with: javascript
possible better answer: http://stackoverflow.com/a/29990873
has answer: http://stackoverflow.com/a/29990873
has comment: http://stackoverflow.com/comment/48101334
type: AnsweredQuestion

http://stackoverflow.com/comment/47910122
score: 3
comment on: http://stackoverflow.com/q/29893240
type: QuestionComment
has text: It's not a matter of security it's a matter of maintainability, to avoid rhetorical questions like "where the f*** did I put that callback function ?!!"...
type: Comment

http://stackoverflow.com/comment/48187526
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29991941
has text: @NewDev, my question is about `then`'s fail callback vs catch. The question in your link is about `error` vs `catch`. They're different.
score: 0

popup
tags question: http://stackoverflow.com/q/29852730
tags question: http://stackoverflow.com/q/29864557
type: Tag
tags question: http://stackoverflow.com/q/29847873
tag name: popup
tags question: http://stackoverflow.com/q/29962346
tags question: http://stackoverflow.com/q/29933303
tags question: http://stackoverflow.com/q/29912217
tags question: http://stackoverflow.com/q/29953261
tags question: http://stackoverflow.com/q/29948487
tags question: http://stackoverflow.com/q/29936462
tags question: http://stackoverflow.com/q/29961050
tags question: http://stackoverflow.com/q/29851653
tags question: http://stackoverflow.com/q/29982229

http://stackoverflow.com/a/29935885
accepted answer of: http://stackoverflow.com/q/29935288
type: Answer
answers question: http://stackoverflow.com/q/29935288
has body: If you want to append the data while doing post you could simply use angular.extend method OR more simpler way would would be you can access that object using literal &amp; set its value. Code $scope.addNew = function(product, AddNewForm) { angular.extend({}, product, {date_update: currentDate}); //product["date_update"] = currentDate; //this is alternative $http.post('api/add', product).success(function(data){ // And also I've tried to add it from here console.log(data); $scope.reset(); $scope.activePath = $location.path('/products'); }); $scope.reset = function() { $scope.product = angular.copy($scope.master); }; $scope.reset(); };
has comment: http://stackoverflow.com/comment/48000590
downvote count: 0
score: 1
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/q/29871864
possible better answer: http://stackoverflow.com/a/29872118
has answer: http://stackoverflow.com/a/29872128
downvote count: 0
has answer: http://stackoverflow.com/a/29872118
has title: Audio tag, how to handle it from Angular
favorite count: 0
tagged with: angularjs
tagged with: http://stackoverflow.com/tag/html
upvote count: 6
tagged with: audio
type: AnsweredQuestion
tagged with: html5-audio
accepted answer: http://stackoverflow.com/a/29872128
score: 6
type: Question
has body: I am using the HTML5 audio tag, but I want to control it from Angular, according to the guidelines I don't have to touch the DOM from the Controllers so I have to create a Directive. Let's say I have this 2 buttons Play Music Pause Music and this in the JS part var music = document.getElementById("myMusic"); function playMusic() { music.play(); } function pauseMusic() { music.pause(); } but I need to transcript that into Angular, so, how can I create a directive for that ? or hoy can I implement it in a Controller ?
tagged with: javascript
answer count: 2

http://stackoverflow.com/q/29944418
upvote count: 15
has comment: http://stackoverflow.com/comment/48009739
has answer: http://stackoverflow.com/a/63919963
has answer: http://stackoverflow.com/a/29945072
tagged with: javascript
tagged with: jquery
has body: I'mm using https://select2.github.io/examples.html but I don't want the border radius. How can I remove border radius to make the search box as well as the sliding area ?
score: 14
has title: How to remove the default border radius ,Select2
favorite count: 0
has answer: http://stackoverflow.com/a/51087819
tagged with: jquery-select2
has answer: http://stackoverflow.com/a/29944606
answer count: 5
has comment: http://stackoverflow.com/comment/48009632
possible better answer: http://stackoverflow.com/a/29944633
tagged with: css
has answer: http://stackoverflow.com/a/29944633
type: AnsweredQuestion
downvote count: 1
accepted answer: http://stackoverflow.com/a/29944606
type: Question

http://stackoverflow.com/q/29976871
has comment: http://stackoverflow.com/comment/48073307
tagged with: css
has answer: http://stackoverflow.com/a/29977520
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/48074102
type: Question
accepted answer: http://stackoverflow.com/a/29977520
tagged with: javascript
tagged with: jquery
score: 0
answer count: 2
tagged with: http://stackoverflow.com/tag/html
has body: I have this code to made the header and an img in the header to shrink when scrolling down. It works fine except it's really jumpy as one css attribute changes before the other. Is there a way to make both change at the same time? $(window).scroll(function() { if ($(this).scrollTop() &gt; 0){ $('#section-header-0').css({ 'line-height' : '44px' }); $('#logo').css({ 'width' : '200px' }); } else{ $('#section-header-0').css({ 'line-height' : '96px' }); $('#logo').css({ 'width' : '394px' }); } });
linked to: http://stackoverflow.com/q/10555998
has comment: http://stackoverflow.com/comment/48073343
possible better answer: http://stackoverflow.com/a/29977411
has title: How to make different css attributes change on multiple elements at the same time with jQuery
has answer: http://stackoverflow.com/a/29977411

http://stackoverflow.com/a/29896000
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29895032
type: Answer
answers question: http://stackoverflow.com/q/29895032
has body: You need to bind to a static or preexisting element that the dynamic elements will be created inside of: $(document).on('mouseenter','.identifierClass',function(e) { if(condition) // is true { $(element).attr("href", "url/goes/here").attr("target", "_blank"); } }); Edit: here is a fiddle of it and I also had to use 'mouseenter' instead of 'hover' when using the string name for the event. jquery .hover() documentation In the fiddle i show you two divs being added dynamically: $('#place').html(' hover1 hover2 '); Above that, I set my event handlers, for hover1 div, I set the event on the document using a specified selector: $(document).on('mouseenter','.identifierClass',function(e) { alert('hi'); }); You can see this works when you hover of 'hover1' text on the right and, conversely, you can see hover2 doesn't work using this binding: $('.identifierClass2').hover(function(e) { alert('hi2'); }); here is a link to the jquery documentation on event delegation. Edit2: I updated the fiddle to address the 'href' manipulation. It appears that you just want to change some attributes on the hover portion: I modified the 'mouseenter' binding to look like this: $(document).on('mouseenter','.identifierClass',function(e) { alert('hi'); $('#someLink').attr('href','http://www.bing.com').attr('target','_blank'); }); I don't think you need the 'off' or the 'click', but that is based off of some assumptions, so please feel free to comment and I can update accordingly. This, though, will change the href when the mouseenters the dynamic element and change the target attribute as well.
score: 2
upvote count: 2

http://stackoverflow.com/comment/47949754
has text: @jdphenix Thanks .. It wont come in larger string . But the above returns true for "\91123" and "1-91123". If - is there then + shall be there and vice versa . Can you please update the regex accordingly ?
type: AnswerComment
comment on: http://stackoverflow.com/a/29912710
score: 0
type: Comment

http://stackoverflow.com/q/29944387
linked to: http://stackoverflow.com/q/17761373
tagged with: ftp
score: 1
has comment: http://stackoverflow.com/comment/48010611
tagged with: google-chrome
downvote count: 1
has answer: http://stackoverflow.com/a/44730371
type: Question
linked to: http://stackoverflow.com/q/166221
has body: I have a chrome extension, so it's pure javascript + chrome api. I want to upload via FTP protocol a file. I have understood that vanilla javascript can't do FTP request. But is there any other way ? I'm in a Chrome extension but I haven't find any ftp purpoes in the online API And I have to clarify, I have to upload a file via FTP on black box. I don't have any control on it. And this black box is not accessible via Internet, only via local network.
has comment: http://stackoverflow.com/comment/48010421
has comment: http://stackoverflow.com/comment/48009567
tagged with: javascript
has comment: http://stackoverflow.com/comment/48009598
has comment: http://stackoverflow.com/comment/48010309
tagged with: google-chrome-extension
answer count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/48009551
favorite count: 0
upvote count: 2
type: UnansweredQuestion
has title: Upload file via FTP using javascript (Chrome Extension)
linked to: http://stackoverflow.com/q/13921970

http://stackoverflow.com/comment/47889559
type: Comment
score: 0
comment on: http://stackoverflow.com/q/29867924
type: QuestionComment
has text: Thanks - unfortunately, the link (for similar issue) says the only way is to fetch the values manually before binding and then applying them manually to the model (which mostly defeats the purpose of using knockout)... If there's no other way I'll probably turn off autocomplete on the forms to side step the problem. It's not ideal but avoids the flicker.

http://stackoverflow.com/q/29851366
answer count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/47830075
accepted answer: http://stackoverflow.com/a/29852511
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
tagged with: cookies
has body: I've been asked for a simple solution to add to links on a blog that would pop-up a warning before going to that link. Only if you agree do you go on to that link. The first solution works fine (and I got it here): Click Me However, now I've been asked to have a checkbox in the pop-up that says something like "I understand" and then a button to continue. If it isn't checked or if they click outside the box (or the X close button if there is one), then it just goes back to the page they were on. If it IS checked and they click continue it goes to the URL on the link (as above). Along with this, I need to set a browser cookie ONLY if the dialog is checked and continue hit. I've set cookie's in browser with JS before, but not attached to to an event like this, so I'm not sure how to do that either. I've done many searches here and on the net in general and can't seem to find any examples that do this. I have found that there's no way to do this with a standard confirm dialog and would need to use jQuery and that's fine, but I still can't find an example. Any help is much appreciated.
has comment: http://stackoverflow.com/comment/47830297
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/29852511
has comment: http://stackoverflow.com/comment/47829701
has title: How to: jQuery/JS Dialog box with checkbox on a link with click event (to go to that link)
score: 0

http://stackoverflow.com/comment/55504865
comment on: http://stackoverflow.com/a/29927322
type: Comment
has text: for future dev coming here, this is the flag url: chrome://flags/#enable-experimental-web-platform-features
score: 0
type: AnswerComment

http://stackoverflow.com/q/29900868
has comment: http://stackoverflow.com/comment/47925309
has comment: http://stackoverflow.com/comment/47924521
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47925408
has comment: http://stackoverflow.com/comment/47925499
answer count: 0
type: Question
tagged with: c#
has comment: http://stackoverflow.com/comment/47925319
tagged with: javascript
tagged with: jquery
has title: why ajax error apper before controller executing
tagged with: ajax
has comment: http://stackoverflow.com/comment/47925246
score: 0
has body: I have this ajax plugin (function ($) { $.fn.Ajax_Data = function (Controller, Action, Data, onsuccess, onerror) { event.preventDefault(); var options = {}; options.url = "/" + Controller + "/" + Action; options.type = "POST"; options.data = JSON.stringify(Data); options.dataType = "json"; options.contentType = "application/json"; options.success = onsuccess; options.eerror = onerror; $.ajax(options); }; })(jQuery); I have this controller [HttpPost] public void Delete(int Id) { Employee Emp = DBCon.Employees.Single(a =&gt; a.Emp_ID == Id); DBCon.Employees.Remove(Emp); DBCon.SaveChanges(); } And finally i can call ajax plugin to invoke controller method like this $(this).Ajax_Data("OnePageGrid", "Delete", { Id: 1}, { onsuccess: document.getElementById("tblBlah").deleteRow(1) }, { onerror: alert('There is something wrong !!') }); the known lifecycle is 1 - execute ajax plugin 2 - invoke controller method 3 - if there is something wrong ajax error message will appear but i have problem here that's when i call ajax plugin the error message appear before controller executing proof that : the error alert is appearing then the tracer on the controller working after that please if any one know the reason or solution for this issue help me

http://stackoverflow.com/a/29942438
score: 1
has body: You are moving the element into the clicked element. var elementsMenu = document.getElementById("elementsMenuContainer") this.appendChild(elementsMenu); At first the menu item's click handler is executed which sets the display property to none and as the click event bubbles then the event handler of the wrapper element is executed and sets the display property to block. You should stop the propagation of the event using stopPropagation method of the event object. var selectElementToCreate = function (event) { event.stopPropagation(); var dataKind = this.getAttribute('data-Kind'); var parentNode = this.parentNode; if (dataKind == "99") { parentNode.style.display = "none"; // ... } }
upvote count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/48005722
type: Answer
answers question: http://stackoverflow.com/q/29942051

http://stackoverflow.com/comment/47959972
score: 0
type: AnswerComment
has text: I'm not a javascript guru so thanks for your clear explanation , I get it now.
type: Comment
comment on: http://stackoverflow.com/a/29908225

http://stackoverflow.com/q/29970372
tagged with: angularjs
has answer: http://stackoverflow.com/a/29971521
accepted answer: http://stackoverflow.com/a/29971463
tagged with: checkbox
type: AnsweredQuestion
score: 2
upvote count: 2
has answer: http://stackoverflow.com/a/29971463
has body: What I'm trying to achieve is to check some checkboxes belonging to a ng-repeat loop iteration when I check a "master" checkbox. My code so far in the view: {{s}} item Subitem A Subitem B Subitem C Where the first checkbox is the "master" and should impose its own state to the "slaves" (the next three checkboxes), no matter what was their previous state. Regarding to the slave checkboxes, they should be checked & unchecked indepently. But If the three are checked at the same time, the master should be too. Whenever only one of them is not checked, the master shouldn't be as well. And my controller: var app = angular.module("CheckAllModule", []); app.controller("checkboxController", function ($scope) { $scope.struct = ['First', 'Second']; $scope.checkAll = function () { if ($scope.selectedAll) { $scope.chk = true; } else { $scope.chk = false; } }; });
type: Question
possible better answer: http://stackoverflow.com/a/29971521
tagged with: javascript
answer count: 2
has title: Select all the checkboxes inside the same loop iteration using AngularJS
downvote count: 0
favorite count: 0

http://stackoverflow.com/comment/47893341
type: AnswerComment
type: Comment
has text: Worked a charm. Thanks
comment on: http://stackoverflow.com/a/29881923
score: 0

http://stackoverflow.com/comment/47976869
has text: Let me refer to this first : http://stackoverflow.com/a/29747779/3168107. In short - if you program your clicks as chains of `mousedown` and `mouseup` or `touchend` and `touchstart` the delay will be gone. Using clicks often won't work because as mentioned before, on mobile they are an emulation of the touch events. The code in the link could probably use an update for unbinding by the way.
comment on: http://stackoverflow.com/q/29925657
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29926193
has body: The situation is similar to pre-ES5 methods to detect arrays properly and reliably. See this great article for the possible pitfalls of implementing isArray. We can use obj.constructor == Map/Set, but that doesn't work on subclass instances (and can easily be deceived) obj instanceof Map/Set, but that still doesn't work across realms (and can be deceived by prototype mangling) obj[Symbol.toStringTag] == "Map"/"Set", but that can trivially be deceived again. To be really sure, we'd need to test whether an object has a MapData/SetData internal slot. Which is not so easily accessible - it's internal. We can use a hack, though: function isMap(o) { try { Map.prototype.has.call(o); // throws if o is not an object or has no MapData return true; } catch(e) { return false; } } function isSet(o) { try { Set.prototype.has.call(o); // throws if o is not an object or has no SetData return true; } catch(e) { return false; } } For common use, I'd recommend instanceof - it's simple, understandable, performant, and works for most reasonable cases. Or you go for duck typing right away and only check whether the object has has/get/set/delete/add/delete methods.
score: 34
has comment: http://stackoverflow.com/comment/72332414
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29924932
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/29924932
upvote count: 34
has comment: http://stackoverflow.com/comment/72324579

http://stackoverflow.com/comment/47886715
comment on: http://stackoverflow.com/q/29881047
has text: Yeah, here is the example. http://mival.de/examples/mival/index.html When u click on the down arrow and then u scroll down the page in chrome, the navi starts to flicker.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29928069
type: AnsweredQuestion
has title: How to show drop menu and hide others in React.js
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29931924
score: 0
tagged with: reactjs
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/47980898
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has body: I just want to know the best way to proceed (don´t need the code, just the way to do it). I´m trying to show a dropdown menu when I click on it´s LI element. var Balloon = React.createClass({displayName: "Balloon", getInitialState: function() { return { shaded: false }; }, handleClick: function(event) { this.setState({ shaded: !this.state.shaded }); }, render: function() { var panel = this.state.shaded ? React.createElement(BalloonPanel, {type: this.props.type, data: this.props.data}) : ""; return ( React.createElement("li", {onClick: this.handleClick}, React.createElement("a", {href: ""}), React.createElement("div", {hidden: true}), React.createElement("div", null, React.createElement("div", {class: "triangle"}, " "), panel ) ) ); } }); Here is the complete code: Thanks in advance.
has answer: http://stackoverflow.com/a/29931924
upvote count: 1
downvote count: 1
type: Question

http://stackoverflow.com/comment/47868631
comment on: http://stackoverflow.com/a/29870558
type: AnswerComment
score: 0
type: Comment
has text: I'm not familiar with plunker, but you can find the source here https://www.dropbox.com/sh/b8eiydxmyveksec/AABwJTiy4j56wZUKHnHzOC9ha/src/main/webapp?dl=0

http://stackoverflow.com/comment/47864299
type: AnswerComment
has text: Only for functions that you pass as props or as event handlers. See [the mdn doc on `this`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/this).
type: Comment
score: 1
comment on: http://stackoverflow.com/a/29868214

http://stackoverflow.com/q/29998777
has comment: http://stackoverflow.com/comment/48116843
tagged with: javascript
tagged with: dom
has answer: http://stackoverflow.com/a/29999008
answer count: 1
downvote count: 0
favorite count: 0
has title: How to coordinate Javascript method call based on form field check?
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/48140514
score: 1
has body: In the following code, how do I synchronize the calling of do_something() based on a successful addLoadEvent(check_email) ? Surrounding it in an if() {} does not work. Do I need to use Event/EventListener ? If so, how? index.html: ... Enter email address ... foo.js: function check_email() { in_Forms = document.getElementsByTagName("form"); for (var i = 0; i < in_Forms.length; i++) { in_Forms[i].onsubmit = function () { return check_this_email(this); } } } function check_this_email(some_email) { var ret_val = false; var in_Inputs; in_Inputs = some_email.getElementsByTagName("input"); for (var i = 0; i < in_Inputs.length; i++) { if (in_Inputs[i].className == "email_class") { if (bad_email_check ...) { ret_val = true; alert('enter valid email'); } } } return ret_val; } function addLoadEvent(some_function) { var oldonload = window.onload; if (typeof window.onload != 'function') { window.onload = some_function; } else { window.onload = function() { oldonload(); some_function(); } } } addLoadEvent(check_email); if (email_address_correctly_entered){ do_something(); }
upvote count: 1
type: Question

http://stackoverflow.com/comment/48062150
type: Comment
comment on: http://stackoverflow.com/a/29970017
score: 0
type: AnswerComment
has text: This is great but can you tell me why it doesnt work when you hit the enter button? Yours does the same thing mine does... refresh the page. When i click search it works but when I hit enter it doesnt.

asynchronous
tags question: http://stackoverflow.com/q/29854661
tags question: http://stackoverflow.com/q/29932153
tags question: http://stackoverflow.com/q/29960385
tags question: http://stackoverflow.com/q/29916592
tags question: http://stackoverflow.com/q/29933093
tags question: http://stackoverflow.com/q/29883525
type: Tag
tags question: http://stackoverflow.com/q/29906339
tags question: http://stackoverflow.com/q/29916655
tags question: http://stackoverflow.com/q/29991525
tags question: http://stackoverflow.com/q/29983765
tag name: asynchronous
tags question: http://stackoverflow.com/q/29990378
tags question: http://stackoverflow.com/q/30001713
tags question: http://stackoverflow.com/q/29881061
tags question: http://stackoverflow.com/q/29912641
tags question: http://stackoverflow.com/q/29987028
tags question: http://stackoverflow.com/q/29994396
tags question: http://stackoverflow.com/q/29849041
tags question: http://stackoverflow.com/q/29946353
tags question: http://stackoverflow.com/q/29884500
tags question: http://stackoverflow.com/q/29988667
tags question: http://stackoverflow.com/q/29876626
tags question: http://stackoverflow.com/q/29991136
tags question: http://stackoverflow.com/q/29919169
tags question: http://stackoverflow.com/q/29897810
tags question: http://stackoverflow.com/q/29886134
tags question: http://stackoverflow.com/q/29948474
tags question: http://stackoverflow.com/q/29878084

http://stackoverflow.com/q/29947585
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/30014292
accepted answer: http://stackoverflow.com/a/29991792
has comment: http://stackoverflow.com/comment/48237919
tagged with: jquery
favorite count: 0
tagged with: ajax
type: Question
has answer: http://stackoverflow.com/a/30102198
has title: local AJAX-call to remote site works in Safari but not in other browsers
has comment: http://stackoverflow.com/comment/48233731
has body: I am maintaining a website that uses Javascript. The script uses jQuery and loads some content from the server at which the site is normally hosted. Just for convenience while maintaining the site, I run a local copy of the site on my iMac. This works perfectly fine when I use Safari. But Firefox, Opera and Chrome refuse to work. I guess it is because of cross-domain-policy. (I couldn't test this with IE, because IE has to run in a virtual machine on my iMac, so for this reason it is not possible to access any local files) Is there a setting within Firefox and the other browsers where I can tell the browser that it is ok to ajax-load files that are located on a remote server from a local html-page with a local javascript? In a nutshell: This my html-page: some title This is myScript.js: var errorMsg = function (msg) { //insert the message into the html-page }; var JSONerror = function (jqXHR, textStatus, errorThrown ) { var msg = 'JSON-answer: '+jqXHR.responseText; msg += ' '+'JSON-Errorstatus: '+textStatus; if ($.type(errorThrown) === 'string') { msg += ' '+'Error: '+errorThrown; } errorMsg(msg); }; var JSONreceive = function (JSONobj, StatusString, jqXHR) { //insert the data in JSONobj into the html-page } var StartAJAX = function () { $.ajax({ url: 'http://my.domain.tld/cgi-bin/myPerlScript.pl', data: "lastID=" + lastID + '&qkz=' + Math.random(), dataType: "json", success: JSONreceive, error: JSONerror }); }; There is also an event-listener, that listens for page-scroll and resize and checks some other constraints (like: is there already an ajax-call in progress?). This listener calls StartAJAX. When it calls StartAJAX on a local copy of my page (file:///User/...) within Safari, I get the Ajax-content perfectly fine inserted into my html-document. within the other browsers i get the error-message inserted into the html-page. It is: JSON-Answer: undefined JSON-Errorstatus: error Error: Why does it work in Safari but not in Firefox, Chrome and Opera? How can I make…
tagged with: cross-browser
linked to: http://stackoverflow.com/q/17711924
possible better answer: http://stackoverflow.com/a/29995045
linked to: http://stackoverflow.com/q/26947291
has answer: http://stackoverflow.com/a/29991792
downvote count: 1
has answer: http://stackoverflow.com/a/29995045
score: 8
upvote count: 9
tagged with: javascript
linked to: http://stackoverflow.com/q/30108066
answer count: 4
tagged with: cross-domain

http://stackoverflow.com/comment/47885860
score: 0
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/29880781
has text: @MatthewHarwood That's all you said you needed, right? What else is there? Notice we're iterating over all the objects in the array, all the trends and just getting the ID for the output.

http://stackoverflow.com/comment/47906779
has text: @JoelAlmeida Thanks for that link Joel, certainly looks a more efficient way of doing it! This was just a first revision to try and get the logic behind it, I will not work on more efficient methods of writing it.
comment on: http://stackoverflow.com/q/29891470
score: 0
type: QuestionComment
type: Comment

bresenham
tags question: http://stackoverflow.com/q/29864245
type: Tag
tag name: bresenham

http://stackoverflow.com/comment/47981384
type: QuestionComment
comment on: http://stackoverflow.com/q/29929467
has text: [Let me Google that for you](https://www.google.com/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=cookies%20javascript)
score: 0
type: Comment

http://stackoverflow.com/comment/48023364
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29949441
has text: Your zoom is very big. And set `height: 400px;`

http://stackoverflow.com/q/29970479
linked to: http://stackoverflow.com/q/21919962
has comment: http://stackoverflow.com/comment/48061048
tagged with: javascript
score: -1
has title: Angularjs sharing data between controllers only works 1st time
has body: I am trying to share data between controllers in angularjs using a factory. I have followed other answers to similar questions but I can only get this to work 1st time round. I have an app with 3 states. 1 of the states is a simple calculator. I want the total in the calculator state to also be displayed in a different state. With the code below the total is always displayed as 0. So i think it works 1st time round but does not update when 'total' is changed. Anyone any suggestions?? html: Total {{figure}} calories consumed today 'home' controller: .controller('homeCtrl', function($scope, total) { $scope.figure = total.get(); }) calculator controller: .controller('calcCtrl', function($scope, total) { $scope.result = 0; $scope.reset = function() { $scope.result = 0; }; $scope.add = function(i) { if(!i){ }else { $scope.result = $scope.result + parseInt(i); total.set($scope.result); } }; }); factory .factory('total', function() { var val = 0; return { get: function() { return val; }, set: function(num) { val = parseInt(num); } }; })
downvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/48060683
accepted answer: http://stackoverflow.com/a/29970700
favorite count: 0
has comment: http://stackoverflow.com/comment/48061612
tagged with: angularjs
has answer: http://stackoverflow.com/a/29970700
type: AnsweredQuestion
upvote count: 0
has comment: http://stackoverflow.com/comment/48060622
type: Question

http://stackoverflow.com/a/29883302
has comment: http://stackoverflow.com/comment/47890809
upvote count: 3
type: AcceptedAnswer
has body: Try lowercase event handlers and actually you need a closure to have the [i] work inside the loop. I prefer using this in your case. var favs = document.getElementsByClassName("fav-wrapper"); for (var i = 0; i &lt; favs.length; i++) { favs[i].innerHTML = '&lt;img src="images/favorite.png" /&gt;'; favs[i].onmouseover = function () { this.innerHTML = "&lt;img src='images/favorite_hover.png' /&gt;"; } favs[i].onclick = function () { this.innerHTML = "&lt;img src='images/favorite_on.png' /&gt;"; } } but why not just change the src of the images? var favs = document.getElementsByClassName("fav-wrapper"); for (var i = 0; i &lt; favs.length; i++) { var fav=favs[i]; fav.getElementsByTagName("img")[0].src="images/favorite.png"; fav.onmouseover = function () { this.getElementsByTagName("img")[0].src="images/favorite_hover.png"; } fav.onmouseout = function () { this.getElementsByTagName("img")[0].src="images/favorite.png"; } fav.onclick = function () { this.getElementsByTagName("img")[0].src="images/favorite_on.png"; } } you could do all this with CSS by the way
type: Answer
has comment: http://stackoverflow.com/comment/47891312
has comment: http://stackoverflow.com/comment/47890997
accepted answer of: http://stackoverflow.com/q/29883274
score: 3
downvote count: 0
answers question: http://stackoverflow.com/q/29883274

http://stackoverflow.com/a/68850626
score: 0
type: Answer
has body: I created an api to make a calculator automatically, just put the api inside script tag. I created this api to help more people build their own web apps. If you want to style your calculator just do:
answers question: http://stackoverflow.com/q/29997713

http://stackoverflow.com/comment/47826824
type: QuestionComment
has text: You don't need the json.parse at all. `var d = <?php echo json_encode(...); ?>;` is all that's necessary. remember that JSON **IS** javascript. once php spits out the encoded json into the page, the browser will only see `var d = [valid javascript data here]`
comment on: http://stackoverflow.com/q/29850362
score: 0
type: Comment

http://stackoverflow.com/a/29941129
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29922964
has comment: http://stackoverflow.com/comment/48004306
type: Answer
has comment: http://stackoverflow.com/comment/48004474
has body: You can use load event and then manipulate colors (based on logic). events:{ load:function() { var points = this.series[0].data, lenY = this.yAxis[0].tickPositions.length - 1, lenX = this.xAxis[0].tickPositions.length - 1, x = lenX, tmpX = 0, y = 0, j = 0; $.each(points, function(i, p){ if(p.x == 0 || p.y == 0) { p.update({ color: 'red' },false); } else if(p.x &gt; 0 &amp;&amp; p.y &gt; 0 &amp;&amp; (p.y == x || (p.y + 1) == x)) { p.update({ color: 'green' },false); if(p.y == x) x--; } else if(p.x &gt; 1 &amp;&amp; p.y &gt; 0 &amp;&amp; p.y &gt; x) { p.update({ color: 'orange' },false); } else if(p.x &gt; 0 &amp;&amp; p.y &gt; 0 &amp;&amp; x &gt; 2) { p.update({ color: 'yellow' },false); } }); this.isDirty = true; this.redraw(); } } Example: http://jsfiddle.net/4aqhB/260/
score: 0
accepted answer of: http://stackoverflow.com/q/29922964

http://stackoverflow.com/comment/47917068
score: 0
type: Comment
has text: because you haven't done anything with response in the `post` first callback. Add your logic here.
comment on: http://stackoverflow.com/a/29863980
type: AnswerComment

http://stackoverflow.com/comment/48019935
comment on: http://stackoverflow.com/a/29949262
has text: I use bootstrap, there are almost 300 lines of code. I added more detail to edit #2, please check it out.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/47915777
has text: The `table`tag is not a self-closing tag, please change ` ` and remove the `/`
type: Comment
comment on: http://stackoverflow.com/q/29896599
score: 0
type: QuestionComment

http://stackoverflow.com/q/29861192
tagged with: javascript
has title: Get all selected="selected" values and put into array
has answer: http://stackoverflow.com/a/29861206
score: 0
answer count: 1
tagged with: jquery
accepted answer: http://stackoverflow.com/a/29861206
type: Question
type: AnsweredQuestion
has body: Trying to get all options with a selected="selected" attribute on a page. There are many of these instances on the page but I can only seem to save the first to an array. How the selected="selected" shows up: Store Frontpage Collection Product All Products Page Blog Search page Web Address What I have tried : $('#link_list_links__link_type option:selected').map(function () { return $(this).val(); }); It only returns the first selected="selected" option and not the rest of the iterations. How do I return all of the options on the page with selected="selected"? What am I doing wrong?

http://stackoverflow.com/q/29910376
has comment: http://stackoverflow.com/comment/48014054
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/48020696
has comment: http://stackoverflow.com/comment/47943224
score: 2
has comment: http://stackoverflow.com/comment/47943397
has answer: http://stackoverflow.com/a/29949958
type: Question
tagged with: pygooglechart
tagged with: google-visualization
tagged with: javascript
has title: Google LineChart Won't Draw
has body: I have the following javascript for a LineChart that checks out using JSHint but refuses to display: // Load the LineChart charting package google.load("visualization", "1", { packages: ["corechart", "line", "LineChart"] }); // Set a callback to run when the Google Visualization API is loaded. google.setOnLoadCallback(drawChart); // Callback that creates and populates a data table, // instantiates the line chart, passes in the data and // draws it. function drawChart() { var data = google.visualization.DataTable(); data.addColumn('date', 'Date'); data.addColumn('number', 'Sales'); data.addrows([ [new Date(2015, 2, 30), 419.5], [new Date(2015, 2, 31), 497.51], [new Date(2015, 3, 1), 1465.85], [new Date(2015, 3, 2), 2594.71], [new Date(2015, 3, 4), 2620.7], [new Date(2015, 3, 5), 3189.86], [new Date(2015, 3, 6), 4172.96], [new Date(2015, 3, 7), 4332.96], [new Date(2015, 3, 8), 4653.03], [new Date(2015, 3, 9), 4678.98], [new Date(2015, 3, 12), 5626.48], [new Date(2015, 3, 13), 9779.28], [new Date(2015, 3, 14), 10428.3], [new Date(2015, 3, 15), 10647.18], [new Date(2015, 3, 17), 10815.58], [new Date(2015, 3, 20), 11471.58], [new Date(2015, 3, 21), 11875.57], [new Date(2015, 3, 22), 12052.07], [new Date(2015, 3, 23), 13461.14], [new Date(2015, 3, 24), 14072.78], [new Date(2015, 3, 25), 14199.78], [new Date(2015, 3, 27), 14320.28], [new Date(2015, 4, 27), 100000] ]); var options = {}; // Instantiate and draw our chart, passing in some options. var chart = new google.visualization.LineChart(document.getElementById('chart_div')); chart.draw(data, options); } &lt;script type="text/javascript" src="https://www.google.com/jsapi?autoload={'modules':[{'name':'visualization','version':'1.1','packages':['corechart', 'timeline','LineChart']}]}"&gt; &lt;/script&gt; &lt;div id="chart_div"&gt;&lt;/div&gt; So, what am I doing wrong? I have attempted several date construction methods including: [new Date('2015-3-30'), 419.5],
answer count: 1
downvote count: 0
favorite count: 0
upvote count: 2

http://stackoverflow.com/a/29917545
accepted answer of: http://stackoverflow.com/q/29917462
has comment: http://stackoverflow.com/comment/47964725
upvote count: 1
type: AcceptedAnswer
has body: You're getting a string, and you probably want an integer var time = new Date( parseInt( req.query.time, 10) );
type: Answer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/29917462

http://stackoverflow.com/comment/48059487
type: AnswerComment
comment on: http://stackoverflow.com/a/29969934
type: Comment
score: 1
has text: Tried that. Has the same results.

http://stackoverflow.com/comment/48077413
type: Comment
has text: why you don't go in the way ui-router works..why you want to depend on server url
comment on: http://stackoverflow.com/q/29978696
score: 0
type: QuestionComment

http://stackoverflow.com/comment/47828147
has text: I cannot reproduce the described behavior - Instead of 1-Nov-2015, '31-Oct-2015' is generated.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29850799

http://stackoverflow.com/comment/70722541
type: Comment
comment on: http://stackoverflow.com/a/39821505
has text: @Ivan thanks, I will try. inobounce.js can help to prevent the overscroll to body, however it fails if you want to scroll horizontalle and your content height is the same as the container height, though. In general we run into this problem because we embed a web app via a wkwebview.
type: AnswerComment
score: 0

http://stackoverflow.com/q/29909951
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29915176
score: 0
has title: IE 10 Selecting a link does not return correct parent
answer count: 1
has body: I have a function that returns the parent element of selection when text is selected using mouse. Javascript $("#p1").on('mouseup',function(evt){ var selectedParentElement = null,range = window.getSelection().getRangeAt(0); if (rangeSelectsSingleNode(range)) { selectedParentElement = range.startContainer.childNodes[range.startOffset]; } else if (range.startContainer.nodeType === 3) { selectedParentElement = range.startContainer.parentNode; } else { selectedParentElement = range.startContainer; } console.log(selectedParentElement); }) function rangeSelectsSingleNode(range) { var startNode = range.startContainer; return startNode === range.endContainer &amp;&amp; startNode.hasChildNodes() &amp;&amp; range.endOffset === range.startOffset + 1; } In chrome and firefox when i select the link inside contenteditable paragraph, the function returns correct parent node i.e. &lt;a&gt; but in IE 10 it returns parent element as 'paragraph' See JSFiddle
tagged with: contenteditable
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47957920
type: Question

http://stackoverflow.com/q/29871222
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29871805
accepted answer: http://stackoverflow.com/a/29871805
has title: Making a list in HTML from value of textarea
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47867545
score: 1
type: Question
has comment: http://stackoverflow.com/comment/47867387
tagged with: javascript
upvote count: 2
has body: I need a help to make a list using JavaScript. What I’m trying to do is if user clicked submit button elements in textarea making a list in HTML. HTML: Guest List: Submit JavaScript: function submit(){ var guestName = document.getElementById('text'); var listData = [guestName]; var listContainer = document.getElementById('list'); document.getElementsByTagName('body')[0].appendChild(listContainer); var listElement = document.createElement("ul"); guestName.appendChild(listElement); var numberOfListItems = listData.length; for(var i = 0; i < numberOfListItems; ++i){ var listItem = document.createElement("li"); listItem.innerHTML = listData[i]; listElement.appendChild(listItem); } }
has comment: http://stackoverflow.com/comment/47867439
tagged with: textarea
downvote count: 1
answer count: 1
favorite count: 0

http://stackoverflow.com/a/29936313
accepted answer of: http://stackoverflow.com/q/29936188
downvote count: 0
answers question: http://stackoverflow.com/q/29936188
upvote count: 6
type: AcceptedAnswer
has body: You need to get your module and controller set up properly: &lt;script&gt; var app = angular.module('app', []) app.controller('MyController', function($scope){ $scope.author = { 'name' : 'Joe Richard', 'title': 'Android Developer', 'company' : 'Sunet Technologies' } }) &lt;/script&gt; In your html tag make sure you set ng-app="app". Plunker Demo
type: Answer
score: 6

http://stackoverflow.com/comment/48075864
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29978083
score: 1
has text: Why are you commenting out the //alert(data); this would give you a better indication if it completing, also use the developers tools(F12) to monitor the traffic.

http://stackoverflow.com/q/29992383
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/29993142
type: Question
has comment: http://stackoverflow.com/comment/48104329
has answer: http://stackoverflow.com/a/29993142
score: 0
answer count: 2
tagged with: javascript
tagged with: jquery
has body: There is 1 User input text box and array of with a within. When user type "ha" all that does not contain "ha" should hide. whenever input is triggered a function is called to hide and display. I cannot get the input text to select the text that contains them. jQuery(function($) { $(".filter").change(function() { display_function(); }); $('input').on('input', function() { display_function(); }); function display_function() { var input = $('input').val(); $(".wrap").each(function() { if ($(this).hasClass($("option:selected").val())) { if (1) { console.log($(this).children(".name").is(":contains('" + input + "')")); $(this).show(); } else { $(this).hide(); } } else { $(this).hide(); } }); } }); Select.. 1 2 3 4 ha hahaha zxza zzss aasss hahaa hahaha haa ahhh sss
has comment: http://stackoverflow.com/comment/48104419
tagged with: http://stackoverflow.com/tag/html
has title: Hide Div depending on user input
has answer: http://stackoverflow.com/a/29992543
accepted answer: http://stackoverflow.com/a/29992543

http://stackoverflow.com/comment/48106799
comment on: http://stackoverflow.com/q/29993601
score: 0
has text: Have you attempted to do this? What have you tried, if anything? Maybe provide markup of your specific carousel?
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29853219
tagged with: javascript
has title: Applying function to a single newly created element
possible better answer: http://stackoverflow.com/a/29853639
has answer: http://stackoverflow.com/a/29853520
score: 0
has answer: http://stackoverflow.com/a/29853639
tagged with: jquery
accepted answer: http://stackoverflow.com/a/29853512
has body: I could use each to iterate over a set of matched selectors, and apply some functionality such as displaying prompt text in an input. $('.default-value').each(function () { var $t = $(this), default_value = this.value; $t.css('color', '#929292'); $t.focus(function () { if (this.value == default_value) { this.value = ''; $t.css('color', 'black'); } }); $t.blur(function () { if ($.trim(this.value) == '') { $t.css('color', '#929292'); this.value = default_value; } }); }); Instead, I wish to write some JavaScript which takes an array, creates some inputs, and applies the same functionality as above to it. For instance, in the below script, I need to add the functionality to the newly created input elements, and would rather not use each to iterate over them. How can this be accomplished? jQuery.fn.extend({ dialog_prompt: function(obj) { var dialog=$('div') .append($('input',{type: 'hidden',autofocus: 'autofocus'})); var arrayLength = obj.elements.length; for (var i = 0; i &lt; arrayLength; i++) { var input=$('input',obj.elements[i].update?{'class': 'update-value'}:{}); //How do I add the .default-value script to this element? dialog.append(input); } //Other script goes here... return this.each(function () { $(this).dialog(obj); }); } }); EDIT Would it be something like the following? Where do I save default_value? var input=$('input',obj.elements[i].update?{'class': 'update-value'}:{}) .css('color', '#929292') .focus(function () { if (this.value == default_value) { //Where is default_value now applied this.value = ''; $t.css('color', 'black'); } }) .blur(function () { if ($.trim(this.value) == '') { $t.css('color', '#929292'); this.value = default_value; //Where is default_value now applied } })
has answer: http://stackoverflow.com/a/29853447
answer count: 4
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47832378
has comment: http://stackoverflow.com/comment/47832399
type: Question
has answer: http://stackoverflow.com/a/29853512
has comment: http://stackoverflow.com/comment/47832326
has comment: http://stackoverflow.com/comment/47832605

http://stackoverflow.com/q/29861229
type: AnsweredQuestion
score: 1
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/29861603
accepted answer: http://stackoverflow.com/a/29861603
has body: I am using django-jsignature in my django project. After making the post request, the form returns "type 'instance'". I'm trying to save this as an image, but I get the above error. Even better would be to save the form data as a vector image as suggested in the docs. My function: def signature(request): form = SignatureForm(request.POST or None) if form.is_valid(): signature = form.cleaned_data.get('signature') if signature: # as an image signature_picture = draw_signature(signature) signature_file_path = draw_signature(signature, as_file=True) with open(signature_file_path), 'wb') as f: f.write(signature_picture) (signature_file_path == '/tmp/tmpB71Wft.PNG')
possible better answer: http://stackoverflow.com/a/29861502
tagged with: javascript
has title: TypeError: must be string or buffer, not instance
answer count: 2
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/29861502
tagged with: django
tagged with: python

http://stackoverflow.com/comment/47907801
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29891874
has text: Thanks a lot Alex and Rufus, I'll see if I can get this to work. May run into trouble linking this to the buttons themselves...but I'll let you know how I go.
type: AnswerComment

http://stackoverflow.com/comment/47872612
has text: `newSizeA + 'px !important';`
comment on: http://stackoverflow.com/q/29873882
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/a/29963094
has body: The options for the x-axis are under the name xaxes not xaxis therefore they are not used. (Also your min and max values are outside of the data range.) // not xaxes: xaxis: { mode: "time", //min: parseInt((new Date("2015-04-30 10:27:58")).getTime()), //max: parseInt((new Date("2015-04-30 10:43:39")).getTime()), timeformat: "%H/%M/%S" }, See this fiddle for a working example. PS: You use the $.plot() function with setInterval which is okay but you should only call UseTooltip() once.
accepted answer of: http://stackoverflow.com/q/29962008
answers question: http://stackoverflow.com/q/29962008
downvote count: 0
has comment: http://stackoverflow.com/comment/48048430
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/48048590
has comment: http://stackoverflow.com/comment/48048114
type: Answer
upvote count: 1
score: 1

http://stackoverflow.com/q/29977261
has comment: http://stackoverflow.com/comment/55981251
tagged with: javascript
has body: I am making a post request with some javascript to a python script in my /var/www/cgi-bin on my web server, and then in this python script I want to save the image file to my html folder, so it can later be retrieved. Located at /var/www/html, but right now the only way I know how to do this is to set the python script to chmod 777 which I do not want to do. So how else can I save a file that I grab from my webpage using javascript and then send to server with javascript via POST? Currently when I do this I get an error saying the python does not have permission to save, as its chmod is 755. I here is python code, I know it works as the error just says I dont have permission to write the file fh = open("/var/www/html/logo.png", "wb") fh.write(photo.decode('base64')) fh.close()
has answer: http://stackoverflow.com/a/34116375
has title: Save File to Webserver from POST Request
score: 9
has comment: http://stackoverflow.com/comment/55981001
answer count: 2
tagged with: http-post
possible better answer: http://stackoverflow.com/a/34115061
has comment: http://stackoverflow.com/comment/55980962
has comment: http://stackoverflow.com/comment/55981018
has answer: http://stackoverflow.com/a/34115061
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/34116375
tagged with: python
tagged with: php
upvote count: 11
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/55981240
downvote count: 2
has comment: http://stackoverflow.com/comment/55980893
has comment: http://stackoverflow.com/comment/55980970
has comment: http://stackoverflow.com/comment/55980913
type: Question

http://stackoverflow.com/comment/48103098
comment on: http://stackoverflow.com/q/29991742
score: 0
type: QuestionComment
type: Comment
has text: @David thanks . I was wondering about that . I know it could be beneficial in some scenarios . So I am just trying to get more educated on web browser and website code interactions . Thanks torox too.

http://stackoverflow.com/q/29920895
has answer: http://stackoverflow.com/a/29921387
type: Question
answer count: 2
tagged with: jquery-ui
downvote count: 0
tagged with: javascript
tagged with: jquery
has body: I have a sentence with an emphasized word. This emphasized word shall disappear by sliding up and being replaced by another word that slides up as well. I tried using jQuery (edge) and jQuery UI 1.8.9 like this (see fiddle) but can't get it to run: HTML This is my text one two three four five without fear. CSS span { display: none; color: red; } span:first-child { display: inline-block; } JavaScript $(function () { var first = $('span:first-child'); replaceWord(first); }); function replaceWord(word) { var next = word.next(); if (typeof(next) != "undefined") { first.hide("slide", { direction: "up" }, 500, function () { next.show("slide", { direction: "down" }, 1000); replaceWord(next); }); } } To get a feeling for what I'm looking for: I managed to get this effect, but not calling the function recursively and with jQuery 1.9.1/jQuery UI 1.9.2 on this fiddle. And this has a CSS bug so that it applies display: block while animating. Any ideas?
score: 3
favorite count: 0
has answer: http://stackoverflow.com/a/29921265
type: UnansweredQuestion
has title: Slide through words with jQuery/jQuery UI
upvote count: 3

http://stackoverflow.com/comment/48132103
comment on: http://stackoverflow.com/a/29998415
type: AnswerComment
has text: @markE- This is beautiful but is there a way to number/label just the columns I am interested in? Static result is sufficient if it has label on top of highlighted column. Thanks!
score: 0
type: Comment

http://stackoverflow.com/q/29897854
has comment: http://stackoverflow.com/comment/47919431
accepted answer: http://stackoverflow.com/a/29899029
has comment: http://stackoverflow.com/comment/47918650
type: Question
tagged with: mongodb
tagged with: javascript
answer count: 2
has comment: http://stackoverflow.com/comment/47918613
downvote count: 0
possible better answer: http://stackoverflow.com/a/29898901
has body: I have for example a list of .find() queries like this: db.tweets.find({},{"user.name":1}).explain() I want to run the queries from a javascript file then save outputs to a text file the important thing for me is getting the results from the .explain() in the text file too is this possible? and how can I achieve this?
has answer: http://stackoverflow.com/a/29899029
has answer: http://stackoverflow.com/a/29898901
favorite count: 0
has comment: http://stackoverflow.com/comment/47919318
has title: running JavaScript file to excute mongodb queries
has comment: http://stackoverflow.com/comment/47920465
type: AnsweredQuestion
score: 3
upvote count: 3

http://stackoverflow.com/comment/48105211
type: Comment
comment on: http://stackoverflow.com/a/29973775
has text: I'm experiencing same problem: Sails.js v0.11.0, sails-mongo v0.11.0, Mongo 3.0.2, OSX Yosemite 10.10.3
score: 0
type: AnswerComment

http://stackoverflow.com/a/29917118
has comment: http://stackoverflow.com/comment/47955650
score: 0
has comment: http://stackoverflow.com/comment/47955472
has comment: http://stackoverflow.com/comment/47955617
has comment: http://stackoverflow.com/comment/47956759
type: Answer
has body: You have to create three separate windows to print the panels like below-
has comment: http://stackoverflow.com/comment/47994621
answers question: http://stackoverflow.com/q/29916313

http://stackoverflow.com/a/29968149
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/48056630
upvote count: 2
has body: The issue is here: var mensagem = document.getElementById("txtDataRefInfo").value; var objtxtDataReferencia1Hidden = document.getElementById("txtDataReferencia1Hidden").value; var objtxtDataReferencia2Hidden = document.getElementById("txtDataReferencia2Hidden").value; Reason being txtDataRefInfo, txtDataReferencia1Hidden, txtDataReferencia2Hidden is a server side control and not the client side. Try this: var objtxtDataReferencia1Hidden = document.getElementById('&lt;%=txtDataReferencia1Hidden.ClientID%&gt;'); var objtxtDataReferencia2Hidden = document.getElementById('&lt;%=txtDataReferencia2Hidden.ClientID%&gt;'); var mensagem = document.getElementById('&lt;%=txtDataRefInfo.ClientID%&gt;');
answers question: http://stackoverflow.com/q/29968078
has comment: http://stackoverflow.com/comment/48057044
type: Answer

http://stackoverflow.com/comment/48072464
type: Comment
score: 1
comment on: http://stackoverflow.com/a/29976303
type: AnswerComment
has text: @CayceK - Because of SO's security settings on snippets: `Blocked form submission to 'http://stacksnippets.net/js' because the form's frame is sandboxed and the 'allow-forms' permission is not set.`

http://stackoverflow.com/q/29870060
tagged with: javascript
score: 0
tagged with: three.js
accepted answer: http://stackoverflow.com/a/29870360
type: AnsweredQuestion
has title: Face not visible after changing wireframe to false
has body: I am trying to draw a house, for which I created faces. I had MeshBasicMaterial's wireframe set to true while I was making it, but when I wanted to add textures to it, I got errors. For troubleshooting that, I changed wireframe to false, to see what was wrong. Three of my faces were not getting drawn. With wireframe set to false: And when it is true: I have tried drawing the missing faces with wireframe set to true, and I see them getting drawn. But when I change the parameter to false, it doesn't draw the face. My code is below: Textures Textures My Name [ My_Name@email.com ] Instructions go here. I have checked my code several times, by drawing faces one by one, but three faces out of eight don't get drawn with wireframe set to false. Please decrease the line.rotation.y from 0 to -0.6; to notice the faces that are not drawn.
has answer: http://stackoverflow.com/a/29870360
type: Question
answer count: 1

http://stackoverflow.com/comment/48044017
type: QuestionComment
comment on: http://stackoverflow.com/q/29961729
has text: Why is it hard to read? It is a small and simple Example. I am adding data with $("#"+id).data(testObject[item]); Each time i add a new item the list gets updated. The data gets saved after i add it to the DOM. How can i make it more readable?
score: 0
type: Comment

http://stackoverflow.com/comment/47908275
type: Comment
score: 0
type: AnswerComment
has text: can i see the code? Any idea where is the problem? Is the value getting set? or the event it not getting triggered?
comment on: http://stackoverflow.com/a/29891848

glsl
tags question: http://stackoverflow.com/q/29989418
type: Tag
tag name: glsl

http://stackoverflow.com/comment/48115856
has text: You had an upvote from me as your approach was right before we found out they can not use PHP
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29997833
type: Comment

http://stackoverflow.com/comment/47969030
score: 0
type: Comment
has text: @jt000 Your fiddle example doesn't work. Click on button doesn't do anything.
comment on: http://stackoverflow.com/a/29921265
type: AnswerComment

http://stackoverflow.com/comment/48027121
type: QuestionComment
comment on: http://stackoverflow.com/q/29952626
has text: just asking for problems having 2 submit handlers
score: 0
type: Comment

http://stackoverflow.com/comment/47865733
type: AnswerComment
type: Comment
has text: @Sean I suggest you start yourself by searching (with your favorite Internet search engine) for suitable ways of creating objects. Not because I don't want to help, but being able self-help is much more useful - consider this a dual learning opportunity.
score: 2
comment on: http://stackoverflow.com/a/29870315

http://stackoverflow.com/comment/47886739
score: 0
type: Comment
type: AnswerComment
has text: A guess as to why it has been downvoted: 1. It uses jQuery, even though the OP mentioned nothing about jQuery. 2. It doesn't work like the OP requested (1st click change all but the clicked, 2nd click change only the clicked element)
comment on: http://stackoverflow.com/a/29880898

http://stackoverflow.com/q/29906489
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/47935704
accepted answer: http://stackoverflow.com/a/29906619
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47935699
upvote count: 1
type: Question
has title: on button click, highlight entire contents of textbox (youtube share)
score: 1
has answer: http://stackoverflow.com/a/29906619
has body: i have many posts all with unique statusid numbers associated with them. each post has a 'share' button and a textfield with the current posts unique url in the textfield value. i want this 'share' buton, on click, to highlight the url text of the accompanying textbox, which is unique to its post so far i have this butt it isnt working &lt;input type="button" value="share" onclick="shareurl"&gt; article address:&lt;input type="text" value="blog.php?id='.$statusid.'" name="urlbox'.$statusid.'"&gt; function shareurl(statusid) { ("urlbox"+statusid).focus(); ("urlbox"+statusid).select(); } statusid is unique to each post so im trying to use that to only highlight the correct textbox url
answer count: 1
downvote count: 0

http://stackoverflow.com/q/29923571
has body: I want to create a simple html-javascript page with a text field and a submit button. Submit button has to be enabled every 5 minutes, then you can wrote something in the field and click on submit.clicking on submit, it show how much time is elapsed from activation and submit. Thanks Website: invia
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
type: UnansweredQuestion
tagged with: time
has comment: http://stackoverflow.com/comment/48436787
has comment: http://stackoverflow.com/comment/47968831
score: -3
has comment: http://stackoverflow.com/comment/47968832
downvote count: 3
has title: HTML - javascript count time elapsed from button activation and click on it
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/47968818
upvote count: 0
has answer: http://stackoverflow.com/a/30164869
has answer: http://stackoverflow.com/a/29923752
tagged with: counter
tagged with: javascript

http://stackoverflow.com/a/60482921
score: 0
type: Answer
answers question: http://stackoverflow.com/q/29994492
has body: Demo: https://quiz-using-javascript.web.app/ Source Code: https://github.com/mhsunny/JavaScript-Quiz This is the project to build a quiz using JavaScript. You can find how to check the answer of questions using javascript forEach() and using setInterval and clearInteval method. app.js app.js const correctAnswers = ['B', 'B', 'B', 'B']; const form = document.querySelector('.quiz-form'); const result = document.querySelector('.result'); form.addEventListener('submit', e =>{ e.preventDefault(); let score = 0; const userAnswer = [form.q1.value, form.q2.value, form.q3.value, form.q4.value] //check answers userAnswer.forEach((answer, index) =>{ if(answer === correctAnswers[index]){ score +=25; } // console.log(score); //show result on page }); scrollTo(0, 0); result.classList.remove('d-none'); let output = 0; const timer = setInterval(()=>{ result.querySelector('span').textContent = `${output}%`; if(output === score){ clearInterval(timer); }else{ output++; } }, 10) }) // let i = 0; // const timer = setInterval(()=>{ // console.log("hello") // i++; // if(i == 5){ // clearInterval(timer); // } // }, 1000) index.html JavaScript Quiz Quiz using Javascript You are 0% ninja On with the questions... 1. How do you give a ninja directions? Show them a map Don't worry, the ninja will find you 2. If a ninja has 3 apples, then gives one to Mario & one to Yoshi, how many apples does the ninja have left? 1 apple 3 apples, and two corpses 3. How do you know when you've met a ninja? You'll recognize the outfit The grim reaper will tell you 4. What's a ninja's favourite array method? forEach() slice()

http://stackoverflow.com/a/29917356
has comment: http://stackoverflow.com/comment/47967306
has comment: http://stackoverflow.com/comment/47964943
answers question: http://stackoverflow.com/q/29917249
has comment: http://stackoverflow.com/comment/47967471
type: AcceptedAnswer
downvote count: 0
has body: I see a few problems here: You are sending back json but you specify dataType: "html", in your ajax call. You should change that to dataType: "json", You are mixing mysql apis: or die(mysql_error($mysqli)); You cannot use any mysql_* function as you are using mysqli_*. You need something like: or die(mysqli_error($mysqli)); If you do return json, you need to make sure your error messages are valid json as well, so the second should really be (applies to the other instances too): or die(json_encode(mysqli_error($mysqli))); A potential problem is that you are not encoding your query string correctly in your ajax call. You can let jQuery take care of that by using an object: var data = {'dia': dia, 'sala': sala, etc.}; Edit: Based on your last update, it seems that you are not cancelling the default submit event. You do return false from your function, but you don't do anything with that value. You should change: &lt;form method="post" id="salas" name="salas" onsubmit="postData()" &gt; to: &lt;form method="post" id="salas" name="salas" onsubmit="return postData();" &gt; Although, as you are using jQuery, a better solution would be to remove the inline javascript and move it to your script section: $('form').on('submit', function(event) { event.preventDefault(); // the rest of your javascript that is now in your `postData()` function });
has comment: http://stackoverflow.com/comment/47963700
type: Answer
has comment: http://stackoverflow.com/comment/47965739
has comment: http://stackoverflow.com/comment/47964060
accepted answer of: http://stackoverflow.com/q/29917249
upvote count: 1
score: 1

http://stackoverflow.com/q/29991444
has body: I've written a function which takes a string, and returns information from a backbone model. Rather than just pull straight properties from the model, though, it uses properties to form more complex data - for example, date parsing, or getting the correct icon to use for a certain type of object - // returns a parsed date modified with format MM/DD/YYYY parseString("dateProperty:MM/DD/YYYY:dateModified"); // returns the HTML needed to display an icon based on the model type. parseString("icon:type"); Right now I'm calling my parse function from within the template itself - Date modified <%= parseString("dateProperty:MM/DD/YYYY:" + dateModified) %> but I'd love to be able to apply my parse function automatically to each value instead of just shoving my Backbone model in and applying the properties directly. Essentially, I'd like to be able to do this with my templates - Date modified <%= dateProperty:MM/DD/YYYY:dateModified %> And send dateProperty:MM/DD/YYYY:dateModified off to parseString. This is part of a rather large Backbone setup, and the parseString function is used throughout the JSON I use to build my models and collections; I'd like it if the behavior of strings in the templates were the same.
upvote count: 1
type: AnsweredQuestion
tagged with: underscore.js
score: 1
has answer: http://stackoverflow.com/a/29993240
has title: Custom Parsing of Underscore Templates
type: Question
accepted answer: http://stackoverflow.com/a/29993240
downvote count: 0
answer count: 1
tagged with: javascript
tagged with: templates
has comment: http://stackoverflow.com/comment/48105458
favorite count: 0
tagged with: backbone.js

http://stackoverflow.com/comment/47845968
type: Comment
has text: but you're already hardcoding it: if you look at the source of your page (near the bottom) you can find the array of images. if you don't want it maybe take a look at [`wp_localize_script`](https://codex.wordpress.org/Function_Reference/wp_localize_script)
comment on: http://stackoverflow.com/a/29859783
type: AnswerComment
score: 0

http://stackoverflow.com/comment/47828195
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29850934
score: 2
has text: Virtual duplicate of [get height of absolute element with height auto](http://stackoverflow.com/questions/29848050/get-height-of-absolute-element-with-height-auto)

http://stackoverflow.com/comment/48801237
has text: Nice catch! But still I am trying to find something more concrete, in order to identify if the charts will 'crash' in advance.
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/30354044
score: 0

http://stackoverflow.com/comment/47895039
comment on: http://stackoverflow.com/q/29885393
type: Comment
score: 1
has text: The `write less, do more` slogan is true though for jQuery and the API is very well documented. MDN Docs for javascript are also excellent
type: QuestionComment

http://stackoverflow.com/comment/47993402
type: Comment
has text: And what next? Which js file I should include?
comment on: http://stackoverflow.com/a/29904862
type: AnswerComment
score: 0

twig
tags question: http://stackoverflow.com/q/29965676
tags question: http://stackoverflow.com/q/29937114
tag name: twig
type: Tag

http://stackoverflow.com/comment/48052201
score: 2
has text: Can you please add fiddle of your example
comment on: http://stackoverflow.com/q/29966208
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29880743
downvote count: 0
has comment: http://stackoverflow.com/comment/47885856
has comment: http://stackoverflow.com/comment/47912598
has body: You can do this : var newArr = [].concat.apply([], Scenes.data.map(function(v){ return v.trends })); Demonstration
answers question: http://stackoverflow.com/q/29880712
upvote count: 2
has comment: http://stackoverflow.com/comment/47886172
type: Answer
score: 2

http://stackoverflow.com/comment/47962438
score: 0
type: Comment
type: QuestionComment
has text: @epascarello It is to be submitted by user, in an input field/window.
comment on: http://stackoverflow.com/q/29920428

http://stackoverflow.com/comment/47873440
type: Comment
has text: See my edits. I rewrote my answer, and it should work for you now.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29874031

http://stackoverflow.com/q/29995428
has body: I started to use javascript / jquery a few weeks ago, and I'm already stucked. I have an array / object with this stucture: { "Array1": [ { "data1": "value", "data2": "value" }, { "data1": "value", "data2": "value" } ], "Array2": [ { "data1": "value", "data2": "value" }, { "data1": "value", "data2": "value" } ] } I'd like to sort this array by Array1 and Array2. I've tried to use .sort() multiple way but it always says: "the object doesn't support this property or method". Is there any way to do this sorting? Could you write me some examples? Thank you very much.
has answer: http://stackoverflow.com/a/29996093
has comment: http://stackoverflow.com/comment/48110647
has title: How do I sort a multidimensional javascript object?
accepted answer: http://stackoverflow.com/a/29996093
downvote count: 1
has comment: http://stackoverflow.com/comment/48111534
type: AnsweredQuestion
tagged with: object
has comment: http://stackoverflow.com/comment/48111308
linked to: http://stackoverflow.com/q/5467129
type: Question
linked to: http://stackoverflow.com/q/1069666
has comment: http://stackoverflow.com/comment/48111425
answer count: 1
tagged with: arrays
tagged with: javascript
tagged with: jquery
tagged with: sorting
upvote count: 3
has comment: http://stackoverflow.com/comment/48111399
has comment: http://stackoverflow.com/comment/48110343
favorite count: 0
score: 2
has comment: http://stackoverflow.com/comment/48111209

http://stackoverflow.com/comment/47974987
type: Comment
comment on: http://stackoverflow.com/q/29925495
has text: Hint: Glancing at this, it seems like there is a lot of manipulation of the innerds of the animal. In real life, you do not need to chop up your pet to move it from one place to another, and in JS there is usually a way to move a data structure or a block of HTML around with a single statement that does not need to know the inner structure but rather copies the whole thing, whatever it is.
score: 0
type: QuestionComment

http://stackoverflow.com/comment/47894612
score: 0
has text: No you can't use rects. You need to append divs on the body and position them on top of the svg using absolute/fixed positioning.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29869603

http://stackoverflow.com/comment/47896399
type: Comment
has text: I just looked again, this project has a physical directory mapped to `/app/phones` which would stop HTML5Mode from working correctly. You will either need to change your directory name, or change the virtual URL you are using.
comment on: http://stackoverflow.com/a/29886084
score: 0
type: AnswerComment

http://stackoverflow.com/a/29944824
has comment: http://stackoverflow.com/comment/48010424
has body: The best way to do it would be like so: function foobar() { return { foo() { console.log('foo') } }; }
answers question: http://stackoverflow.com/q/29944356
score: 0
type: Answer

http://stackoverflow.com/q/29870147
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/47865333
has answer: http://stackoverflow.com/a/29870395
type: Question
has comment: http://stackoverflow.com/comment/47865353
tagged with: javascript
has body: For some reason, the div tags are not displayed in the webpage when the program is run. I tested every other component and have figured out that the problem is that the setting of the value of the div tags is in an if statement. The only problem is that I do not know how to fix the problem and still have the program run the way I want it to. &lt;div id="answerDisplay"&gt;&lt;/div&gt; &lt;div id="correctOrNot"&gt;&lt;/div&gt; &lt;script&gt; var div var div2 var rightAnswer var problemNum =Math.floor((Math.random() * 3) + 1); if (problemNum == 1){ rightAnswer = 14; div = document.getElementById("answerDisplay"); div.textContent = "4 + 2 * (10 - 3 * 2) / 4 + 8 = ?"; } else if (problemNum == 2){ rightAnswer = 8; div = document.getElementById("answerDisplay"); div.textContent = "(6 - 3) * 2 + (3^2 - 5) / 2 = ?"; } else if (problemNum == 3){ rightAnswer = 6; div = document.getElementById("answerDisplay"); div.textContent = "5 - 3 + 4^2 / (8 - 4 / 2) = ?"; } else if (problemNum == 4){ rightAnswer = 3; div = document.getElementById("answerDisplay"); div.textContent = "5^2 - (6 * 2) * 2 * (5 - 2) = ?"; } function checkRightAnswer (){ var answer = document.getElementById('Input').value if (problemNum == 1 &amp;&amp; answer == 14){ div2 = document.getElementById("correctOrNot"); div2.textContent = "Correct"; problemNum =Math.floor((Math.random() * 3) + 1); } else if (problemNum == 2 &amp;&amp; answer == 8){ div2 = document.getElementById("correctOrNot"); div2.textContent = "Correct"; problemNum =Math.floor((Math.random() * 3) + 1); } else if (problemNum == 3 &amp;&amp; answer == 6){ div2 = document.getElementById("correctOrNot"); div2.textContent = "Correct"; problemNum =Math.floor((Math.random() * 3) + 1); } else if (problemNum == 4 &amp;&amp; answer == 3){ div2 = document.getElementById("correctOrNot"); div2.textContent = "Correct"; problemNum =Math.floor((Math.random() * 3) + 1); } else { div2 = document.getElementById("correctOrNot"); div2.textContent = "Incorrect, try aga…
has title: div inside if statement javascript
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/29884474
tagged with: jquery
has comment: http://stackoverflow.com/comment/47872403
has comment: http://stackoverflow.com/comment/47865719
type: UnansweredQuestion

http://stackoverflow.com/a/29894821
answers question: http://stackoverflow.com/q/29894462
downvote count: 0
score: 1
type: Answer
upvote count: 1
has body: Here's using a jquery each loop: http://jsfiddle.net/3y69usxv/ var submenus = []; var firstMenus = []; $('.JS_toggle-submenu').each(function(){ var $this = $(this); if (submenus.indexOf($this.data('submenu')) &lt; 0) { submenus.push($this.data('submenu')); firstMenus.push($this); } }); console.log(firstMenus);
has comment: http://stackoverflow.com/comment/47913251

http://stackoverflow.com/q/29960438
tagged with: facebox
type: Question
tagged with: javascript
score: -1
downvote count: 1
answer count: 1
tagged with: jquery
favorite count: 0
has body: Showing animated “loading” gif before the actual content appears in Facebox like ajax preloader. is that possible. From here i am calling to the function &lt;a href="javascript:;" onclick="load_crop('&lt;?php echo $current_large_image_width + 200 ?&gt;','&lt;?php echo $current_large_image_height ;?&gt;')"&gt; Edit Picture&lt;/a&gt; And this is my function function load_crop(wwdth,hhight){ $.facebox('&lt;iframe FRAMEBORDER="0" height="'+hhight+'" width="'+wwdth+'" src="&lt;?php echo $httpTemplatePath;?&gt;/ajax/crop_image2.php? user_id=&lt;?php echo $_SESSION['db_user_info']['id']?&gt;" &gt;&lt;/iframe&gt;'); } IS it possible to put a gif loader before the content of the crop_image2.php show.
has title: Showing animated “loading” gif before the actual content appears in Facebox
has answer: http://stackoverflow.com/a/29960561
accepted answer: http://stackoverflow.com/a/29960561
tagged with: php
type: AnsweredQuestion
upvote count: 0

http://stackoverflow.com/a/29928441
answers question: http://stackoverflow.com/q/29925525
type: Answer
upvote count: 1
score: 1
has body: The waypoints order is response.routes[0].waypoint_order (where 0 is the first route if more than one are returned).
downvote count: 0

http://stackoverflow.com/comment/47928317
type: QuestionComment
comment on: http://stackoverflow.com/q/29874165
has text: Excelent. I can accept this as an answer if you want to. Best.
score: 0
type: Comment

http://stackoverflow.com/a/29960013
type: Answer
downvote count: 0
score: 1
has body: If you console.log every string you're appending to the output div, then you'll notice that some of them break your &lt;br&gt; tags, because they contain HTML characters, like &lt;, and innerHTML tries to parse the string into HTML (I checked the jsFiddle, where you're using innerHTML). The same issue happens with document.write. The simplest solution is to append the &lt;br&gt; tag on a second concat operation. Like this: https://jsfiddle.net/oaahzsuf/1/ output.innerHTML += (p + " : " + mutFit + " : " + mutant); output.innerHTML += '&lt;br /&gt;'; If there's a chance that your string will ever contain a full tag &lt;&gt;, then you could do this: output.innerText += (p + " : " + mutFit + " : " + mutant); output.innerHTML += '&lt;br /&gt;'; innerText threats the string as plain text. A third option is using &lt;pre&gt; tags around your string: https://jsfiddle.net/oaahzsuf/4/ output.innerHTML += (p + " : " + mutFit + " : &lt;pre&gt;" + mutant + "&lt;/pre&gt;&lt;br /&gt;"); And a fourth option is escaping the string like @Joe pointed out. Also, calling document.getElementById that many times in a loop might not be the best thing. Just save a reference to your output div outside of the loop.
accepted answer of: http://stackoverflow.com/q/29959719
answers question: http://stackoverflow.com/q/29959719
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/a/29990088
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29989937
answers question: http://stackoverflow.com/q/29989937
downvote count: 0
type: Answer
upvote count: 1
score: 1
has body: Since you just want to emit to all clients, instead of passing io to socketRoutes, you can simply do this. module.exports = function (socket) { var sockets = this; console.log('user connected'); socket.on('myEvent', function(data) { sockets.emit('hello_all_clients',data); }); }

http://stackoverflow.com/a/29981254
has comment: http://stackoverflow.com/comment/48090785
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/29980922
type: Answer
has body: I'm not sure if you know that or not, but you cannot access a nested property via rowData['Category.Name']. This would literally try to access the property with name Category.Name, i.e. it would work if you had an object like { 'Cateogry.Name': 42 } One thing you can do is specify render functions for each of your columns. The those render functions define how to access the data for each of the columns. For example: var columnRenderer = { Name: x =&gt; x, Limit: x =&gt; x, Category: x =&gt; x.Name }; Then, given your columns as //Default Columns: this.defaultColumns = ["Name","Limit","Category"]; You can render the table with that.props.results.map( rowData =&gt; &lt;tr&gt; {that.props.defaultColumns.map( column =&gt; &lt;td&gt;{columnRenderer(rowData[column])}&lt;/td&gt; )} &lt;/tr&gt; ); (Note: I am using arrow functions here, an ES6 feature, so if you are using the jsx command line tools, you have to pass the --harmony option, or use normal functions instead).
has comment: http://stackoverflow.com/comment/48094858
downvote count: 0
has comment: http://stackoverflow.com/comment/48094911

http://stackoverflow.com/q/29925633
has body: I'd like to know how to convert an array of jquery objects to jquery object. Actually, with find of jQuery I retrieve several elements, find returns a jQuery object on which I apply jQuery method such as clone, css ... In my case, my elements being retrived, I need to remove duplicates. The I did it, my elements now are in an array and not in a jQuery object anymore. How do I turn an array of jQuery objects into a jQuery object? Below is my code: var $enfants = $('#parent').find('option.enfant'); var keys = []; var values = []; $.each($enfants, function(i, e) { if (-1 !== $.inArray($(e).val(), keys) ) { keys.push($(e).val()); values.push($(e)); } }); // This lasts 1ms // $enfants.clone().appendTo($('#inconnu')); // This lasts 14ms // $.each(values, function(i, e) { // $(e).clone().appendTo($('#inconnu')); // }); Hope it's clear UPDATE1 The code above works well but slower than without removing duplicates
answer count: 2
accepted answer: http://stackoverflow.com/a/29926563
tagged with: jquery
has title: Turning an array of jquery objects into a jquery set
has comment: http://stackoverflow.com/comment/47973542
has comment: http://stackoverflow.com/comment/47975474
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47973172
type: Question
has comment: http://stackoverflow.com/comment/47973846
tagged with: javascript
possible better answer: http://stackoverflow.com/a/29926566
has answer: http://stackoverflow.com/a/29926563
score: 0
has answer: http://stackoverflow.com/a/29926566

http://stackoverflow.com/comment/48011648
comment on: http://stackoverflow.com/q/29934813
score: 0
has text: Not use `chrome.storage.sync`. Quotas are low and inflexible. As Google puts it, _"`chrome.storage` is not a big truck. It's a series of tubes. And if you don't understand, those tubes can be filled, and if they are filled when you put your message in, it gets in line, and it's going to be delayed by anyone that puts into that tube enormous amounts of material."_ If you really need to sync data, you'll need a 3rd-party server-based solution. If you don't, use `local` with `"unlimitedStorage"` permission.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/48088047
comment on: http://stackoverflow.com/q/29971982
score: 0
has text: Small addition: This concept works for the click event, it's only the keyboard events that are not firing.
type: QuestionComment
type: Comment

http://stackoverflow.com/a/29963927
score: 1
answers question: http://stackoverflow.com/q/29963553
has body: Here is my attempt to solve the issue: ^((0?[0-9]|1[0-2]):([0-5][0-9])(?::([0-5][0-9]))?)\s?([ap]m)?|([0-1][0-9]|[2][0-3]):([0-5][0-9])(?::([0-5][0-9]))?$ JS: var re = /^((0?[0-9]|1[0-2]):([0-5][0-9])(?::([0-5][0-9]))?)\s?([ap]m)?|([0-1][0-9]|[2][0-3]):([0-5][0-9])(?::([0-5][0-9]))?$/gmi; See demo Note the use of i option (to enable case insensitive matching) and m to match whole lines. This regex allows for minutes and seconds (seconds are optional).
has comment: http://stackoverflow.com/comment/48048429
upvote count: 1
type: Answer
downvote count: 0

http://stackoverflow.com/q/29899011
has answer: http://stackoverflow.com/a/29899069
has comment: http://stackoverflow.com/comment/47920757
tagged with: javascript
has body: I need to add these elements: to this: Is there a way to do this without using multiple appendChild functions ?
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/29899103
accepted answer: http://stackoverflow.com/a/29899103
has comment: http://stackoverflow.com/comment/47920772
possible better answer: http://stackoverflow.com/a/29899069
has title: How to add these elements in bulk?
type: AnsweredQuestion
type: Question

http://stackoverflow.com/comment/47903649
type: QuestionComment
type: Comment
has text: Kinburn101 is right. It seems to work fine. Try this [fiddle](http://jsfiddle.net/kyy88cm6/) Use the handler to re size the output window and check.
comment on: http://stackoverflow.com/q/29889577
score: 0

http://stackoverflow.com/a/29905922
has comment: http://stackoverflow.com/comment/47937053
upvote count: 1
accepted answer of: http://stackoverflow.com/q/29903165
answers question: http://stackoverflow.com/q/29903165
type: Answer
has body: I think the question is, given a user, how do we get tweets made by users that the given user is following? var _ = require('underscore'); // need a user object, not a username, if the relational fields are pointers var currentUser = Parse.User.current(); // find follows where the user is the follower var followQuery = new Parse.query("follow"); // conventional class name would begin with caps followQuery.equalTo("followedBy", currentUser); followQuery.find().then(function(follows) { // assume underscorejs var followedUsers = _.map(follows, function(f) { return f.get("following"); }); var tweetQuery = new Parse.Query("tweet"); tweetQuery.containedIn("tweetBy", followedUsers); // aggressively fetch the authoring user info tweetQuery.include("tweetBy"); return tweetQuery.find(); }).then(function(tweets) { // tweets are tweets by users followed by the given user });
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/47936093
has comment: http://stackoverflow.com/comment/47934605
type: AcceptedAnswer

http://stackoverflow.com/comment/47867535
comment on: http://stackoverflow.com/q/29871293
type: Comment
type: QuestionComment
has text: Do a select all when the user enters the input?
score: 0

http://stackoverflow.com/q/29927801
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/29927821
answer count: 1
has title: Using RegEx in Javascript to match similar strings that have characters swapped
tagged with: string
has comment: http://stackoverflow.com/comment/47977595
tagged with: regex
type: AnsweredQuestion
has body: I am using RegEx's to find the frequency of occurrences of certain string values in a large data set. This was working fine until I found some of the years worth of data have been entered with a typo, meaning two characters have been swapped around. It is not feasible to edit the data sets to correct the typo. Therefore, is it possible to define a RegEx that will match the strings regardless of the index of just two characters within them? The strings in question are: "gcse/o-level/cse" and "gsce/o-level/cse" I am aware I can simply search by the characters found after the typo, but I would like to know if there is a RegEx method to deal with this sort of occurrence as I could not find any mention of a solution anywhere else, and thought it posed an interesting challenge.
accepted answer: http://stackoverflow.com/a/29927821
score: 0

http://stackoverflow.com/a/29989879
type: Answer
answers question: http://stackoverflow.com/q/29988569
has comment: http://stackoverflow.com/comment/48225975
has comment: http://stackoverflow.com/comment/48099776
has body: You need to pass passport to your route. You can do it changing your code this way: /routes/index.js from module.exports = function(app, passport) {...} to module.exports = function(passport){ return function(app) {...}} /server.js from app.use('/', routes); to app.use('/', routes(passport));
score: 0

http://stackoverflow.com/comment/48107266
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29993783
has text: Clearly I didn't read carefully enough and missed the "infinite chain of alerts". So glad I just click on buttons without thinking about what they'll do :)

http://stackoverflow.com/comment/48115866
comment on: http://stackoverflow.com/q/29962746
type: QuestionComment
has text: data-mask="a-99999999-9" "a"= abcdef... "9"= 012345... I need you where going "a" only become available the letters " VEJPG "
score: 0
type: Comment

http://stackoverflow.com/comment/61259914
type: AnswerComment
score: 0
type: Comment
has text: Thanks a lot for the answer and blogpost! It clarified a lot of things in Flux architecture.
comment on: http://stackoverflow.com/a/29987245

http://stackoverflow.com/comment/47977548
type: AnswerComment
has text: Thanks for the suggestion, though I don't really want to add stuff to the project
type: Comment
comment on: http://stackoverflow.com/a/29927806
score: 0

http://stackoverflow.com/q/29968116
has answer: http://stackoverflow.com/a/52245981
score: 50
tagged with: datetime
has title: Javascript date 01/01/0001
has answer: http://stackoverflow.com/a/29968164
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/77872347
has body: I want to create a Date object in javascript, which represents the year 0001, 2014 years ago. I tried with d = new Date(); d.setYear(1); console.log(d); but it gives the year 1901 with d = new Date(1,1,1) console.log(d); no way. How can I create this date?
possible better answer: http://stackoverflow.com/a/29968164
has answer: http://stackoverflow.com/a/72459879
has answer: http://stackoverflow.com/a/29970069
has answer: http://stackoverflow.com/a/29968287
type: Question
has answer: http://stackoverflow.com/a/29974263
tagged with: javascript
tagged with: date
linked to: http://stackoverflow.com/q/52245886
downvote count: 0
answer count: 7
accepted answer: http://stackoverflow.com/a/29970069
upvote count: 50
favorite count: 0

dc.js
tag name: dc.js
tags question: http://stackoverflow.com/q/29939367
type: Tag

http://stackoverflow.com/comment/47944228
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29888348
has text: Yes, that my concern
score: 0

http://stackoverflow.com/q/29967492
has body: I have a number of dynamic generated widgets in the editor content (online app) and need to store their reference in clickable buttons to retrieve custom data attributes at a later time when one of the button is clicked. I thought maybe it's going this way : var template = ' ' + ' ' + ' title here ... ' + ' content here ... ' '; ... widget = CKEDITOR.dom.element.createFromHtml( template, editor.document ); timeMarkerButton.setAttribute('data-widget', widget); // widget object ref ... But in the source code all I got is this : data-widget="[object Object]" Is this a case of allowedContent filtering ? If so how to allow it ? If not, how to store an object reference anyway ?
has title: How to store object references in elements as custom atributes?
tagged with: dom
type: Question
tagged with: javascript
tagged with: ckeditor
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has answer: http://stackoverflow.com/a/29967614
type: UnansweredQuestion

http://stackoverflow.com/q/29870559
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47866071
type: Question
has comment: http://stackoverflow.com/comment/47866110
tagged with: javascript
has title: External JS sometimes doesnt loads in time?
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/29870651
has body: this works OK most of the time, but on production server, its not 100%. It says that functionFromAJS() doesnt exists, which is ok, if the .js is not gets loaded in time. But then what to do?
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29870615

http://stackoverflow.com/comment/48124325
type: QuestionComment
comment on: http://stackoverflow.com/q/30002591
type: Comment
has text: I just laughed when I saw the title of the post. :) My five 5cents, some of the most horrible code I've evern seen was written in javascript. I am at least glad that function cannot be used to name a function! :D You are feeling very medidative I suppose, to pose such a question. I would suggest try writting it in italian, :) you-ll be able to make a function called function - but in a different language.
score: 0

http://stackoverflow.com/q/29998668
has title: Program assistance with JSONP Script Insertion and Callback function
type: AnsweredQuestion
type: Question
tagged with: jsonp
has body: I'm having trouble writing this code that will use JSONP Script Insertion Technique and a Callback Function. I must use http://legacy.jefferson.kctcs.edu/users/mark.prather/states.txt for the URL. This is a sample of what's on the webpage function getStateData( [ {State:"Alabama", Abbreviation:"AL", Statehood:1819, Capital:"Montgomery"}, {State, "Alaska", Abbreviation:"AK", Statehood:1959, Capital:"Juneau"}, {State:"Arizona", Abbreviation:"AZ", Statehood:1912, Capital:"Phoenix"}, ] ); I must use getStateData(sData) as the name of mycallback and sData is supposed to hold the data for the array. Then I must have a form that allows a user to select a state and get the requested data, which is the State, Abbreviation, Statehood, and Capital. Below is a portion of my form. Alabama Alaska Arizona My largest issue is the fact that the URL is a function already instead of raw data. I'm not looking for handouts, just help. This is what I've gotten so far. Any assistance will be greatly appreciated. https://jsfiddle.net/MaNBeAsT515/ppp0dxwm/2/
has answer: http://stackoverflow.com/a/29999148
tagged with: javascript
score: 0
answer count: 1
tagged with: jquery
tagged with: callback
accepted answer: http://stackoverflow.com/a/29999148

http://stackoverflow.com/comment/48012791
comment on: http://stackoverflow.com/q/29945958
type: Comment
score: 2
has text: Please clarify; Change what to what based on what?
type: QuestionComment

http://stackoverflow.com/q/29965302
has answer: http://stackoverflow.com/a/29965373
tagged with: javascript
tagged with: jquery
linked to: http://stackoverflow.com/q/245062
has body: This is my jquery to get data, var passwordReset = { UserName: $("#txtLgnUsername").val(), Password: $("#hdnOldPassword").val(), NewPassword: $("#txtLgnPasswordReset").val() } I don't want person to enter his userName as password, so I used this in next line if (passwordReset.NewPassword.contains(passwordReset.UserName)) { alert(passwordReset.NewPassword); notifyMessage.showNotifyMessage('error', 'User name cannot be part of password.Please try a different password.', false); } Which isn't helping...How do i check if my password has userName?? Thanks in advance...
has answer: http://stackoverflow.com/a/29965375
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/3480771
score: 0
type: Question
linked to: http://stackoverflow.com/q/4804652
has title: Search if one string is substring of another string
duplicate of: http://stackoverflow.com/q/1789945
accepted answer: http://stackoverflow.com/a/29965375
has comment: http://stackoverflow.com/comment/48050419
answer count: 2
possible better answer: http://stackoverflow.com/a/29965373

http://stackoverflow.com/comment/47980268
has text: Haha, I would never imagine that I would give a plus to that kind of response.
comment on: http://stackoverflow.com/q/29928647
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29870058
score: 0
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29869279
type: Answer
has body: $( "#member-pop1" ).dialog(); This is where you show the content. Click on cross to close me! Makes use of jquery ui dialog.
accepted answer of: http://stackoverflow.com/q/29869279

http://stackoverflow.com/comment/47824134
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29848258
has text: @JaredFarrish I have read that article (quite old, lot of changes to FF since then), I tried the updated solution, but it seems I don't have access to `yourXMLHttpReq.channel` from greasemonkey script.
type: Comment

http://stackoverflow.com/q/29932782
has body: I am creating a drop down dynamically after an ajax all and populating the fields. I am also calling jquery.data() to set some attribute which I want in future. HTML &lt;input id="test" type="text" list="mylist"/&gt; &lt;datalist id="mylist"&gt;&lt;/datalist&gt; JS $(function() { // assume this data is coming from ajax call var data = [{ "name": "John", "id": 1 }, { "name": "Jane", "id": 2 }, { "name": "Judie", "id": 3 }]; var generateDropDown = function(data) { var datalist = $('#mylist'); for (var i = 0; i &lt; data.length; i++) { var value = data[i].name + ' =&gt; ' + data[i].id; $('&lt;option&gt;', { 'class': 'myclass' }) .val(value) .data('extra', { 'newid': data[i] * 100 }) .appendTo(datalist); } }; generateDropDown(data); $('.myclass').on('select', function(selected) { console.log($(selected).data('extra')); console.log($(this).data('extra')); }); }); Here is the JSFiddle My requirement is to access the selected value from drop down along with the data attribute i have added. How can I do that ? I tried the 2 console.log options as mentioned above but they dont print anything.
tagged with: javascript
has answer: http://stackoverflow.com/a/29933013
has comment: http://stackoverflow.com/comment/47994759
has comment: http://stackoverflow.com/comment/47987984
answer count: 3
upvote count: 1
has comment: http://stackoverflow.com/comment/47988678
tagged with: jquery
possible better answer: http://stackoverflow.com/a/29933013
has title: jquery get data attributes from dynamically generated options
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29932972
has answer: http://stackoverflow.com/a/29933009
accepted answer: http://stackoverflow.com/a/29932972
type: AnsweredQuestion
downvote count: 0
score: 1
type: Question
has comment: http://stackoverflow.com/comment/47990748

http://stackoverflow.com/comment/47990517
type: AnswerComment
comment on: http://stackoverflow.com/a/29933403
score: 0
type: Comment
has text: I do not see the new example. Thanks again

http://stackoverflow.com/a/29938379
upvote count: 1
has body: Update I went back to the original manifest.json which contained only the context menu: { "name": "Context Menus Sample", "description": "Shows some of the features of the Context Menus API", "version": "0.6", "permissions": ["contextMenus"], "background": { "scripts": ["sample.js"] }, "manifest_version": 2 } I proceeded to change the sample.js line that creates the first menu item (mind you this is all a learning experience): from: for (var i = 0; i &lt; contexts.length; i++) { var context = contexts[i]; var title = "Test '" + context + "' menu item"; var id = chrome.contextMenus.create({"title": title, "contexts":[context],"onclick": genericOnClick}); console.log("'" + context + "' item:" + id); } to this (changing only the var id part: for (var i = 0; i &lt; contexts.length; i++) { var context = contexts[i]; var title = "Test '" + context + "' menu item"; var id = chrome.contextMenus.create({ "title": title, "contexts": [context], "onclick": genericOnClick, "documentUrlPatterns": ["*://*.reddit.com/*"] }); console.log("'" + context + "' item:" + id); } Conclusion The above changes now make the first menu item accessible only if you are within a reddit page. So it won't be hard from this point to figure out the rest of my extension. Thank you guys for the assistance. My apologies to the editors for my terrible format. I was new to this site, new to extensions, and unfortunately up hours past my normal hour of sleep. I will try to not subject you to that kind of stupidity again.
downvote count: 0
has comment: http://stackoverflow.com/comment/47998365
type: Answer
score: 1
answers question: http://stackoverflow.com/q/29922237

http://stackoverflow.com/a/29900979
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29900919
accepted answer of: http://stackoverflow.com/q/29900919
type: Answer
score: 3
has body: But if it is blanket-catching the exceptions, shouldn't it just catch the error generated by the typo Yes. At which point it will claim that the direction was invalid, which isn't the correct error. and terminate? No, it will go to the next iteration of the for loop (at which point it will hit the same error, repeat ad infinitum).
downvote count: 0
has comment: http://stackoverflow.com/comment/47924534
upvote count: 3

http://stackoverflow.com/comment/47874459
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/29874073
type: Comment
has text: I tried your code but it is giving me `"Invalid web service call...eter:`

http://stackoverflow.com/q/29898429
type: AnsweredQuestion
downvote count: 0
type: Question
has answer: http://stackoverflow.com/a/29904948
accepted answer: http://stackoverflow.com/a/29904948
has answer: http://stackoverflow.com/a/44300386
tagged with: javascript
score: 15
has answer: http://stackoverflow.com/a/51085268
answer count: 3
possible better answer: http://stackoverflow.com/a/44300386
favorite count: 0
tagged with: dropzone.js
has body: So, I tried following the solution here: Dropzone image upload options not working :( but, whenever I provide the option: Dropzone.autoDiscover = false; the dropzone goes from displaying the default drag'n'drop look to just text with a "Browse" button. Here is my code (dropzone is included in header): Test space for FTP <asp:Label ID="lblError" runat="server"></asp:Label> So, the question is, how do I specify options for dropzone without ruining the default look?
has title: How do you enable Dropzone options? autoDiscover breaks Dropzone functionality
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/18032132
upvote count: 15

http://stackoverflow.com/a/29973121
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/29972754
accepted answer of: http://stackoverflow.com/q/29972754
has body: Here is an example of how you might pass data by knowing a secret function Book(secret) { secret = secret || {}; var env = {}; // `env` to hold data requiring `secret` this.width = 7; this.height = 10; env.pages = 100; this.getEnv = function (s) { // give access to `env` if you know the secret if (s === secret) return env; }; this.tear_page = function () { return --env.pages; }; } function TechBook(secret) { secret = secret || {}; Book.call(this, secret); // construct from Book var env = this.getEnv(secret); // get references via secret this.open_book = function () { return "Opened in page " + (env.pages/2); }; } TechBook.prototype = Object.create(Book.prototype); // set up inheritance Using an Object reference as the secret will be more secure than using a primitive as you'll need the original reference for access. Now you have var bBook = new TechBook(); console.log(bBook); // instance of TechBook console.log(bBook.tear_page()); // 99 console.log(bBook.open_book()); // Opened in page 49.5
type: AcceptedAnswer
downvote count: 0
type: Answer

http://stackoverflow.com/comment/47832766
has text: Seems to be working, but now I'm getting lots of errors, it looks like it is in some loop or something because there are around 100 errors printed in a console every second
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29853268
type: Comment

http://stackoverflow.com/a/29968963
upvote count: 4
downvote count: 0
has body: First issue: lastChild returns any node, not just HTML tag elements. The last child of #center is a Text node (containing &amp;nbsp;), not an Element, so it does not have a getBoundingClientRect method. You can select #c like so: document.querySelector('#center &gt; *:last-child') Second issue: the result of getBoundingClientRect does not have an x field. You can use left instead: document.querySelector('#center &gt; *:last-child').getBoundingClientRect().left http://jsfiddle.net/3m2n9otr/2/
type: Answer
answers question: http://stackoverflow.com/q/29968883
score: 4

http://stackoverflow.com/comment/48058055
comment on: http://stackoverflow.com/a/29969129
has text: Based on the code he has posted, it will. If i have $scope.places, and i update it, the view will update
type: AnswerComment
type: Comment
score: 0

http://stackoverflow.com/comment/48063307
comment on: http://stackoverflow.com/q/29971307
has text: Thank you man for correcting me. (no sarcasm)
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47871237
comment on: http://stackoverflow.com/a/29872765
score: 0
has text: could be on purpose may be(( @Zero. Thanks anyway
type: Comment
type: AnswerComment

http://stackoverflow.com/a/40105318
upvote count: 1
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29921067
type: Answer
score: 1
downvote count: 0
has body: I got the same problem and I built a rough solution: With jQuery I check, if the Page is not scrolled to top and add a Class to the Item: $(document).ready(function(){ if($(".navbar").offset().top &gt; 0) { $('.navbar .wow').each(function(){ $(this).addClass('menu-fix'); }); } }); then I added following CSS: .navbar .menu-fix { visibility: visible !important; } It's not a clean solution, but it works.
accepted answer of: http://stackoverflow.com/q/29921067

http://stackoverflow.com/q/29978357
tagged with: ember.js
upvote count: 1
has body: I'm a newbie with Emberjs and I need some advices. I try to use this addon https://github.com/indexiatech/ember-forms So I have created my form : {{#em-form model=sessions submit_button=false}} {{em-input property="email" type=email label="Email" placeholder="Entrer votre email..."}} {{em-input property="password" type="password" label="Mot de passe" placeholder="Enter votre password..."}} &lt;div class="form-actions"&gt; &lt;input {{bind-attr disabled=isntValid}} type="submit" class="btn btn-primary" value="Se connecter"&gt; &lt;/div&gt; {{/em-form}} so I have a controller to catch the submit action : export default Ember.Controller.extend({ actions: { submit: function(){ alert(this.get('sessions.email')); } } }); My question is just I don't get it to how print my value from my form? I try this.get('email') or this.get('sessions.email') but always got an undefined in my alert box Any help would be great! Thanks!
has answer: http://stackoverflow.com/a/29981610
type: Question
tagged with: javascript
downvote count: 0
answer count: 1
score: 1
has title: Get value from emberjs form
favorite count: 0
type: UnansweredQuestion

http://stackoverflow.com/q/29931852
has answer: http://stackoverflow.com/a/29931905
tagged with: javascript
score: 0
answer count: 3
has title: How to extract text from all elements of given class under given HTML element with jQuery
upvote count: 1
downvote count: 1
tagged with: jquery
favorite count: 0
has body: When I do this: var elem = $(".region_box"); text = elem.find(".my_text").html(); I can get text from the first element deep below "elem" with class "my_text" which it finds. But there are many elements of the class "actual_text" below elem and I want to combine the text from all of them. How would I do it? I am new to jQuery and I searched around for solution for long time, but neither of them worked for me. Perhaps I am using this each() function incorrectly. I would very much appreciate any help.
possible better answer: http://stackoverflow.com/a/29931905
has answer: http://stackoverflow.com/a/29932122
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29931883
accepted answer: http://stackoverflow.com/a/29931883
type: AnsweredQuestion
type: Question

http://stackoverflow.com/q/29980833
tagged with: iframe
accepted answer: http://stackoverflow.com/a/30070061
type: Question
has comment: http://stackoverflow.com/comment/48082341
has comment: http://stackoverflow.com/comment/48082312
upvote count: 5
tagged with: javascript
tagged with: jquery
has body: Problem Statement: I have a .NET user control and I am using an iFrame inside it. I have multiple instances (can be any number) of that control (with an iFrame in it) on a page. I have to load all the controls every time one control state changes. The control has some mandatory fields to fill. I have a button which navigates to another screen and because each time I load all the controls it takes considerable amount of time for all of them to load. The user is trying to complete all mandatory fields and click the next button, at this instance even though the user completed all mandatory fields, and the control (with iframe) did not load completely, it produces the validation error. Note: All of the above is in JavaScript, and not server side. What I tried: I tried showing a modal div till it loads, but I cannot apparently capture the exact load time and the next button can be potentially clicked. I tried having a timeout on the validation functionality, but it works sporadically as the loading is not definitive. I tried having a counter to see how many controls loaded to check the total controls and only then allow the validation functionality to fire, again the in definitive way it loads, does not help. I know this can be done in a different way but because of the huge effort and time involved, we have to roll with the existing way, and have to fix the issue. Can someone please suggest any pointers/workaround this problem.
has comment: http://stackoverflow.com/comment/48106323
downvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/48081557
favorite count: 0
has title: Making iFrame loading faster to avoid validation errors
has answer: http://stackoverflow.com/a/30070061
has comment: http://stackoverflow.com/comment/48081239
score: 5
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/48082389
type: AnsweredQuestion

http://stackoverflow.com/comment/47996503
type: AnswerComment
has text: Thank you for finding the problem.
type: Comment
comment on: http://stackoverflow.com/a/29937434
score: 0

http://stackoverflow.com/q/29869154
downvote count: 0
favorite count: 0
answer count: 0
linked to: http://stackoverflow.com/q/12783217
has body: I am writing a chrome extension which injects widgets into the DOM at certain locations. I am facing a problem where my extension's CSS interferes with the page's CSS and vice versa due to the cascading nature of CSS. What are some robust strategies for avoiding this issue? Specific reading/learning materials will be greatly appreciated.
type: UnansweredQuestion
upvote count: 1
duplicate of: http://stackoverflow.com/q/12783217
has comment: http://stackoverflow.com/comment/47863492
score: 1
type: Question
has comment: http://stackoverflow.com/comment/47865490
has comment: http://stackoverflow.com/comment/47863588
tagged with: javascript
has comment: http://stackoverflow.com/comment/87940033
has title: Chrome extension: Strategies for not interfering with page's CSS
tagged with: google-chrome-extension

http://stackoverflow.com/q/29856249
has comment: http://stackoverflow.com/comment/47843262
has comment: http://stackoverflow.com/comment/47843592
has body: I have this code in a Meteor.methods definition: update_field: function(collection,document_id,field,value) { obj = {}; obj[field] = value; console.log(obj); if (collection == 'clients') { var Collection = Clients; } else if(collection = 'sites') { var Collection = Sites; } Collection.update( { _id: document_id }, { $set: obj }, function(error,id) { console.log(error,id); return(error,id); } ); } This method is called from several client-side helpers events, and updates the field as needed. But whenever it runs once, it never stops running. Sometimes it runs infinitely even when all the Meteor.call('update_field')s have been commented out. I have tried including a 'caller' parameter and adding that to all the possible calls to figure out why it keeps getting called to no avail. Any ideas why this is looping? Edit: this runs 2,000/minute Edit2: this is called in one of two ways: on a keyup code==13 (enter) in an appropriate field or a field blur. However, event when these calls are commented out, the issue persists.
possible better answer: http://stackoverflow.com/a/29860613
has comment: http://stackoverflow.com/comment/47848411
tagged with: node.js
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29871817
has title: Meteor Method Endlessly Runs
has comment: http://stackoverflow.com/comment/47841069
type: Question
tagged with: mongodb
answer count: 2
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29871817
score: 0
tagged with: meteor
has answer: http://stackoverflow.com/a/29860613
has comment: http://stackoverflow.com/comment/47838879

http://stackoverflow.com/comment/48033580
type: QuestionComment
comment on: http://stackoverflow.com/q/29956294
has text: Your approach isn't very object-oriented. Why would you have the first index of an array be an array of property names? Your array should look more like @elclanrs comment. Though, this won't directly solve your problem it's much easier to maintain.
score: 0
type: Comment

http://stackoverflow.com/q/29914141
type: Question
tagged with: http://stackoverflow.com/tag/json
tagged with: javascript
upvote count: 2
tagged with: cesiumjs
has title: CesiumJS memory management issues
answer count: 1
has answer: http://stackoverflow.com/a/29926302
favorite count: 0
accepted answer: http://stackoverflow.com/a/29926302
score: 2
type: AnsweredQuestion
downvote count: 0
tagged with: geojson
has body: I am making a 3d model viwer in cesiumjs. The geojson is requested from the url and it works fine for small models. Incase of complex json multipolygon files and json url request data exceeds 16mb cesium takes so long in parsing and then rendering and if I make a call to one other model it crashes the web browser with error out of memory. I checked chrome along side and it eats up around 900 memory for a 16mb geojson from url. Is there better way of memory management? or any tips how to tackle this problem. One solution could be 3d mesh simplification before sending the geojson for that model but I am asking related to memory management on client side.

http://stackoverflow.com/comment/47840446
type: QuestionComment
has text: Tried, but that didnt work
comment on: http://stackoverflow.com/q/29857242
score: 0
type: Comment

http://stackoverflow.com/comment/48035573
type: QuestionComment
score: 2
comment on: http://stackoverflow.com/q/29957407
has text: Google's recommendations: [Optimizing JavaScript code: Avoiding pitfalls with closures](https://developers.google.com/speed/articles/optimizing-javascript)
type: Comment

http://stackoverflow.com/comment/47872872
has text: @Deb Are you creating the "Audios" link in the AJAX success function?
type: AnswerComment
comment on: http://stackoverflow.com/a/29873963
score: 0
type: Comment

http://stackoverflow.com/a/29920403
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/29903296
has body: Bookshelf.js uses Knex.js under the hoods so the answer to your question lies in how Knex handles connections. Knex can use connection pooling from the generic-pool-redux library. It has a default of 2 open connection and a maximum of 10 for postgres and mysql databases and a single connection for sqlite. This is an example of configuration file to change the default values. development: { client: 'postgresql', connection: { database: 'db', user: 'username', password: 'mypassword', charset : 'utf8' }, pool: { min: 5, max: 20 }, migrations: { tableName: 'migrations' } } And his is a portion of the bookshelf documentation for fetchAll Fetches a collection of models from the database, using any query parameters currently set on the model to form a select query So it will form a single Knex query and execute it consuming only one connection. Depending on your configuration file it will use a single connection for everything or any available from the pool. There is an option that allow you to change the connection used to execute the query but for that you must invoke the bookshelf query() method to tap directly into the Knex query builder.
upvote count: 1
type: Answer

http://stackoverflow.com/a/29864888
has body: Firstly, it appears you (or the person assigning the question) slightly misunderstands what jQuery/AngularJS are. jQuery and Javascript aren't mutually exclusive, and AngularJS and Javascript aren't mutually exclusive. Briefly: Javascript: all code (er, that we care about in this question :-) that a web-browser can run in a web-page is written in Javascript jQuery a library of functions written in Javascript that you can use in a web page. Writing something using jQuery is just writing something using Javascript, using the extra functions jQuery provides. AngularJS a library of functions written in Javascript that you can use in a web page. Writing something using AngularJS is just writing something using Javascript, using the extra functions AngularJS provides. (Note the similarities between my definitions of jQuery/AngularJS. Yes some people say AngularJS is a framework, but it's just a set of Javascript functions that people have written) Secondly, I think the question is actually slightly under-specified. I would give yourself a standard task that is done in a web browser, such as Fetch the last 20 items from a Twitter feed, and display the results in a web page Using Plain Javascript (no framework or library) jQuery, adhering to "usual"/"good" jQuery practices. AngularJS, adhering to "usual"/"good" AngularJS practices. And you can then compare the process you went through to achieve each of the above, as well as the final code you wrote for each.
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/29864588
score: 4
upvote count: 4

http://stackoverflow.com/a/29897311
downvote count: 0
type: Answer
score: 3
answers question: http://stackoverflow.com/q/29897194
upvote count: 3
has body: This is a browser thing - consecutive spaces are displayed as one. You might want to replace ' ' with &amp;nbsp; and then it will display all spaces indiviudaly x.replace(" ", "&amp;nbsp;"); Another way is to avoid displaying the string as HTML. For example the alert() function will show the correct number of spaces without the need to replace. Also displaying the string within a &lt;pre&gt; tag should work fine too.

http://stackoverflow.com/comment/75431222
score: 0
has text: dangerous, scurry
comment on: http://stackoverflow.com/a/32671263
type: Comment
type: AnswerComment

http://stackoverflow.com/a/29999832
downvote count: 0
answers question: http://stackoverflow.com/q/29999517
accepted answer of: http://stackoverflow.com/q/29999517
type: Answer
has body: If you console.log scope.model and scope.n, you get the following: scope.model: Data {n: 1, $$hashKey: "object:21"} scope.n: 1 I believe the behavior you are seeing is arising because of ng-repeat: angular generates and attaches a $$hashkey to the object, which angular uses to track updates. The docs say this about $ngModelController's $render method: Since ng-model does not do a deep watch, $render() is only invoked if the values of $modelValue and $viewValue are actually different from their previous value. If $modelValue or $viewValue are objects (rather than a string or number) then $render() will not be invoked if you only change a property on the objects. So it seems that $render is getting invoked for scope.model, but not scope.n, but I don't believe it actually is. I think it's updating because of the $$hashkey that is getting attached with the object to scope.model. Because with scope.n you aren't getting the hashkey, it doesn't update. When angular does a $digest it's going to see that $$hashkey and try to update that binding. If you take out the $$hashkeys it no longer updates. We can strip the $$hashkey by transforming the $viewValue before attaching it to scope.model: scope.model = angular.fromJson(angular.toJson($viewValue)); and now if you console.log(scope.model) you get: Object {n: 3} No more $$hashkey, and the view acts the way you think it would - where $render is not getting invoked. Plunker
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/48118928
has comment: http://stackoverflow.com/comment/48118813
type: AcceptedAnswer

http://stackoverflow.com/comment/47983970
comment on: http://stackoverflow.com/a/29928563
has text: If that has sorted your issue out could you accept the answer ;-)
type: AnswerComment
type: Comment
score: 0

http://stackoverflow.com/a/44618145
type: Answer
score: 0
upvote count: 1
downvote count: 1
has body: It is possible to prevent download automatically from idm (PdfJs). IDM find extention pdf file so we need to convert pdf file to base-64 and then read base64 of pdf into node DOM src: 1. Convert your file pdf to base64 document.getElementById('myfiles').addEventListener('change', function(event){ var input = document.getElementById("myfiles"); var fReader = new FileReader(); fReader.readAsDataURL(input.files[0]); fReader.onloadend = function(event){ document.getElementById("base64").innerHTML = event.target.result; console.log(event.target.result); } }); 2. get all string base64 put to txt file filename.txt 3. read base64 from file txt and past into iframe or with viewer.js (PDF JS) -iframe should prevent download from idm -with PDF viewer var xhr = new XMLHttpRequest(); console.log(file); xhr.open('GET', folderFiles+filename+".txt", true); xhr.responseType = 'text'; xhr.onload = function(e) { if (this.status == 200) { PDFViewerApplication.open(this.response); } }; So, IDM won't force download pdf file automatically because it cannot find specific file. link : https://github.com/sokhasen/ViewerPDF.git
answers question: http://stackoverflow.com/q/29954361
has comment: http://stackoverflow.com/comment/98324146

http://stackoverflow.com/q/29873732
has title: is there better ways other than including require('mongoose') in every models file?
has answer: http://stackoverflow.com/a/29873994
type: Question
answer count: 2
downvote count: 0
tagged with: mongoose
tagged with: javascript
tagged with: express
favorite count: 0
accepted answer: http://stackoverflow.com/a/29873994
tagged with: node.js
upvote count: 3
type: AnsweredQuestion
score: 3
possible better answer: http://stackoverflow.com/a/29874051
has body: i require mongoose in main app.js file once. can i pass it to User. var mongoose = require('mongoose'); without loading it again? in each file. doesn't script do extra job each time i require same module? var User = require('./models/user')
has answer: http://stackoverflow.com/a/29874051

http://stackoverflow.com/comment/47874883
type: AnswerComment
score: 0
type: Comment
has text: And it filters out all the built in / host object stuff?? Hmm maybe it does. In a blank Chrome browser tab I get just 34 members of `window`: `["top", "window", "location", "external", "chrome", "document", "DoodleNotifier", "google", "_", "closure_lm_744166", "jsl", "closure_memoize_cache_", "__jsaction", "gbar", "gbar_", "__PVT", "gapi", "___jsl", "closure_uid_161476544", "closure_lm_36582", "drasil", "osapi", "gadgets", "iframer", "shindig", "pos", "googleapis", "ToolbarApi", "iframes", "IframeBase", "Iframe", "IframeProxy", "IframeWindow", "__gapi_jstiming__"]`
comment on: http://stackoverflow.com/a/29875158

http://stackoverflow.com/comment/47946895
type: Comment
comment on: http://stackoverflow.com/a/29912426
has text: That could also be a translation error when pasting into StackOverflow since it's an English-only site.
score: 0
type: AnswerComment

http://stackoverflow.com/q/29882452
tagged with: jquery
has answer: http://stackoverflow.com/a/29883216
tagged with: http://stackoverflow.com/tag/html
type: UnansweredQuestion
has title: JQuery Mobile Create Page From Listview
has answer: http://stackoverflow.com/a/29884938
has body: Using the code below how would i create a new dynamic page that can be used to show further detailed information about a film? i imagine it uses a onclick event handler with a reference to $.mobile.changePage. // JAVASCRIPT $(document).on('pagebeforeshow', '#moviefilm', function(){ var apikey = "MYAPIKEY"; var baseUrl = "http://api.rottentomatoes.com/api/public/v1.0"; // construct the uri with apikey var moviesSearchUrl = baseUrl + '/lists/movies/box_office.json?apikey=' + apikey + '&limit=5' + '&country=us'; $(document).ready(function() { // send off the query $.ajax({ url: moviesSearchUrl, dataType: "jsonp", success: searchCallback }); }); // callback for when we get back the results function searchCallback(data) { $(document.body).append('Found ' + data.total + ' results for Top Box Office Earning Movie'); var movies = data.movies; $.each(movies, function (index, movie) { $("#filmlist").append(" " + movie.title + " " + " " + "Score: " + movie.ratings.critics_score + "%" + " ").listview().listview("refresh"); }); } }); // HTML
tagged with: listview
type: Question
score: 0
answer count: 2
tagged with: jquery-mobile
tagged with: javascript

http://stackoverflow.com/comment/47826531
has text: That's just some `console.log` magic that uses something like `.constructor.name`
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/29849959

http://stackoverflow.com/comment/47963076
type: AnswerComment
score: 0
type: Comment
has text: @johnG see my update above, slight change but your issue is probably that you need to add the code inside a "dom ready" function so it is not run until after the page loads
comment on: http://stackoverflow.com/a/29920746

http://stackoverflow.com/comment/79452111
score: 0
type: Comment
comment on: http://stackoverflow.com/a/44791450
has text: I've tried a lot of solutions for this issue without much success, but this one looks pretty darn solid. Thank you!
type: AnswerComment

http://stackoverflow.com/q/29942604
accepted answer: http://stackoverflow.com/a/30055192
tagged with: jquery-ui-draggable
tagged with: jquery-draggable
favorite count: 0
has comment: http://stackoverflow.com/comment/48014563
linked to: http://stackoverflow.com/q/5735270
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/48010166
has comment: http://stackoverflow.com/comment/48006985
type: Question
has answer: http://stackoverflow.com/a/30055192
tagged with: jquery-ui
upvote count: 5
tagged with: javascript
has title: How to drag & drop text within contenteditable div with jQuery UI
has body: I'm trying to move a draggable text in a div that is contenteditable. This is the div: Facebook shuts down friends data API to generate more trust among users The goal is to have that text (in this case "API") reinsert into the contenteditable div once it's been dropped at the place where it's been dropped. I've tried getting the value of the div but don't know how to insert the draggable into it. This is the code: https://jsfiddle.net/gsLq7cxy/1/ Any help appreciated!
score: 5
downvote count: 0
answer count: 1
linked to: http://stackoverflow.com/q/8609170
tagged with: jquery

http://stackoverflow.com/a/29919148
score: 2
has comment: http://stackoverflow.com/comment/47960899
upvote count: 2
answers question: http://stackoverflow.com/q/29918850
downvote count: 0
has comment: http://stackoverflow.com/comment/47959768
type: Answer
has body: Try to store in a variable the currentTime on the click event handler when user pauses the player. This way you'll have the exact moment where the music was stopped, just store it on a variable out of object's scope.
has comment: http://stackoverflow.com/comment/47988712

http://stackoverflow.com/comment/48050083
score: 0
comment on: http://stackoverflow.com/q/29964962
type: QuestionComment
type: Comment
has text: why the `.name` in the line that creates the error?

http://stackoverflow.com/q/29857694
score: 1
tagged with: hide
type: Question
has comment: http://stackoverflow.com/comment/47841268
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29857808
upvote count: 1
has body: I am working on adding several expanding divs to a page, but am running into trouble getting the divs to automatically collapse when another expands. Here is the script that I am working with: $(document).ready(function() { $('.nav-toggle').click(function(){ var collapse_content_selector = $(this).attr('href'); var toggle_switch = $(this); $(collapse_content_selector).toggle(function(){ if($(this).css('display')=='none'){ } }); }); });
answer count: 1
has answer: http://stackoverflow.com/a/29857808
favorite count: 0
has title: Javascript toggle click off
tagged with: expand
type: AnsweredQuestion
downvote count: 0

http://stackoverflow.com/a/29889118
has body: you can do this using views in fullCalendar. check this --> http://fullcalendar.io/docs1/views/Available_Views/ use dayClick and eventClick to allow user to click a empty or on event and describe it. Eg: dayClick: function(date, jsEvent, view) { alert('Now you can add an event'); } eventClick: function(calEvent, jsEvent, view) { alert('Event Title: ' + calEvent.title); } Hope this will be use full for you.
score: 0
type: Answer
answers question: http://stackoverflow.com/q/29878551

http://stackoverflow.com/comment/47948309
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/29913183
type: Comment
has text: There are similar question already answered.. http://stackoverflow.com/questions/14219755/show-loading-message-while-loading-contents-in-asp-using-jquery-ajax

http://stackoverflow.com/comment/52178701
comment on: http://stackoverflow.com/a/29982886
type: AnswerComment
type: Comment
score: 1
has text: Hi, i tried in this way and, yes, the input box getting red outlined but i can still insert tags..is it possible block the insert?

http://stackoverflow.com/comment/47889952
comment on: http://stackoverflow.com/a/29882525
score: 0
type: AnswerComment
type: Comment
has text: And yes when i remove self. then it removes the error too. But when i load the controller. I get this error TypeError: ajaxCall.GetCatIndex is not a function

http://stackoverflow.com/comment/47910217
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29892214
has text: Thanks for the input but I decided to use Deepan Venkatesh code :).

http://stackoverflow.com/q/29971990
has comment: http://stackoverflow.com/comment/48063887
has body: I want to delete an event handler form a form that contains an inline definition of onsubmit. &lt;form id="loginForm" onsubmit="return performTask(this);"&gt; I have already try : $("#loginForm").off("submit") $("#loginForm").unbind("submit") $("#loginForm").die("submit") $("#loginForm")[0].onsubmit = null $("#loginForm")[0].onsubmit = undefined $("#loginForm")[0].onSubmit = null $("#loginForm")[0].onSubmit = undefined And nothing works ! I add my own event listener usin jquery method on() but it is never called. It apear that the ol event listener is executed before mine... So the question is, is there any way to purge event handlers ? Or much better is there any way to add an event listener that will be call before the inline handler ?
upvote count: 1
tagged with: google-chrome
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/29972182
tagged with: javascript
score: 0
answer count: 2
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/30056063
type: UnansweredQuestion
has title: Can't remove inline event handler on Chrome
tagged with: events
has comment: http://stackoverflow.com/comment/48063750

http://stackoverflow.com/comment/48047637
type: Comment
comment on: http://stackoverflow.com/q/29963137
score: 0
has text: can you attach a fiddle??
type: QuestionComment

http://stackoverflow.com/a/45501022
upvote count: 1
answers question: http://stackoverflow.com/q/29929411
has comment: http://stackoverflow.com/comment/90048159
downvote count: 0
type: Answer
has body: I searched so long and hard for a simple solution to this problem with no avail...but later I discovered a plugin called fullpage.js that was able to prevent pinch zoom while still allowing touch gestures. Through the process of js/css elimination, I discovered a very simple solution: touch-action: none; Adding this to my full page element successfully prevented pinch zoom but allowed me to scale fabricjs objects with pinching. Hooray !
score: 1

http://stackoverflow.com/comment/48030104
type: Comment
has text: Thanks, @Kinburn101, for the quick reply. You can go here for a working example: http://mj-dev.azurewebsites.net/. Click on the "Our Story" menu item, then choose the "Press" tab, then scroll toward the bottom to the "Baby Mag" item and click either of its images.
comment on: http://stackoverflow.com/a/29930143
type: AnswerComment
score: 0

http://stackoverflow.com/comment/48022578
comment on: http://stackoverflow.com/a/29931139
score: 0
type: AnswerComment
type: Comment
has text: I don't really _care_ what language its in, I just don't know _how_ to do so

http://stackoverflow.com/a/29847340
upvote count: 2
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/47820446
answers question: http://stackoverflow.com/q/29847281
score: 2
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29847281
has body: You missed key before adresses, Try this: $('#autocomplete').autocomplete({ source: addresses, minLength: 3, messages: { noResults: '', results: function() {} } }); also there is no option messages in jQuery UI autocomplete see the docs
has comment: http://stackoverflow.com/comment/47820524

http://stackoverflow.com/comment/47891779
comment on: http://stackoverflow.com/q/29883805
score: 0
type: Comment
has text: Npm is the best choice at this time. Bower is slowly becoming obsolete as more and more browser based JS libraries move over to npm.
type: QuestionComment

http://stackoverflow.com/a/29861176
answers question: http://stackoverflow.com/q/29861053
type: Answer
has comment: http://stackoverflow.com/comment/47848806
has body: you will have to be able to modify their framework to take a new key/value from the items object and pass it to the class that it gives the div. res.class="icon-class"; $scope.items.push(res) I modified your codepen to show you can pass the items object a class key/value http://codepen.io/anon/pen/XbJJzO
score: 0

http://stackoverflow.com/a/29950136
type: Answer
score: 1
has body: Seems to be possible. Source: http://www.sitepoint.com/html5-battery-status-api/ var battery = navigator.battery || navigator.webkitBattery || navigator.mozBattery || navigator.msBattery; if (battery) { alert(battery.level); }
upvote count: 1
downvote count: 0
answers question: http://stackoverflow.com/q/29949928

http://stackoverflow.com/a/29994381
has comment: http://stackoverflow.com/comment/48111625
has body: The main culprit is: return find(start + 5, "(" + history + " + 5)") || find(start * 3, "(" + history + " * 3)"); Lets assume start is equal to 1 and, like with your code, our target is 13. find() is called with our 1 to begin with. Lets call this Find A. find() gets to the snippet above and is triggered again with a new start value of 1 + 5 (6). Let's call this Find B. Find B also gets to the snippet above and is triggered again with a new start value of 6 + 5 (11). Let's call this Find C. Find C also gets to the snippet above and is triggered again with a new start value of 11 + 5 (16). Let's call this Find D. Find D returns the value null to Find C. Find C executes the OR parameter of the above snippet. find() is triggered again with a new start value of 6 * 3 (18). Let's call this Find E. See what's happening? Find E, like with our deceased friend Find D returns the value null to Find C. Find C now returns the value null to Find B. Find B executes the OR parameter of the above snippet. Eventually your recursion will end when a value other than null is returned to your original Find A call, but it still has a way to go before it reaches the original Find A and finally returns a value to our findSolution() function. For every null response, a new find() call is made. null is a falsey value. Until a truthy value is returned (your history variable in this case), new find() functions will be executed. When the history variable is returned, it gets passed back to the calling function, which passes it back to its calling function, until eventually it makes it back to our Find A function call which passes it back to the findSolution() function. A working visualisation You'll need to open your JavaScript console for this. var findIteration = 0; function findSolution(target) { function find(start, history, caller) { var thisIteration = ++findIteration; console.log("Find Iteration " + thisIteration, "Start: " + start, "Called by: " + caller); if (start == target) return hi…
has comment: http://stackoverflow.com/comment/48111796
has comment: http://stackoverflow.com/comment/48112955
downvote count: 0
has comment: http://stackoverflow.com/comment/48111778
has comment: http://stackoverflow.com/comment/48112914
type: Answer
answers question: http://stackoverflow.com/q/29994249
score: 2
upvote count: 2

http://stackoverflow.com/q/29935343
answer count: 1
accepted answer: http://stackoverflow.com/a/29935491
tagged with: javascript
tagged with: jquery
type: AnsweredQuestion
score: 3
downvote count: 0
favorite count: 0
tagged with: colorbox
has body: To display Image I used colorbox..In that I have add rotate-left and rotate-right to rotate the image.. The code is: var rotate_right = document.getElementById('cboxRight'); $(rotate_right).on('click', function () { var cboxphoto = document.getElementsByClassName('cboxPhoto')[0].style; cboxphoto.setAttribute('-ms-transform', 'rotate(90deg)'); }); var rotate_left = document.getElementById('cboxLeft'); $(rotate_left).on('click', function () { var cboxphoto = document.getElementsByClassName('cboxPhoto')[0].style; cboxphoto.setAttribute('-ms-transform', 'rotate(270deg)'); }); It rotate 90deg if I click again on rightrotate button then it wont work..I want to rotate it again when click on button
type: Question
tagged with: css
has answer: http://stackoverflow.com/a/29935491
upvote count: 3
has title: Continuous rotate image onclick of button

http://stackoverflow.com/comment/47957425
has text: I'm worried about this in node-webkit. "nwfaketop" does not work for this issue, since it's not the site itself busting the frame (via JS detection); this seems to be the standard behaviour of the browser (node-webkit = chromium; or Firefox, Chrome, ...).
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29917335
type: AnswerComment

http://stackoverflow.com/q/29858864
has title: How do I resize SVG images on a map as the zoom level changes?
answer count: 1
tagged with: css
favorite count: 0
has answer: http://stackoverflow.com/a/29859270
upvote count: 2
tagged with: d3.js
has body: I'm using leaflet to allow uses to draw custom SVG paths (polygons) on a map. The problem is that when the user zooms out, the polygon becomes too large and obscures the rest of the map. I've looked online for examples, and the resources I've come across uses the geo functions from the d3.geo library. Whereas in my use case I'm using d3, leaflet, and an SVG layer over the map. Is there a formula that I can apply to resize the objects correctly? I know that I will have to apply a translate function which will be based on the width height and current zoom level, but I was wondering if there is a standard way to do this? EDIT: Here is one resource I found, but it uses the d3 geofunctions, and from what I can gather, it seems to redraw the polygons every time the map view is reset (which might be inefficient(?) http://www.d3noob.org/2014/03/leafletjs-map-with-d3js-objects-that.html
accepted answer: http://stackoverflow.com/a/29859270
type: AnsweredQuestion
score: 2
tagged with: leaflet
type: Question
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/47843689

http://stackoverflow.com/q/29963228
tagged with: javascript
score: 0
answer count: 1
has body: I want to use a delete method for my backbone model but for some reason, backbone does not include that model ID in produced request URL. To remove my model, i need to fire a following request: DELETE /api/v1/places/12/place_users/12. Here is my code: # place_user.model.js var PlaceUserModel = Backbone.Model.extend({ url: function() { return this.urlRoot; }, initialize: function(data, options) { this.urlRoot = '/api/v1/places/' + options.placeId + '/place_users' }, }); And i'm trying to remove that using: # PlaceUsersCollection fetches it's results from a remote api placeUsers = new PlaceUsersCollection({placeId: 12}).fetch(); # it's obviously more complicated in the app but let's say i just want to # remove first model placeUsers.models[0].destroy; And that code produces a DELETE request to /api/v1/places/12/place_users (without a model id included). I'm not sure what else can i post in here to make it easier to help me so please ask if you need anything. Thanks in advance!
tagged with: backbone.js
has answer: http://stackoverflow.com/a/29963378
tagged with: backbone-model
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29963378
type: Question
has title: Backbone.Model destroy does not includes model ID in url

http://stackoverflow.com/comment/48000533
score: 0
type: Comment
type: QuestionComment
has text: Why are people providing answers? There is no code, we are just guessing how to fix the problem. The example are good ones nonetheless, but not answering or adhering to the OP's problem. The first step should be that the OP post his code.
comment on: http://stackoverflow.com/q/29939406

http://stackoverflow.com/comment/47900824
type: Comment
type: QuestionComment
score: 0
has text: Will XMLHTTPRequest make the script slow, since I have an array of about 500URL's which keeps updating and changing?
comment on: http://stackoverflow.com/q/29888536

http://stackoverflow.com/a/29875632
has body: If you prefer to keep your existing structure (which I think I wrote some time ago ;-) and btw has an unnecessary variable (keep)!) you can use this modified version of your code : function compareAndUpdate() { var s1 = SpreadsheetApp.openById("XXXXXX-vvxyewdki0J9tGqJl9_f-wZE0zOboQRIscLAA").getSheetByName('Updated Student List'); var s2 = SpreadsheetApp.openById("XXXXXX-yB9Xm1J5RKWS7NF23vD-NTUeIgspbctj3leW4").getSheetByName('Master Student List'); var s3 = SpreadsheetApp.openById("XXXXXX-yB9Xm1J5RKWS7NF23vD-NTUeIgspbctj3leW4").getSheetByName('New Students'); // var definition for easier testing purpose // var s1 = SpreadsheetApp.getActiveSpreadsheet().getSheets()[0]; // var s2 = SpreadsheetApp.getActiveSpreadsheet().getSheets()[1]; // var s3 = SpreadsheetApp.getActiveSpreadsheet().getSheets()[2]; var values1 = s1.getDataRange().getValues(); var values2 = s2.getDataRange().getValues(); var resultArray = []; for(var n=0; n &lt; values1.length ; n++){ var keep = true; for(var p=0; p &lt; values2.length ; p++){ Logger.log(values1[n][0]+' =? '+values2[p][0]); if( values1[n][0] == values2[p][0]){ keep = false;// if same value in first column in s2 then don't keep (you can modify this condition to your needs, extend to whole row or other columns for example ) break; } } if(keep){ resultArray.push(values1[n]);// keep only values from s1 that are not in s2 } } s3.getRange(+1,1,resultArray.length,resultArray[0].length).setValues(resultArray); }
score: 0
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29873693
type: Answer
has comment: http://stackoverflow.com/comment/47880184
accepted answer of: http://stackoverflow.com/q/29873693

http://stackoverflow.com/q/29873269
tagged with: javascript
has title: For JavaScript prototypal inheritance, why can't a parent object be created and saved in a child's constructor?
has answer: http://stackoverflow.com/a/29873326
tagged with: prototype
answer count: 3
downvote count: 0
has body: In this JavaScript code, when the instantiation of new child causes its constructor to execute, the create method does not seem to creating the parent object. The child does not seem to inherit the parent's member function m. function parent() { parent.prototype.a =2; parent.prototype.m = function() { return this.a++; } } function child() { child.prototype = Object.create(parent.prototype); child.prototype.constructor = parent; parent.call(this); } var c = new child(); alert(child.prototype.m()); // 2 alert(child.prototype.m()); // 3 alert(c.m()); // FAILS!!!
favorite count: 0
type: UnansweredQuestion
score: 3
tagged with: prototypal-inheritance
upvote count: 3
linked to: http://stackoverflow.com/q/17392857
has answer: http://stackoverflow.com/a/29873931
type: Question
has answer: http://stackoverflow.com/a/29873312

http://stackoverflow.com/a/29959095
type: Answer
accepted answer of: http://stackoverflow.com/q/29959055
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/48038747
has comment: http://stackoverflow.com/comment/48038721
has comment: http://stackoverflow.com/comment/48038846
has body: The reason that your code is calling Redirect() immediately is because it gets evaluated when setTimeout is run. What you can do to mitigate that is to pass an anonymous function to wrap around the method. Like so: setTimeout(function(){ Redirect(); }, 10000); This link explains why your string "Redirect()" is evaluated as you'd expect. In short (taken from the link): String literals are evaluated in the global context, using eval. WindowTimers.setTimeout()
upvote count: 1
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29959055
has comment: http://stackoverflow.com/comment/48038787

http://stackoverflow.com/comment/47882482
has text: Use a:active class instead of doing it with JS. Take a look here http://www.w3schools.com/css/css_link.asp
type: Comment
comment on: http://stackoverflow.com/a/29876103
score: 0
type: AnswerComment

http://stackoverflow.com/q/29876131
tagged with: confirm
has answer: http://stackoverflow.com/a/29876766
tagged with: report
type: UnansweredQuestion
has body: I have form with checkboxes (in fact with radio buttons instead of checkboxes). I want to create a report with a list of checked options. This report should be confirmed befor submit form. How to do this? There are two other functions already in my code. My form looks similar to form below <?php while($linia=mysql_fetch_array($result)){ echo " ".$linia['Description']." "; } Send form ?> I need it to work like that: Somebody checks some of this radio buttons then click submit then this person should see checked options to read it and confirm if there is no mistakes ex. he/she didn't check one of options he wanted
has title: Generate report from form to confirm before submit
tagged with: forms
type: Question
answer count: 1
tagged with: javascript
score: 0

http://stackoverflow.com/a/29853064
score: 1
has body: move_par ends up with the line setTimeout(move_par, rate); which schedule a new execution of the function, so it seems normal behavior. You need to return earlier from the function if you don't want to call it again.
answers question: http://stackoverflow.com/q/29853015
has comment: http://stackoverflow.com/comment/47836633
upvote count: 1
has comment: http://stackoverflow.com/comment/47837181
type: Answer
has comment: http://stackoverflow.com/comment/47836407
downvote count: 0

http://stackoverflow.com/comment/48126013
type: QuestionComment
has text: I have checked it before raising this question here. I couldn't find the missing link in my code. Thanks for pointing it out anyways.
comment on: http://stackoverflow.com/q/29991783
score: 0
type: Comment

http://stackoverflow.com/comment/48049804
type: Comment
has text: Have you jQuery ? In this case you can use the [getScript](https://api.jquery.com/jquery.getscript/) functoin
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29964869

http://stackoverflow.com/comment/48057063
has text: Yes, I have enabled cors. I tried to connect with the express module and without it (like in my code) but got the same result.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29968307
type: Comment

http://stackoverflow.com/q/29928882
has title: IE9 works in directly loaded page but not working when coming via linked page
type: Question
has comment: http://stackoverflow.com/comment/47979840
has comment: http://stackoverflow.com/comment/48024005
downvote count: 0
tagged with: javascript
has body: This question does not need a cross-browser solution as the pages will be exclusively used by IE9. With that said, I have a page ( myPage ) being developed that accesses a page from a different domain ( linkedPage). Within the linkedPage there is a PDF attachment ( pdfAttachment ). myPage URL: http://myDomain/files/myPage.html linkedPage URL: https://na13.salesforce.com/article/x.html pdfAttachment URL: https://c.na13.content.force.com/servlet/x.pdf When a user triggers the opening of the linkedPage via window.open: window.open('https://na13.salesforce.com/article/x.html', '_blank', 'toolbar=no, scrollbars=yes, resizable=yes, top=300, left=500, width=1000, height=600'); and then clicks on the link for the .pdf attachment, Load x.pdf it returns the error Internet Explorer cannot display the webpage. However, if the user loads the linkedPage directly (versus from a link on myPage), the pdfAttachment loads without issue. I do not have control over the linkedPage or pdfAttachment pages but it may be possible to have the group that does control those host myPage as well as a last resort. Is this a cross-domain issue? I'm not trying to run scripts or manipulate the content so with my less than robust understanding of that, it doesn't seem to fit. Are there settings for IE9 that could be causing the issue? I feel like it might be related to the window.open but was unable to find anything here or through other sites. Does window.open put any limitations on the page it loads? What other possible things could be causing this issue? Thanks to all! ADDITIONAL INFORMATION When troubleshooting this, I discovered that I was able to access linkedPage from myPage and open pdfAttachment successfully on a system with full internet access while the majority of its users will have limited internet access to whitelisted items only (of which both the linkedPage and pdfAttachment are). Also, when users access the linkedPage by itself (not from myPage) they login through Citrix and then log…
tagged with: cross-domain
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/48070997
has answer: http://stackoverflow.com/a/29977021
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/48024095
has comment: http://stackoverflow.com/comment/48024106
has comment: http://stackoverflow.com/comment/47988986
score: 1
tagged with: internet-explorer-9

http://stackoverflow.com/a/29876708
has body: Its not like executing fast, it is the way javascript runs statement after statement. To get the data you need to do that in success callback function, the data would be available only when the server response comes back as its asynchronous call by the time response comes your javascript executes next statements.
answers question: http://stackoverflow.com/q/29876606
type: Answer
score: 0

http://stackoverflow.com/a/29980184
answers question: http://stackoverflow.com/q/29897880
score: 0
has comment: http://stackoverflow.com/comment/48910754
type: Answer
has body: Your app needs the user_posts to get the user's feed. The /user/feed doc explains that pretty well. In any case, you need to implement facebook login, ask for user_posts permission from your user and go from them to get the user's feed.

http://stackoverflow.com/comment/48047553
has text: @Kunal: Thanks. I have added a simple test JSFiddle to demostrate what this does.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29963521
type: Comment

http://stackoverflow.com/a/29887136
has comment: http://stackoverflow.com/comment/47940714
accepted answer of: http://stackoverflow.com/q/29884914
has body: cURL would be a good solution in your case. It is very strange that cURL is disabled on your server, it is widespread. Try to enable it or install. However, there are other ways in PHP to POST data (files, as well) except cURL. 1) Read about stream_context_create function. Also, maybe this link will be helpful: http://board.phpbuilder.com/showthread.php?10372972-RESOLVED-can-I-upload-a-file-using-file_get_contents&amp;s=a1392ce2e27e37513ce9ec62562a3ff0&amp;p=10950863&amp;viewfull=1#post10950863 2) I use HttpRequest in my projects and find it very useful. You can read more in official documentation: http://php.net/manual/en/class.httprequest.php
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47990332
type: Answer
has comment: http://stackoverflow.com/comment/47912618
score: 0
answers question: http://stackoverflow.com/q/29884914

http://stackoverflow.com/q/29878125
has comment: http://stackoverflow.com/comment/47880377
tagged with: ecmascript-6
has answer: http://stackoverflow.com/a/29878147
has comment: http://stackoverflow.com/comment/47880397
tagged with: javascript
linked to: http://stackoverflow.com/q/29879525
accepted answer: http://stackoverflow.com/a/29878147
type: AnsweredQuestion
score: 3
possible better answer: http://stackoverflow.com/a/29878234
downvote count: 0
has answer: http://stackoverflow.com/a/29878234
has title: Is there a defined name for the execution context that encapsulates all others in JavaScript?
favorite count: 0
has body: Is there a defined name for the execution context that encapsulates all others in JavaScript? For example is it called the "global execution context". That phrase is not mentioned in the ES6 spec as far as I can find.
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/47892568
upvote count: 3

http://stackoverflow.com/q/29903654
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29905070
tagged with: google-maps-api-3
score: 0
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/13635903
tagged with: css
has body: So I have been trying to fix this problem for hours now. I've been searching Google and here but still am not able to fix the problem. So this is what I see when I switch to the contact tab in the bootstrap menu. var locations = [ ['Bondi Beach', -33.890542, 151.274856, 4], ['Coogee Beach', -33.923036, 151.259052, 5], ['Cronulla Beach', -34.028249, 151.157507, 3], ['Manly Beach', -33.80010128657071, 151.28747820854187, 2], ['Maroubra Beach', -33.950198, 151.259302, 1] ]; var map = new google.maps.Map(document.getElementById('map-canvas'), { zoom: 10, center: new google.maps.LatLng(-33.92, 151.25), mapTypeId: google.maps.MapTypeId.ROADMAP }); var infowindow = new google.maps.InfoWindow(); var marker, i; for (i = 0; i < locations.length; i++) { marker = new google.maps.Marker({ position: new google.maps.LatLng(locations[i][1], locations[i][2]), map: map }); google.maps.event.addListener(marker, 'click', (function(marker, i) { return function() { infowindow.setContent(locations[i][0]); infowindow.open(map, marker); } })(marker, i)); } $("#mapTab").on('shown', function() { /* Trigger map resize event */ google.maps.event.trigger(map, 'resize'); }); $("#maptab").on("shown", function(e) { google.maps.event.trigger(map, "resize"); map.setCenter(center); }); #map-canvas img { max-width: none !important; } #map-canvas { min-width: 100% !important; max-width: 100% !important; } #map-canvas { width:100%; height:400px; } Home Products Contact Disclaimer I tried a lot of things and I know there are a lot of similar questions and answers to this and I tried them but I still couldnt solve the issue.. Here are some that I tried: Google Maps and jQuery Tabs Google Map in Bootstrap Tab Multiple Google Maps within Bootstrap Tabs stackoverflow.com/questions/25727191/bootstrap-tabs-and-google-maps-not-working
favorite count: 0
upvote count: 1
downvote count: 1
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/3014156
linked to: http://stackoverflow.com/q/27238387
type: Question
has title: Google maps and bootstrap tabs
has answer: http://stackoverflow.com/a/29905070
tagged with: google-maps
answer count: 1

http://stackoverflow.com/comment/48059843
type: QuestionComment
comment on: http://stackoverflow.com/q/29969651
score: 0
has text: There is nothing custom about this control. It is dynamic. I am adding to an existing application. It creates a new menu when a button is clicked. This is the way the site works. What is fragile about it?
type: Comment

http://stackoverflow.com/q/29855182
tagged with: javascript
has title: Breeze underlying array is null error at save
has answer: http://stackoverflow.com/a/29866997
tagged with: angularjs
type: AnsweredQuestion
tagged with: breeze
type: Question
has comment: http://stackoverflow.com/comment/47852493
has comment: http://stackoverflow.com/comment/47842508
accepted answer: http://stackoverflow.com/a/29866997
score: 0
has body: I got the "500 (Internal Server Error) underlying error is null" error message when I want to save the entity I created. Scenario: the user opens a modal window where he can create/edit blog entry he can select tags he also can create new tags if there is a tag which doesn't exist yet then the system creates it automatically The error occurs when the system want to save the new tag. What I really don't get is which array is null?! If I write out the newly created entity then I see a healthy entity created by breeze and there is no null value, except one (blog description field, but it is not a required field) What I did to find to locate the defect: double-check the code - done checking caching - done - it is disabled googling - done - it seems it is a very rare issue place the code into the controller whether it is a scoping issue - done - the result is the same checking the REST controller, it was changed 71 days ago last time, however, in other cases it works well sleeping... sometimes it helps - done, it was awesome but it didn't help restart the machine - done - nothing I think I ran out of ideas... Here is the code. Nothing new in it. Code like this works without any problem in other places in the app. This function is called by onTagAdding method of ngTags-input stuff and it is placed in a service. function onTagAdding(tag) { console.log("ontagadding"); var select = 'id, name'; var p = new Predicate('name', FilterQueryOp.Equals, tag.name); datacontext.tag.getAll(select, p).then(function (result) { if (result.length &lt; 1) { //add new tag var newTag = datacontext.tag.create(); newTag.name = tag.name; console.log('tag ontagadding', tag); console.log('newTag ontagadding', newTag); } datacontext.save().then(function (saveResult) { console.log('saved tag ontagadding'); if (typeof (saveResult) !== 'undefined') { lastSavedTag = saveResult.entities[0]; } }); }); } Controller calls the service method: function onTagAdding(tag) { dataServiceTagHelper.onTagAdding(tag);…
answer count: 1

http://stackoverflow.com/comment/47967429
score: 0
comment on: http://stackoverflow.com/a/29922625
type: AnswerComment
has text: @adeneo carriage `\r` eturn + li `\n` e feed, `CrLf`, `\r\n`. Always saying them in the correct order makes life easier (although I know the easy way to remember of `\r` etur `\n` )
type: Comment

http://stackoverflow.com/a/30093007
type: Answer
answers question: http://stackoverflow.com/q/29894781
score: -3
downvote count: 3
has body: if (window.getSelection) { var sel = window.getSelection(); if (!sel) { return; } var range = sel.getRangeAt(0); var start = range.startContainer; var end = range.endContainer; var commonAncestor = range.commonAncestorContainer; var nodes = []; var node; for (node = start.parentNode; node; node = node.parentNode){ var tempStr=node.nodeValue; if(node.nodeValue!=null &amp;&amp; tempStr.replace(/^\s+|\s+$/gm,'')!='') nodes.push(node); if (node == commonAncestor) break; } nodes.reverse(); for (node = start; node; node = getNextNode(node)){ var tempStr=node.nodeValue; if(node.nodeValue!=null &amp;&amp; tempStr.replace(/^\s+|\s+$/gm,'')!='') nodes.push(node); if (node == end) break; } for(var i=0 ; i&lt;nodes.length ; i++){ var sp1 = document.createElement("span"); sp1.setAttribute("class", "highlight"+color ); var sp1_content = document.createTextNode(nodes[i].nodeValue); sp1.appendChild(sp1_content); var parentNode = nodes[i].parentNode; parentNode.replaceChild(sp1, nodes[i]); } }
accepted answer of: http://stackoverflow.com/q/29894781
upvote count: 0
type: AcceptedAnswer

http://stackoverflow.com/comment/47939323
type: Comment
comment on: http://stackoverflow.com/q/29908282
type: QuestionComment
has text: Does it work for your local transpiler/es6 environment while only jshint is bitching?
score: 0

http://stackoverflow.com/q/29868997
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29880022
type: Question
has comment: http://stackoverflow.com/comment/47867731
tagged with: javascript
has comment: http://stackoverflow.com/comment/47863156
score: 0
has answer: http://stackoverflow.com/a/29880022
answer count: 1
has comment: http://stackoverflow.com/comment/47863429
has title: cordova camera capture using javascript
tagged with: cordova
has comment: http://stackoverflow.com/comment/47867619
has body: I'd like to capture an image using my phones camera, I have installed the plugin 'org.apache.cordova.camera' and all the permissions should come automatically, even though, I checked, and they did. From what I understand, all I need is a button calling the javascript Capture Photo and ofc, the script itself function capturePhoto(){ navigator.camera.getPicture(cameraSuccess,null{sourceType:1,quality:60}); } I am doing this for android (using HTC one m8), am I missing something super obvious?

http://stackoverflow.com/q/29852464
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29852535
has title: How to set interval time in my case
has body: I am trying to set interval in my app and have something like this html &lt;div class="text"&gt; {{currentItem.name}} &lt;/div&gt; &lt;ul&gt; &lt;li ng-repeat="item in items" ng-click="pickItem($index)"&gt;{{item.type}}&lt;/li&gt; &lt;/ul&gt; Controller $scope.index = 0; $scope.currentItem = $scope.items[$scope.index]; // set the first item //The interval start 3 second after the app is loaded $scope.startInt = $interval(function() { $scope.currentItem = $scope.items[$scope.index]; $scope.index++; if(scope.index === $scope.items.length) { $scope.index=0; } }, 3000) The above codes will start the interval 'AFTER' the page is loaded for 3 sec. I was hoping to start the interval immediately when the page first loads. Is there anyway to do this? Thanks a lot!
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/29852537
accepted answer: http://stackoverflow.com/a/29852537
score: 0
possible better answer: http://stackoverflow.com/a/29852535
answer count: 3
tagged with: angularjs
has answer: http://stackoverflow.com/a/29852559
tagged with: http://stackoverflow.com/tag/html
tagged with: css

http://stackoverflow.com/q/29951398
has title: node.js display virtual hosts and current git branch async issue
tagged with: javascript
score: 0
tagged with: shell
has comment: http://stackoverflow.com/comment/48074534
has comment: http://stackoverflow.com/comment/48096557
has comment: http://stackoverflow.com/comment/48095214
tagged with: node.js
answer count: 0
type: UnansweredQuestion
has body: Ok, i am just starting to learn node.js and i am having a little difficulty getting a good grasp on the async nature of it and when/how to use callbacks to get data passed along like i need it. The concept of what i am trying to build is this. I have a small node.js app that uses the FS package - defined as var fs = require("fs"). The app is responding to localhost:4000 right now. When i hit that url, the app will use fs.readdir() to get all of the virtual host files in the directory that i pass to readdir(). Next, the app loops through those files and parses each one line by line and word by word (quick and dirty for now). I am using fs.readFile() to read the file and then literally doing lines = data.toString().split("\n") and then var words = lines[l].split(" ") to get to the data in the file i need. Each virtual host file looks something like this: &lt;VirtualHost *:80&gt; ServerName some-site.local DocumentRoot "/path/to/the/docroot" &lt;Directory "/path/to/the/docroot"&gt; Options Indexes FollowSymLinks Includes ExecCGI AllowOverride All Require all granted &lt;/Directory&gt; ErrorLog "logs/some-site.local-error_log" &lt;/VirtualHost&gt; Here is my main.js file (routes file): var express = require("express"), router = express.Router(), async = require("async"), directoryReader = require(__dirname + "/../lib/directoryReader"); fileReader = require(__dirname + "/../lib/fileReader"); router.get("/", function(req, res) { var response = []; directoryReader.read(function(files) { async.each(files, function(file, callback) { fileReader.read(file, function(data) { if (data.length &gt; 0) { response.push(data); } callback(); }); }, function(err){ if (err) throw err; res.json(response); }); }); }); module.exports = router; My directoryReader.js file: var fs = require("fs"), fileReader = require(__dirname + "/../lib/fileReader"); var directoryReader = { read: function(callback) { var self = this; fs.readdir("/etc/apache2/sites-available", function (err, files) { if (err)…
tagged with: git
type: Question

http://stackoverflow.com/a/29947511
has body: str.substring(str.lastIndexOf("_") + 1) edit for explanation : substring : extracts the characters from a string, between two specified indices. If the second indice is not specified, it extracts from the indice to the end of the string. lastIndexOf : return the indice of the last "_" character of the string. So what you want to return is the string after the last "_" to the end of the string. However if the "filename" contain a "_", it will not work.
score: 0
type: Answer
answers question: http://stackoverflow.com/q/29947379
has comment: http://stackoverflow.com/comment/48021025

http://stackoverflow.com/comment/48092022
has text: this is a website for questions not freelancing
score: 1
comment on: http://stackoverflow.com/q/29986200
type: Comment
type: QuestionComment

http://stackoverflow.com/a/52781407
has comment: http://stackoverflow.com/comment/114236724
answers question: http://stackoverflow.com/q/29920784
upvote count: 2
has body: The variable used is 'name' const {value: name} = await swal({ title: 'Input your name', input: 'text', inputPlaceholder: 'Enter here' }) if (name) { swal('Entered name: ' + name) }
downvote count: 0
type: Answer
score: 2

http://stackoverflow.com/a/29910536
has body: Looks like your js files are not referenced properly. $(document).ready(function(){ $("button").click(function(){ $("p").fadeOut(); }); }); Click Me! K O N T S
answers question: http://stackoverflow.com/q/29910493
score: 0
has comment: http://stackoverflow.com/comment/47943362
type: Answer
has comment: http://stackoverflow.com/comment/47943197
has comment: http://stackoverflow.com/comment/47943182

http://stackoverflow.com/a/29950931
answers question: http://stackoverflow.com/q/29948703
score: 0
type: Answer
has body: You should make the tags holding the letters into &lt;span&gt;s if you don't want the letters to go off the bottom of the screen. Just change: var div = document.createElement('div'); to var div = document.createElement('span');

http://stackoverflow.com/a/29959195
upvote count: 9
has comment: http://stackoverflow.com/comment/48290210
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29958723
has body: If the elements are of the same structure and only differ in the scope against which they are linked, then you should $compile the template once and then link each of the 100 elements against their respective scopes. var myElement = angular.element('&lt;my-element foo="foo" bar="bar"&gt;&lt;/my-element&gt;'); var myElementLinkFn = $compile(myElement); // "items" here is the data that drives the creation of myElement elements angular.forEach(items, function(item){ var newScope = $scope.$new(true); newScope.foo = item.foo; newScope.bar = item.bar; myElementLinkFn(newScope, function(clone){ container.append(clone); }) });
has comment: http://stackoverflow.com/comment/48290633
score: 9
has comment: http://stackoverflow.com/comment/48291146
has comment: http://stackoverflow.com/comment/48289896
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/48289927
type: Answer
answers question: http://stackoverflow.com/q/29958723

http://stackoverflow.com/a/29991189
answers question: http://stackoverflow.com/q/29989200
downvote count: 0
type: Answer
upvote count: 29
score: 29
has body: You could use a filter, like this one below by jeffjohnson9046 The filter makes the assumption that the input will be in decimal form (i.e. 17% is 0.17). myApp.filter('percentage', ['$filter', function ($filter) { return function (input, decimals) { return $filter('number')(input * 100, decimals) + '%'; }; }]); Usage: &lt;tr ng-repeat="i in items"&gt; &lt;td&gt;&lt;/td&gt; &lt;/tr&gt;

http://stackoverflow.com/q/29968752
has answer: http://stackoverflow.com/a/29969026
answer count: 1
has title: Javascript Fullscreen Background Slideshow help needed
tagged with: jquery
has body: I'm new to Javascript, and have a code that's almost perfect but needs a bit of tweaking for my needs. Right now this code generates a fullscreen background slideshow in the body of my page, whereas I want it to do exactly the same job but applied to specific divs by ID. I also would like it to have the option to be randomised if possible. I would be enormously grateful for any help. Thanks. &lt;style&gt; body { background-attachment:fixed; background-repeat: no-repeat; background-size:cover; background-position: center; } &lt;/style&gt; &lt;script language="JavaScript1.2"&gt; //Specify background images to slide var bgslides=new Array() bgslides[0]="images/tickets1.jpg" bgslides[1]="images/tickets2.jpg" bgslides[2]="images/tickets3.jpg" //Specify interval between slide (in miliseconds) var speed=3000 //preload images var processed=new Array() for (i=0;i&lt;bgslides.length;i++){ processed[i]=new Image() processed[i].src=bgslides[i] } var inc=-1 function slideback(){ if (inc&lt;bgslides.length-1) inc++ else inc=0 document.body.background=processed[inc].src } if (document.all||document.getElementById) window.onload=new Function('setInterval("slideback()",speed)') &lt;/script&gt;
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/48057223
tagged with: background
type: Question
tagged with: slideshow
tagged with: javascript
score: 0

http://stackoverflow.com/comment/47850554
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/29862125
has text: [FusionTablesLayer](https://developers.google.com/maps/documentation/javascript/fusiontableslayer) may be an option
type: Comment

http://stackoverflow.com/a/29969020
score: 3
has comment: http://stackoverflow.com/comment/48057794
upvote count: 3
has body: You need to load the jQuery library, for exemple: In the top-left corner of the jsFiddle window, you can see jQuery version 1.7.1 is used.
answers question: http://stackoverflow.com/q/29968991
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29968991
type: Answer

http://stackoverflow.com/comment/47931166
comment on: http://stackoverflow.com/a/29903245
score: 0
type: AnswerComment
has text: I understand your tips stefan but my code still not scrolling !××! I put them here http://demo.mellat-design.ir/demo.js
type: Comment

http://stackoverflow.com/comment/48055391
score: 1
has text: _id_ is global var here, so you can use it directly
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29967907

http://stackoverflow.com/q/29923888
answer count: 1
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/29924956
tagged with: jasmine
favorite count: 0
linked to: http://stackoverflow.com/q/178325
upvote count: 2
accepted answer: http://stackoverflow.com/a/29924956
has body: I have a function that hides and shows items on my page based on what a factory provides me: function toggleMenuItems(config) { // hide all our elements first $(".js-quickMenuElement").hide(); config.data = config.data || []; config.data.forEach(function (d) { if (d === config.viewConfigCatalog.CalendarLink) { $("#CalendarLink.js-quickMenuElement").show(); } if (d === config.viewConfigCatalog.ProductCreation) { $("#ProductCreation.js-quickMenuElement").show(); } // etc etc etc }); }; We've been using Jasmine for our javascript unit tests and we're discussing whether we should test this function. Some say that we don't need to because testing this is coupling the view to the javascript test, but at the same time, if instead of jquery .show and .hide functions those were wrappers, or other functions we would test them. Following on this what would be the best way to test this? Making a wrapper function that takes in a string and injects the string name in the jQuery select seems wrong. Another option we thought of is spying on ($.fn, "show") but that would only let us test if show was called X amount of time and not what was hidden... Thanks,
score: 2
has title: How to (and should we) test UI element visibility in jasmine?
type: AnsweredQuestion
tagged with: unit-testing
type: Question

http://stackoverflow.com/comment/47974714
type: Comment
comment on: http://stackoverflow.com/a/29924906
type: AnswerComment
score: 0
has text: Thanks, I modified your solution a bit and it worked!

http://stackoverflow.com/comment/47919353
type: AnswerComment
comment on: http://stackoverflow.com/a/29898192
type: Comment
score: 0
has text: Oops, my bad. Of course, you are correct.

http://stackoverflow.com/a/29853247
answers question: http://stackoverflow.com/q/29852165
upvote count: 5
score: 4
has body: My two cents!! Knockout does not have a switch case statement. As suggested by RP Niemeyer Michael Best's switch/case binding (https://github.com/mbest/knockout-switch-case) is quite flexible and can let you easily handle this and more complicated ones (more states than true/false). Else you could use condition binding as : Department 1 Also, Department 1 Demo
type: Answer
downvote count: 1

http://stackoverflow.com/a/30056063
type: Answer
answers question: http://stackoverflow.com/q/29971990
has body: And the response is that I'm in a Google Chrome Extension and more precisely in a content script and it's not allow to modify any thing except the DOM it self.
score: 0

http://stackoverflow.com/comment/47943087
has text: Sorry, I wasn't clear enough in the question. What I want is a way for js to make the html content correct (per js config values) BEFORE the page first renders. To avoid any flicker or resizings. So another solution would be to delay the first page render till after some scrips have run. Any way to do that?
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29910205

http://stackoverflow.com/comment/48046849
comment on: http://stackoverflow.com/q/29963129
score: 0
type: QuestionComment
type: Comment
has text: This is actually a good question. I almost answered it until I realized one part that I can't answer: what happens if you call `resolve()` synchronously? Will the promise still fire the `.then()`? In my own implementation of promises I made sure that promises would work both synchronously and asynchronously. But some of the specifications (I think Promise/A?) only support asynchronous `resolve()`. So what does ES6 do?

http://stackoverflow.com/q/29965038
has comment: http://stackoverflow.com/comment/48052305
score: 2
has comment: http://stackoverflow.com/comment/48050293
has comment: http://stackoverflow.com/comment/48050116
answer count: 0
upvote count: 2
tagged with: underscore.js
has comment: http://stackoverflow.com/comment/48050043
type: Question
has comment: http://stackoverflow.com/comment/48050732
has comment: http://stackoverflow.com/comment/48049991
tagged with: javascript
has comment: http://stackoverflow.com/comment/48050703
has comment: http://stackoverflow.com/comment/48083984
downvote count: 0
has title: underscore template with require js text plugin not working
tagged with: jquery
favorite count: 0
tagged with: backbone.js
has body: So I've this template in a html file - &lt;%= x %&gt; And in one of my view, it's been loaded with help of requirejs. I want to load this template with data. var template = _.template(this.rawTpl); var data = { x: 10}; this.$('.instant_preview').html(template(data)); But this throws Uncaught ReferenceError: x is not defined console.log(this.rawTpl); shows that templates been loaded. Whats the problem here?
type: UnansweredQuestion
tagged with: requirejs

http://stackoverflow.com/comment/48116370
has text: It is nearly what I needed. But the arrow should stay at the same position as the box sides up.
comment on: http://stackoverflow.com/a/29996003
score: 0
type: Comment
type: AnswerComment

http://stackoverflow.com/q/29922704
has title: Display in alert window copied HTML element
has answer: http://stackoverflow.com/a/29922842
has comment: http://stackoverflow.com/comment/47967170
downvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/47967512
accepted answer: http://stackoverflow.com/a/29922842
tagged with: http://stackoverflow.com/tag/html
score: 2
type: AnsweredQuestion
has body: I have this code: Professional Ditails Institution Qualification Volvo Saab Fiat Audi test function toCelsius(fahrenheit) { alert("DDD"); } function test() { var elem = $("#initialTransInfoElement").clone(); alert(elem.toString()); } When I click the button "test" I want to see the copied elementrs in alet window but instead I get alert window displsy this text: [object Object] What do I missing?Why I get the massage above?And how can I make the copied HTML code displayed?
upvote count: 2
type: Question

http://stackoverflow.com/comment/47852822
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29863738
has text: no value print @PaulFitzgerald

http://stackoverflow.com/q/29995337
has comment: http://stackoverflow.com/comment/48191557
answer count: 1
has comment: http://stackoverflow.com/comment/48199502
has comment: http://stackoverflow.com/comment/48140860
favorite count: 0
has comment: http://stackoverflow.com/comment/48113053
has comment: http://stackoverflow.com/comment/48117101
has body: I want to create an object in Javascript &amp; Jquery and assign to it 2 images (the amount is careless). But as I need to edit those images during the code and they both have an id, I need to know how to assign to the object always the same 2 images but to edit them in a different way each time, this is what I mean: I got a bulb which needs to be charged, one is charged in 10 seconds, another one maybe in 15, so: How do I assign to an object always the same images, but edit them in a different way (almost) each time? Note I'l call that object more times, but then I'll change the seconds or whatever after calling it (at least this is what I've thought). If you need to have an idea of what it'll look like, check this :)
has comment: http://stackoverflow.com/comment/48163676
has comment: http://stackoverflow.com/comment/48191439
has comment: http://stackoverflow.com/comment/48192710
downvote count: 2
has comment: http://stackoverflow.com/comment/48191960
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/30091117
accepted answer: http://stackoverflow.com/a/30091117
has comment: http://stackoverflow.com/comment/48191483
tagged with: css
has comment: http://stackoverflow.com/comment/48161946
has comment: http://stackoverflow.com/comment/48207401
type: AnsweredQuestion
has title: How to make an object edit images each time it's run?
has comment: http://stackoverflow.com/comment/48140897
upvote count: 1
has comment: http://stackoverflow.com/comment/48195739
type: Question
has comment: http://stackoverflow.com/comment/48192675
has comment: http://stackoverflow.com/comment/48191654
has comment: http://stackoverflow.com/comment/48294924
has comment: http://stackoverflow.com/comment/48136757
tagged with: javascript
tagged with: jquery
score: -1
has comment: http://stackoverflow.com/comment/48188571
has comment: http://stackoverflow.com/comment/48191498
has comment: http://stackoverflow.com/comment/48191609

http://stackoverflow.com/q/29861875
accepted answer: http://stackoverflow.com/a/29886115
has answer: http://stackoverflow.com/a/29862086
type: Question
has answer: http://stackoverflow.com/a/29886115
tagged with: javascript
tagged with: onsen-ui
upvote count: 2
has body: i am trying to create an app from Onsen UI framework. I am using multiple navigator. Here in the first page(Template) it works fine. With another pages it gives certain error. Here is the error i get when i click on my google chrome console Error: You can not supply no "ons-page" element to "ons-navigator". Here is how my page templates looks like: Directory List {{PostCategory.title}} Back {{CurrentCategory}} {{PostDetail.title}} One can not use more then one navigator in the same page? I try to solve the same issue with following method but it helped but it took off the ons-back-button from the navigated page. Back {{CurrentCategory}} {{PostDetail.title}} I just bring the tag inside the and its working awesome but it seems like Back this is not working after that. Any other way of doing it.
answer count: 2
favorite count: 0
has title: ons-navigator Multiple Navigator in one page template
tagged with: cordova
tagged with: angularjs
tagged with: http://stackoverflow.com/tag/html
score: 2
type: AnsweredQuestion
downvote count: 0
possible better answer: http://stackoverflow.com/a/29862086

http://stackoverflow.com/a/29892340
has body: try this $(document).on("click", ".edit", function() {} hope it will solve your problem and if you want to call it after load you can use $(window).load(function(){}) but I think above solution will work for you
accepted answer of: http://stackoverflow.com/q/29892110
score: 0
type: AcceptedAnswer
type: Answer
answers question: http://stackoverflow.com/q/29892110

http://stackoverflow.com/q/29915331
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47952275
tagged with: dependency-management
tagged with: bower
tagged with: git
has body: I'm using bower as my dependency manager, and I want to add a git repository as a dependency. I'm already aware of the fact I can do bower install git@github.com:foo/bar.git, however I need to clone the full directory because my dependency is on a source file of the repo. The files that are missing when using bower are listed as ignored in the repository's bower.json file, the question is then: how can I force bower to clone them even though they're listed as ignored?
has title: Force bower to clone full git repository
type: Question
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/38650116
answer count: 1
has comment: http://stackoverflow.com/comment/47952686

http://stackoverflow.com/a/29885641
upvote count: 3
answers question: http://stackoverflow.com/q/29885618
has body: This is a Javascript object. Better indented, it would look like this: char = { 0: '(', 3: ') ', 6: ' - ' } It's saying that you're making an object with properties 0, 3, and 6 set to the given values. Then, the properties are accessed with char[i], which returns null unless the property is defined -- so for all i except 0, 3, and 6, it'll default to ''. For 0, 3, and 6, it'll take the relevant strings. Alright, I think I figured out what's 'not working', though again I'd need you to explain what that means before I can be sure. This line: obj.value += (char[i]||'') + numbers[i]; will insert undefined in the string if numbers[i] isn't defined, and numbers[i] is only defined for i = 0, 3, or 6. Change the line to this: obj.value += (char[i]||'') + (numbers[i]||''); and it should work.
type: Answer
downvote count: 0
score: 3

http://stackoverflow.com/comment/47942628
has text: This won't be trivial. The fiddle you provided clones the image to a background image for the tiles. Therefore you will need something like: http://cburgmer.github.io/rasterizeHTML.js/ to create an image of the HTML then something like: http://stackoverflow.com/questions/9971249/html5-canvas-as-css-background-image to make it a background image. Good Luck!
type: Comment
score: 1
type: QuestionComment
comment on: http://stackoverflow.com/q/29909437

http://stackoverflow.com/comment/48048276
type: QuestionComment
comment on: http://stackoverflow.com/q/29963690
has text: So is there any other way? like can i reassign $scope.tree = $scope.tree by removing particular deleted triggered node
score: 0
type: Comment

http://stackoverflow.com/a/29867558
score: 1
has body: If you just need to output the object neatly on the screen you can do function print_r(obj) { document.body.innerHTML = '&lt;pre&gt;' + JSON.stringify(obj, null, 4) + '&lt;/pre&gt;'; } FIDDLE
accepted answer of: http://stackoverflow.com/q/29867519
answers question: http://stackoverflow.com/q/29867519
upvote count: 1
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/47859925
downvote count: 0

http://stackoverflow.com/q/29910427
type: UnansweredQuestion
upvote count: 1
has body: I was using the jquery datatables plugin and it does not work after first page, the event click function only work on first page. So I have found out https://datatables.net/faqs/ Q. My events don't work on the second page A. When attaching events to cells in a table controlled by DataTables, you need to be careful how it is done. Because DataTables removes nodes from the DOM, events applied with a static event listener might not be able to bind themselves to all nodes in the table. To overcome this, simply use jQuery delegated event listener options, as shown in this example. Additionally, you could use my Visual Event bookmarklet to help debug event issues. And they suggest like this: $('#example tbody').on('click', 'tr', function () { var name = $('td', this).eq(0).text(); alert( 'You clicked on '+name+'\'s row' ); }); it works, however, In my case I need selector like this: $('#dataTables tbody tr').on('click', 'td', function (event) { if ($(this).attr('id') != "first" &amp;&amp; $(this).parent().attr('data-href') !== undefined) { document.location = $(this).parent().attr('data-href'); } }); How to fix the problem with keeping the selector target? Thanks.
has title: Jquery datatables don't work on the second page
score: 1
type: Question
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
tagged with: css
has answer: http://stackoverflow.com/a/29910446
tagged with: datatable

http://stackoverflow.com/a/29930890
answers question: http://stackoverflow.com/q/29928117
score: 2
has body: I work at Braintree. If you have more questions, I suggest you reach out to our support team. It looks like you're using CSE, a deprecated integration method. I recommend you follow the Braintree docs and use v.zero instead. If you put amount in the form, the user can change the value to whatever they want. That usually isn't the intended behavior, so you generally don't want amount to be part of the form. Instead, include a hidden field with an identifier for the item they're purchasing, or something like that. The recommendation to not use name on your form fields only applies to fields with sensitive information you're intending to encrypt. It's fine to include name on fields that don't contain sensitive data.
has comment: http://stackoverflow.com/comment/48009686
accepted answer of: http://stackoverflow.com/q/29928117
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/48000592
downvote count: 0
upvote count: 2
type: Answer

http://stackoverflow.com/a/29855191
has comment: http://stackoverflow.com/comment/47837112
has comment: http://stackoverflow.com/comment/47837359
answers question: http://stackoverflow.com/q/29855102
has comment: http://stackoverflow.com/comment/47837131
has comment: http://stackoverflow.com/comment/47837407
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/47837271
has body: Sounds like you could use jQuery's .slideToggle() to achieve this. Something like this jsfiddle, perhaps? JS $('#whatevertriggerspopup').on('click', function() { $('#thepopup').slideToggle(); }); EDIT for the margin fix: CSS .toggle-margin { margin-top: 300px; } JS $('#whatevertriggerspopup').on('click', function() { $('#thepopup').slideToggle(); $('#thethingbelowthepopup').toggleClass('.toggle-margin'); });
type: Answer
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/47838090
accepted answer of: http://stackoverflow.com/q/29855102

http://stackoverflow.com/comment/47921130
type: AnswerComment
comment on: http://stackoverflow.com/a/29899069
type: Comment
has text: @xRobot - Well, that's different, if you have multiple `.checkbox` elements you should say so, as that would require iteration and multiple `appendChild`
score: 0

http://stackoverflow.com/a/29927196
score: 2
downvote count: 0
type: Answer
has body: The for loop inside PrimeTest3 is using the same variable i as the loop in largestPrimeFactor3. You need to declare this variable as local to the internal function, with a var declaration. var largestPrimeFactor3 = function (num) { function PrimeTest3(a){ if (a&lt;=1 || a%1!=0) return false; limit = Math.ceil(Math.pow(a,.5)); if (a%2==0 || a%3==0) return false; if (a==2 || a==3) return true; for (var i=6;i&lt;limit;i+=6){ if (a%(i-1)==0) return false; if (a%(i+1)==0) return false; } return true; } for(var i = Math.floor(num/2); i&gt;0; i--){ console.log(i); if(num % i === 0 &amp;&amp; PrimeTest3(i)){ console.log('this passed the test:' + PrimeTest3(i)); return true; } } } console.log(largestPrimeFactor3(13195));
upvote count: 2
answers question: http://stackoverflow.com/q/29927021

http://stackoverflow.com/comment/48073604
type: Comment
comment on: http://stackoverflow.com/a/29970526
score: 0
type: AnswerComment
has text: It should be made clearer that "Once the function has been processed" refers to the ` ` tag and its content being processed, not (as one might interprete the sentence) that the funciton has been *called*. - Interestingly, the OP's `remove()` could safely be called from *within* the script being "removed"

http://stackoverflow.com/q/29916245
type: Question
possible better answer: http://stackoverflow.com/a/29916580
has answer: http://stackoverflow.com/a/29916580
tagged with: javascript
has comment: http://stackoverflow.com/comment/47953850
has answer: http://stackoverflow.com/a/29916712
has body: Choose a zipcode 92507 30078 92606 30004 32034 37160 I have created a drop down menu where the user could select a zip code. I want to send the zipcode that the user has selected to a php script. How to go about this? This is what I have done/understood so far. I need to add this line of code $php_variable = $_GET['param1']; in my php file which would get the zip code as param1 which the javascript sends over the url. I can use an ajax function in my javascript and call a post to send over the data. Am I on the right track? How do I actually save the user's selection of zip code into a variable. Also shouldn't the ajax be in a script? Can I also put the drop down menu in the script portion as well? Almost there. The current problem is that when I click on a particular zip code. This is the url I get http://localhost:8888/92606 instead of http://localhost:8888/getuv.php?param1=92606
tagged with: ajax
score: 0
tagged with: communication
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/29917285
has title: PHP and Javascript Communication
has answer: http://stackoverflow.com/a/29916679
tagged with: php
answer count: 4
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29917285

http://stackoverflow.com/comment/48119117
type: Comment
type: QuestionComment
has text: Is [this](http://stackoverflow.com/questions/29316652/place-text-image-on-svg-path-centroid-using-d3) the question ? If so, it doesn't seem to be locked nor [to have been](http://stackoverflow.com/posts/29316652/timeline)
score: 0
comment on: http://stackoverflow.com/q/29999805

http://stackoverflow.com/comment/47927605
type: QuestionComment
comment on: http://stackoverflow.com/q/29902317
has text: Works fine here http://jsfiddle.net/KyleMit/VUZhL/, any error in the console? What about the php script?
score: 0
type: Comment

http://stackoverflow.com/comment/47908539
comment on: http://stackoverflow.com/q/29892686
score: 0
type: Comment
type: QuestionComment
has text: You can just call `switchClass()` everytime.

http://stackoverflow.com/q/29923277
has answer: http://stackoverflow.com/a/51625692
upvote count: 7
has answer: http://stackoverflow.com/a/29923362
type: Question
answer count: 2
possible better answer: http://stackoverflow.com/a/51625692
tagged with: webpack
tagged with: javascript
has title: Webpack: can't find bundle.js
accepted answer: http://stackoverflow.com/a/29923362
downvote count: 0
score: 7
favorite count: 0
tagged with: node.js
type: AnsweredQuestion
has body: I've finally got the he dev server running and I get something on screen. I've setup a "start" script for NPM like this: "start": "webpack-dev-server --content-base app" I get an error: http://localhost:8080/bundle.js Failed to load resource: the server responded with a status of 404 (Not Found) My folders are set as follows: appDir -&gt;app -&gt;node_modules webpack.config.js package.json My webpack.config.js: module.exports = { context: __dirname + '/app', entry: './index.js', output: { path: __dirname + '/app', filename: './bundle.js' } } Can you tell what's wrong?

http://stackoverflow.com/comment/124705336
type: Comment
comment on: http://stackoverflow.com/a/66878952
has text: @ryan yes is similar, instead of inserting an you can get it first and the delete it.
type: AnswerComment
score: 0

http://stackoverflow.com/q/29959115
accepted answer: http://stackoverflow.com/a/29965601
type: Question
answer count: 1
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29965601
has comment: http://stackoverflow.com/comment/65112165
has body: I have the following javascript which successfully puts the red border and green border according to bootstrap Please check the lines with - (the lines relevant for this question) (function ($) { var defaultOptions = { errorClass: 'has-error', validClass: 'has-success', validIcon: 'glyphicon glyphicon-ok form-control-feedback', invalidIcon: 'glyphicon glyphicon-remove form-control-feedback', highlight: function (element, errorClass, validClass, validIcon, invalidIcon) { $(element).closest(".form-group") .addClass(errorClass) .removeClass(validClass); debugger; -$(element).next() -.addClass(invalidIcon) -.removeClass(validIcon); }, unhighlight: function (element, errorClass, validClass, validIcon, invalidIcon) { $(element).closest(".form-group") .removeClass(errorClass) .addClass(validClass); debugger; -$(element).next() --.removeClass(invalidIcon) --.addClass(validIcon); } }; $.validator.setDefaults(defaultOptions); $.validator.unobtrusive.options = { errorClass: defaultOptions.errorClass, validClass: defaultOptions.validClass, }; })(jQuery); } The razor view its like this: &lt;div class="form-group"&gt; @Html.LabelFor(model =&gt; model.FechaHasta, new { @class = "col-sm-2 control-label" }) &lt;div class="col-sm-10"&gt; @Html.EditorFor(model =&gt; model.FechaHasta, new { htmlAttributes = new { @class = "form-control" } }) &lt;span class="icon" aria-hidden="true"&gt;&lt;/span&gt; &lt;div class="help-block"&gt; @Html.ValidationMessageFor(model =&gt; model.FechaHasta) &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; Screenshot Question: how can I dinamically add the glyphicons so that according to the boostrapframework when a field is valid it shows the green check and when its invalid it shows the red crosss. http://screencast.com/t/Oat8DvZnsy And it should show like this: http://screencast.com/t/irp2fafnGx http://getbootstrap.com/css/#forms
upvote count: 3
tagged with: http://stackoverflow.com/tag/html
has title: Adding bootstraph glyphicon dynamically in asp.net mvc form with unobtrusive validation
favorite count: 0
tagged with: twitter-bootstrap
tagged with: css
type: AnsweredQuestion
score: 3
downvote count: 0

http://stackoverflow.com/q/29874791
has comment: http://stackoverflow.com/comment/47881737
type: Question
has title: How to check if two convex polyhedrons intersect with each other in Three.js?
accepted answer: http://stackoverflow.com/a/29879214
tagged with: three.js
possible better answer: http://stackoverflow.com/a/29880076
has answer: http://stackoverflow.com/a/29880076
has comment: http://stackoverflow.com/comment/47878408
answer count: 2
has body: I'm working on a problem that need to randomly generate and put convex polyhedrons into a cube/cylinder container at randomly chosen points without overlapping. I'm using three.js to get a graphic output. A demo. While putting a polyhedron, how to check whether it intersects with other polyhedrons? The convex polyhedron involved is simply tetrahedron or hexahedron and is constructed using THREE.ConvexGeometry. As I need a precise check, bounding box is not enough, I just use it to make sure two polyhedrons are not intersected. I've done a lot research and found many complicated theories and methods, what I need is to get a Boolean result that tells if there exists an intersection between two convex polyhedrons. SAT (Separating Axis Theorem) in 3D is good enough, but Three.js doesn't seem to be capable of doing this. Can anyone tell me how to do this kind of check in a simple way or just explain how to do it with SAT in 3D?
upvote count: 1
has comment: http://stackoverflow.com/comment/47878457
has comment: http://stackoverflow.com/comment/47878049
has comment: http://stackoverflow.com/comment/47876689
has comment: http://stackoverflow.com/comment/47881944
tagged with: intersection
tagged with: javascript
has answer: http://stackoverflow.com/a/29879214
has comment: http://stackoverflow.com/comment/47878531
tagged with: 3d
type: AnsweredQuestion
downvote count: 0
score: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/47878848

http://stackoverflow.com/a/29878822
has comment: http://stackoverflow.com/comment/47881777
type: Answer
has body: This is little more than obfuscation what you are doing. Presumably you want to prevent the users from cheating. Doing so and relying on client side code won't work securely. When the client browser receives the answer hashes and the corresponding salts, the user can simply brute force the correct answers. The number of possible answers is so small that the user can try every possible answer with the received salt and find the matching answer by comparing the hashes. Since this is nothing more than obfuscation, why make it complicated? Simply encode your correct answers with Base 64 or something like that. This will prevent most users from cheating. If you actually want to make sure that no user can cheat, you need to send the selected answers to the server. If you actually want to go ahead with your plan, the fastest MD5 hasher for JavaScript right now is SparkMD5, not that you need the speed for your use case. CryptoJS also implements MD5 and PHP has the md5() function. All those implementations are compatible. You just have to make sure that you use the same encoding (Character encoding and Hex/Base64). A construction with a salt may be md5(answer || salt) where || denotes concatenation. This is not really save, but it doesn't matter in your case anyway.
accepted answer of: http://stackoverflow.com/q/29878548
answers question: http://stackoverflow.com/q/29878548
score: 0
type: AcceptedAnswer

http://stackoverflow.com/q/29898295
has title: How to set the edge's length in cytoscape.js with cola?
accepted answer: http://stackoverflow.com/a/30051366
has comment: http://stackoverflow.com/comment/47919556
tagged with: graph-theory
type: AnsweredQuestion
tagged with: cytoscape.js
tagged with: javascript
has body: I am using the latest version of cytoscape.js and cola.js. When I change "edgelength" nothing happens. how can I do this?
type: Question
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/30051366

http://stackoverflow.com/comment/49322178
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29948849
has text: No problem. Glad I could be of help.
score: 0

http://stackoverflow.com/comment/48128620
type: Comment
has text: slickPause only stops autoplay, not playing of next slide.
comment on: http://stackoverflow.com/q/29986838
score: 0
type: QuestionComment

http://stackoverflow.com/comment/47976630
type: AnswerComment
has text: Lemme see if I can set up a plunkr for you.
score: 0
comment on: http://stackoverflow.com/a/29927392
type: Comment

http://stackoverflow.com/a/49306267
type: Answer
answers question: http://stackoverflow.com/q/29929411
has body: I got the easiest fix for this, in the index.html or similar file for your project, within the script tag, include electron and configure zoom level as below, &lt;script&gt; const electron = require('electron'); // Include electron electron.webFrame.setZoomLevelLimits(1, 1); // Set min max zoom level as 1 const { ipcRenderer } = electron; ... &lt;/script&gt; This works perfectly fine across devices. The viewport meta tag approach doesn't work well on desktop, only fixes issue on mobile devices.
score: 0

http://stackoverflow.com/a/29846179
has comment: http://stackoverflow.com/comment/47818585
type: Answer
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/47818528
has body: Are you wrapping that contents with a &lt;table&gt; somewhere else? A &lt;tbody&gt; element should always be wrapped in a &lt;table&gt; element.
accepted answer of: http://stackoverflow.com/q/29846062
has comment: http://stackoverflow.com/comment/47818228
answers question: http://stackoverflow.com/q/29846062
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47818129

http://stackoverflow.com/q/29845651
tagged with: javascript
has body: This is my form action file in php. I am successful in uploading images but text files are producing 'Invalid File Error'. What may be the error and how to resolve it? <?php error_reporting(E_ALL); ini_set('display_errors', 1); if (isset($_POST['submit'])) { $j = 0; $target_path = "wep/"; for ($i = 0; $i < count($_FILES['file']['name']); $i++) { $validextensions = array("jpeg", "jpg", "png"); $ext = explode('.', basename($_FILES['file']['name'][$i])); $file_extension = end($ext); $target_path = $target_path . md5(uniqid()) . "." . $ext[count($ext) - 1]; $j = $j + 1; if (($_FILES["file"]["size"][$i] < 100000) && in_array($file_extension, $validextensions)) { if (move_uploaded_file($_FILES['file']['tmp_name'][$i], $target_path)) { echo $j . ').Image uploaded successfully!. '; } else { echo $j . ').please try again!. '; } } else { echo $j . ').Invalid file Size or Type '; } } } ?>
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29847125
type: UnansweredQuestion
upvote count: 1
tagged with: php
has comment: http://stackoverflow.com/comment/47896958
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/47816985
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/29847331
has title: What the error in this code, the server will upload photos but not text files?
has comment: http://stackoverflow.com/comment/47816993

http://stackoverflow.com/a/29918418
answers question: http://stackoverflow.com/q/29918303
has body: I wired up a quick jsFiddle and it seems fine: http://jsfiddle.net/tfqytchk/ Of course the first time you press save user is an emptry string and user.name is undefined (I think that's what you're reporting). If you want that to change that behavior then change $scope.user = ''; to $scope.user = { name: '' };
has comment: http://stackoverflow.com/comment/47958131
score: 0
type: Answer

http://stackoverflow.com/q/29985943
type: Question
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/29986310
tagged with: javascript
has answer: http://stackoverflow.com/a/29986049
tagged with: jquery
has body: I am trying to create a toggle menu bar for php website. html code Submenu Lorem ipsum script code $(function(){ $('#slide-submenu').on('click',function() { $(this).closest('.list-group').fadeOut('slide',function(){ $('.mini-submenu').fadeIn(); }); }); $('.mini-submenu').on('click',function(){ $(this).next('.list-group').toggle('slide'); $('.mini-submenu').hide(); }) }) At present the one that i have works fine but the problem is that when the first time i open the page the submenu that is under the nav_bar image gets opened automatically and when i click on cross button then the nav_bar image appears like this but what i want is opposite to it. i wish that whenever the page is loaded the image should appear first and when i click on the image the submenu should appear under it.
has title: create a toggle navbar on html page
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: twitter-bootstrap-3
tagged with: twitter-bootstrap

http://stackoverflow.com/comment/48046075
score: 0
comment on: http://stackoverflow.com/a/29960983
type: Comment
type: AnswerComment

http://stackoverflow.com/q/29966181
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/29969575
type: AnsweredQuestion
has body: I have some list of div elements ordered vertically. Using jQuery TouchSwipe plugin added swipe event to catch left-right swipe. Idea was to remove element from list by swiping it left or right side like this: Finally I got something like this: $(function() { $('.swElement').swipe({ swipeStatus: function(event, phase, direction, distance, duration, fingerCount) { console.log(distance); if (phase == "move") { if (direction == "right") { $(this).css({ 'right' : (distance*-1)+'px' }); } } else if (phase == "cancel") { $(this).css({ 'right' : 0 }); } else if (phase == "end") { $(this).animate({ 'right' : '-100%' }, 200, function() { $(this).remove(); }); } else { //????? } }, threshold: 150, maxTimeThreshold: 5000, fingers: 'all' }); }); .swElement { display: block; width: 100%; height: 50px; border: 1px solid black; box-sizing: border-box; padding: 0 10px; line-height: 50px; cursor: pointer; position: relative; } Swipe right to remove element Element Element Element Element Element Problem It's working great on mobile chrome browser, but prevents up/down scroll on native android browser. I understand that this swipeStatus catch both left/right and up/dmown directions, but don't know how to prevent is from it - I need only right swipe event. Any ideas? Thanks in advance. Update I can't use jQuery mobile framework, because it conflict's with other scripts which I have to use. Maybe there will be another way to figure out?
score: 1
upvote count: 1
has answer: http://stackoverflow.com/a/34497110
type: Question
possible better answer: http://stackoverflow.com/a/35298714
tagged with: swipe
tagged with: mobile
has answer: http://stackoverflow.com/a/35298714
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29969575
tagged with: touch
answer count: 3
has title: jQuery touchSwipe event on element prevents scroll
downvote count: 0

http://stackoverflow.com/comment/47841350
comment on: http://stackoverflow.com/a/29847796
score: 0
type: AnswerComment
has text: Where are you getting the button.data('whatever') is undefined? It is defined in this line: Open modal for @mdo
type: Comment

http://stackoverflow.com/q/29972255
has comment: http://stackoverflow.com/comment/48064523
downvote count: 0
answer count: 1
favorite count: 0
upvote count: 1
accepted answer: http://stackoverflow.com/a/29972568
has comment: http://stackoverflow.com/comment/48064353
type: AnsweredQuestion
score: 1
has body: Stuck on why this isn't working, anyone got any ideas? It should update the button and i think it does, just displays the else at the end all the time function friendToggle(type,user,elem){ var conf = confirm("Press Ok to confirm the '" +type+ "' action for user " + user); if(conf != true){ return false; } O(elem).innerHTML = 'please wait...'; params = user request = new ajaxRequest() request.open("POST", "friendSystem.php", true) request.setRequestHeader("Content-type", "application/x-www-form-urlencoded") request.setRequestHeader("Content-length", params.length) request.setRequestHeader("Connection", "close") request.onreadystatechange = function(){ if(this.readyState == 4){ if(this.responseText == "friend_request_sent"){ O(elem).innerHTML = 'OK Friend Request Sent'; }else if(this.responseText == "unfriend_ok"){ O(elem).innerHTML = ' Request As Friend '; }else { alert(request.responseText); O(elem).innerHTML = 'Try again later'; } } } request.send("type="+type+"&user="+user); } This is the code it calls: if($_POST['type'] == "friend") { $friendCount = mysqli_fetch_row(querySQL("SELECT COUNT(*) FROM friends WHERE user='$user' AND accepted='1' OR friend='$user' AND accepted='1'")); $blockCount1 = mysqli_fetch_row(querySQL("SELECT COUNT(*) FROM blockedusers WHERE blocker='$user' AND blockee='$view' LIMIT 1")); $blockCount2 = mysqli_fetch_row(querySQL("SELECT COUNT(*) FROM blockedusers WHERE blocker='$view' AND blockee='$user' LIMIT 1")); $rowCount1 = mysqli_fetch_row(querySQL("SELECT COUNT(*) FROM friends WHERE user='$view' AND friend='$user' AND accepted='1' LIMIT 1")); $rowCount2 = mysqli_fetch_row(querySQL("SELECT COUNT(*) FROM friends WHERE user='$user' AND friend='$view' AND accepted='1' LIMIT 1")); $rowCount3 = mysqli_fetch_row(querySQL("SELECT COUNT(*) FROM friends WHERE user='$view' AND friend='$user' AND accepted='0' LIMIT 1")); $rowCount4 = mysqli_fetch_row(querySQL("SELECT COUNT(*) FROM friends WHERE user='$user' AND friend='$view' AND accepted='0' LIMIT 1…
type: Question
has comment: http://stackoverflow.com/comment/48064318
has title: Ajax call not returning expected value
tagged with: javascript
has answer: http://stackoverflow.com/a/29972568
tagged with: ajax

http://stackoverflow.com/comment/47873668
type: QuestionComment
has text: oh, I still don't have any idea on how does the service/store can change the value of the `vm.title`.
type: Comment
comment on: http://stackoverflow.com/q/29874315
score: 0

http://stackoverflow.com/comment/47930149
type: Comment
score: 0
type: AnswerComment
has text: Thanks! I never knew document.write did it on everything.
comment on: http://stackoverflow.com/a/29901877

http://stackoverflow.com/comment/48897040
comment on: http://stackoverflow.com/a/29907618
type: AnswerComment
score: 0
type: Comment
has text: Thanks very much @Luckyrat for that script I'll try to run it on some channels :) is it ok to run that from non-jsm, so like mainthread? I don't see any issues

http://stackoverflow.com/a/29900789
type: AcceptedAnswer
score: 4
accepted answer of: http://stackoverflow.com/q/29900731
answers question: http://stackoverflow.com/q/29900731
type: Answer
upvote count: 4
downvote count: 0
has body: input, presumably, contains an object representing parsed XML (since jQuery will parse data with the right content-type unless you tell it not to). You are converting it to text (probably the string "[object Object]") and trying to parse that as if it was XML (which it isn't).

http://stackoverflow.com/q/29955732
has answer: http://stackoverflow.com/a/29956672
has answer: http://stackoverflow.com/a/29956301
favorite count: 0
upvote count: 2
tagged with: twitter-bootstrap
has title: Bootstrap dropdown doesn't work inside modal
has body: Is there a known reason why dropdown would not work inside a modal? I am using rails 4 and the dropdown works perfectly fine all over the app except for the modal. Here is how it is rendered I suspect this might be an issue with javascript, I have tried changing the order of including javascripts in my application.js but nothing would work. Here is my application.js: //= require bootstrap //= require jquery/jquery-2.1.1.js //= require jquery_ujs //= require turbolinks //= require cloudinary //= require jquery.turbolinks //= require slimscroll/jquery.slimscroll.min.js //= require bootstrap-sprockets Has anyone ran into this before? is there a fix for this? I tried searching all over but couldn't find any relevant solution EDIT: The modal code &lt;div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"&gt; `enter code here`&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;Add Group&lt;/h4&gt; &lt;/div&gt; &lt;div class="modal-body"&gt; &lt;div class="form-group"&gt;&lt;label&gt;Class name&lt;/label&gt; &lt;input type="name" placeholder="Choose a name for your group" class="form-control"&gt;&lt;/div&gt; &lt;div class="form-group"&gt;&lt;label&gt;Class name&lt;/label&gt; &lt;input type="desc" placeholder="Add a description for your group" class="form-control"&gt;&lt;/div&gt; &lt;div class="form-group"&gt; &lt;label class="font-noraml"&gt;Select&lt;/label&gt; &lt;div class="input-group"&gt; &lt;select data-placeholder="Select a grade..." class="chosen-select" style="width:350px;" tabindex="2"&gt; &lt;option value=""&gt;Select&lt;/option&gt; &lt;option value="Prekindergarten"&gt;Prekindergarten&lt;/option&gt; &lt;option value="Kindergarten"&gt;Kindergarten&lt;/option&g…
has comment: http://stackoverflow.com/comment/48032368
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29956672
type: Question
answer count: 2
score: 2
downvote count: 0
linked to: http://stackoverflow.com/q/19089337
tagged with: javascript
tagged with: jquery
tagged with: ruby-on-rails-4
possible better answer: http://stackoverflow.com/a/29956301

http://stackoverflow.com/q/29983178
tagged with: leaflet
has answer: http://stackoverflow.com/a/29984241
upvote count: 3
type: Question
tagged with: google-maps
has title: Leaflet popup close button
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: http://stackoverflow.com/tag/html
has body: I'm making a leaflet map for my own website, I'm not good at javascript html and css, so that's why I going to ask this question here.. Is there anybody who know how to add a X (Close button) to the right corner? The code I am using can be found over here: http://jsfiddle.net/z1nw3pt4/2/ layer.on('click', function (e) { document.getElementById("info").innerHTML = feature.properties.name; $("#feature_infos").stop(); $("#feature_infos").fadeIn("1000"); console.log(feature.properties.name); }); The code above her is for opening the popup.
favorite count: 0
accepted answer: http://stackoverflow.com/a/29984241
type: AnsweredQuestion
score: 3

http://stackoverflow.com/a/29947732
has body: Giving you're already getting time with momentjs, you can try moment.utc() method. The docs say: As of version 2.0.0, a locale key can be passed as the third parameter to moment() and moment.utc() moment('2012 juillet', 'YYYY MMM', 'fr'); moment('2012 July', 'YYYY MMM', 'en'); You can do a lot more with the utc() method. moment.utc(); moment.utc(Number); moment.utc(Number[]); moment.utc(String); moment.utc(String, String); moment.utc(String, String[]); moment.utc(String, String, String); moment.utc(Moment); moment.utc(Date);
upvote count: 3
score: 3
accepted answer of: http://stackoverflow.com/q/29947468
has comment: http://stackoverflow.com/comment/48028942
answers question: http://stackoverflow.com/q/29947468
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/48030613
type: Answer

http://stackoverflow.com/a/29892455
accepted answer of: http://stackoverflow.com/q/29892126
has comment: http://stackoverflow.com/comment/47909330
answers question: http://stackoverflow.com/q/29892126
type: AcceptedAnswer
has body: You should look errors: &lt;?php $result = mysql_query("SELECT * FROM data WHERE username = '$name'"); if (!$result) { var_export(mysql_error()); } $data = []; while ($row = mysql_fetch_assoc($result)) { $data[] = $row; } var_export($data); and don't forget about sql-injections... PDO: &lt;?php try { $dbh = new PDO('mysql:dbname=test;host=127.0.0.1', 'root'); } catch (PDOException $e) { echo 'Connection failed: '.$e-&gt;getMessage(); } $name = 'yourName'; $sth = $dbh-&gt;prepare('SELECT * FROM data WHERE username = :name'); $sth-&gt;bindParam(':name', $name, PDO::PARAM_STR); if (!$sth-&gt;execute()) { throw new Exception($sth-&gt;errorInfo()); } $result = $sth-&gt;fetchAll(PDO::FETCH_ASSOC); var_export($result);
has comment: http://stackoverflow.com/comment/47909128
has comment: http://stackoverflow.com/comment/47908584
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/47909530
has comment: http://stackoverflow.com/comment/47909011

http://stackoverflow.com/comment/48075010
has text: `var allHTML = $('body').html();` works.
type: QuestionComment
comment on: http://stackoverflow.com/q/29977672
score: 0
type: Comment

http://stackoverflow.com/comment/47928184
type: AnswerComment
has text: That's another question but I would point you at using something like [`filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter): *method creates a new array with all elements that pass the test implemented by the provided function.*
type: Comment
comment on: http://stackoverflow.com/a/29901530
score: 0

http://stackoverflow.com/comment/48038084
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29916030
has text: @talves thanks, looking forward to mixed mode :D
score: 0

http://stackoverflow.com/q/29883223
possible better answer: http://stackoverflow.com/a/72380434
downvote count: 0
tagged with: javascript
tagged with: jquery
has body: suppose I work with some kind of API and my file server.php handles the connection to the API service. on my client side I use AJAX call like this: $http({ url : 'server/server.php', method : 'GET', data : { getContent : true } }); in my server.php I handle it like this: if(isset($_GET['getContent'])){ $content = get_content(); } function get_content(){...} i just wonder what prevents any one send AJAX call with the same getContent parameter and get all my data? how can i secure it and make sure only calls from my application will get the relevant data back? thank you!
favorite count: 0
tagged with: ajax
tagged with: get
has answer: http://stackoverflow.com/a/29883419
answer count: 4
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29883455
upvote count: 7
tagged with: php
type: Question
accepted answer: http://stackoverflow.com/a/29883419
has title: Secure ajax GET/POST request for server
has answer: http://stackoverflow.com/a/29883490
score: 7
has answer: http://stackoverflow.com/a/72380434

http://stackoverflow.com/q/29931346
has title: Can't get socket.io-client to run through browserify
downvote count: 0
score: 1
tagged with: socket.io
type: Question
has answer: http://stackoverflow.com/a/29952155
has comment: http://stackoverflow.com/comment/47987655
tagged with: javascript
upvote count: 1
answer count: 1
favorite count: 0
type: UnansweredQuestion
has body: When i include socket.io using require('socket.io-client') it says it can't find it, then if I try just socket.io on the following line: var clientSource = read(require.resolve('socket.io-client/socket.io.js'), 'utf-8'); on 'resolve(' I get the error: 'undefined is not a function' My package.json: { "version": "0.0.1", "main": "server.js", "dependencies": { "express": "4.9.x", "react": "0.13.x", "react-async": "2.1.x", "react-timeago": "2.0.x", "react-router-component": "0.24.x", "superagent": "latest", "react-document-title": "1.0.x", "fibers": "^1.0.2", "underscore": "1.8.x", "http-proxy": "1.0.x", "feathers": "1.0.x", "socket.io": "1.3.x", "material-ui": "0.7.x" }, "devDependencies": { "browserify": "9.0.x", "grunt": "0.4.x", "grunt-browserify": "^3.5.0", "grunt-concurrent": "^1.0.0", "grunt-contrib-watch": "^0.6.1", "grunt-nodemon": "^0.4.0", "grunt-react": "^0.10.0" }, "license": "GPL" }

http://stackoverflow.com/a/30000280
has comment: http://stackoverflow.com/comment/48349952
has body: You can get the centroid with a basic average calculation: var centroid= {x:0,y:0}; var pointCount=0; for( var i=0; i&lt; parsedPath.length; i++ ){ var point= parsedPath[i]; if( point.relative == true){ if( i &gt; 0 ){ point.x += +parsedPath[i-1].x; point.y += +parsedPath[i-1].y; } } if( point.x &amp;&amp; point.y ){ centroid.x += point.x; centroid.y += point.y; placePoint(point , "blue" , 0.2 ); pointCount++ }else{ // close pathes -&gt; ignored } } centroid.x /= pointCount; centroid.y /= pointCount; but, depending on your need, this may be not what you are loonking for. See my answer in a previous related question. The demo
answers question: http://stackoverflow.com/q/29999805
has comment: http://stackoverflow.com/comment/48119565
has comment: http://stackoverflow.com/comment/48234649
has comment: http://stackoverflow.com/comment/48235765
score: 3
downvote count: 0
has comment: http://stackoverflow.com/comment/48235893
has comment: http://stackoverflow.com/comment/48234713
type: Answer
has comment: http://stackoverflow.com/comment/48119686
has comment: http://stackoverflow.com/comment/48236212
has comment: http://stackoverflow.com/comment/48119645
upvote count: 3
has comment: http://stackoverflow.com/comment/48234449
has comment: http://stackoverflow.com/comment/48234355
has comment: http://stackoverflow.com/comment/48235492

http://stackoverflow.com/a/30022458
has comment: http://stackoverflow.com/comment/48169795
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29932931
has body: Based on your code, change the lbl as the following. // use backslash var lbl = ' {title} : {item} ';
answers question: http://stackoverflow.com/q/29932931
type: Answer
score: 1
upvote count: 1

http://stackoverflow.com/a/29905413
has comment: http://stackoverflow.com/comment/47933551
answers question: http://stackoverflow.com/q/29905378
type: Answer
has body: You can save it as a file on the NodeJS end, and then download the file using javascript. That is probably the best way, as javascript does not have access to writing to the file system.
has comment: http://stackoverflow.com/comment/47933613
downvote count: 1
score: 0
upvote count: 1

http://stackoverflow.com/comment/48088211
score: 0
has text: Yes you can and you could for methods too but that would impact performance as you will be declaring the property or method each time the constructor is run. Attaching it to the prototype avoid that. It also allows you to have a much cleaner constructor and generally gives you a lot more flexibility to create classes which can extend others and so on.
type: Comment
comment on: http://stackoverflow.com/q/29984261
type: QuestionComment

http://stackoverflow.com/comment/48098859
comment on: http://stackoverflow.com/q/29983293
type: QuestionComment
has text: sorry for the inconvenience here is the fiddle http://jsfiddle.net/karthic2914/s69nqx8j/1/
type: Comment
score: 0

http://stackoverflow.com/comment/47962073
comment on: http://stackoverflow.com/q/29920263
has text: Just put `value` instead of `new ListItem(value)` and see how it goes.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29979749
accepted answer of: http://stackoverflow.com/q/29979451
answers question: http://stackoverflow.com/q/29979451
has body: This will work for multiple images: $(document).ready(function() { $.fn.nextOrFirst = function (selector) { var next = this.next(selector); return (next.length) ? next : this.prevAll(selector).last(); }; $("#cf2 img").click(function() { $(this) .removeClass('visible') .nextOrFirst() .addClass('visible'); }); }); #cf2 { position:relative; height:281px; width:450px; margin:0 auto; } #cf2 img { position:absolute; left:0; max-height: 600px; max-width: 600px; opacity: 0; z-index: 0; -webkit-transition: opacity 1s ease-in-out; -moz-transition: opacity 1s ease-in-out; -o-transition: opacity 1s ease-in-out; transition: opacity 1s ease-in-out; } #cf2 img.visible { opacity: 1; z-index: 1; } &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt; &lt;div id="cf2" class="shadow"&gt; &lt;img class="visible" src="http://static.ddmcdn.com/gif/storymaker-best-hubble-space-telescope-images-20092-514x268.jpg" alt="1"/&gt; &lt;img src="http://economictimes.indiatimes.com/thumb/msid-45891755,width-640,resizemode-4/nasas-images-of-most-remarkable-events-you-cant-miss.jpg" alt="2"/&gt; &lt;img src="http://i.dailymail.co.uk/i/pix/2013/11/03/article-2486855-192ACC5200000578-958_964x682.jpg" alt="3"/&gt; &lt;img src="http://mstatic.mit.edu/nom150/items/199-HybridImage.jpg" alt="4"/&gt; &lt;/div&gt; Instead of having an .invisible class, I used a .visible class, which also has a z-index of 1, greater than that of the default images. So the image that has that class, will be visible, while the others will have opacity: 0 by default. I also extended the jQuery object to have a nextOrFirst method (which I stole from here), so that when the visible image is the last one of the images in the stack, the next one will be the first. So now, the order of the images, as they appear, goes from top to bottom. I decided to do it like this in order to keep your CSS transitions, but you can also use jQuery's fadeIn and fadeOut methods.
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/48081117
has comment: http://stackoverflow.com/comment/48113441
type: Answer
has comment: http://stackoverflow.com/comment/48080720
has comment: http://stackoverflow.com/comment/48080644
upvote count: 1
has comment: http://stackoverflow.com/comment/48080946
score: 1

http://stackoverflow.com/comment/47977384
type: QuestionComment
has text: you need to play around with several until you find one that produces the same output on each end. i found a match for php+js once for AES, but i havn't looked for java. i'm sure something out there can do it, and if you can force unicode or convert to an array of char codes, the one you have might work.
type: Comment
comment on: http://stackoverflow.com/q/29927385
score: 0

http://stackoverflow.com/q/29983049
has comment: http://stackoverflow.com/comment/48085898
answer count: 1
score: 1
favorite count: 0
upvote count: 1
has answer: http://stackoverflow.com/a/29985693
type: AnsweredQuestion
tagged with: playframework-2.0
tagged with: cookies
linked to: http://stackoverflow.com/q/30000940
tagged with: session-cookies
accepted answer: http://stackoverflow.com/a/29985693
has body: I need to get response session cookie in JQuery. I need to know if session has expired and I believe the only way to do is to check whether response from server contains session cookie I am using play framework in backend which doesnt preserve session details at backend and keep session details in cookie only I tried to get cookie from the response like this - $.ajax({type:'POST', url: '@@{search()}', data:$('#searchForm').serialize(), success: function(data, testStatus, jqXHR) { if (data.indexOf("errorsSection") &gt; 0) { alert("trying to get access of cookies from response header in if :"+ jqXHR.getResponseHeader("PLAY_SESSION")); $('#searchResults').hide(); $('#errors').html(data); $('#errors').show(); } else { alert("trying to get access of cookies from response header in else :"+ jqXHR.getResponseHeader("PLAY_SESSION")); alert("trying to get access of cookies from response header in else :"+ jqXHR.getAllResponseHeaders()); alert("in else::::" + $.cookie("PLAY_SESSION") ); $('#errors').hide(); $('#searchResults').html(data); $('#searchResults').show();} jqXHR.getResponseHeader("PLAY_SESSION") gives back null whereas jqXHR.getAllResponseHeaders() give all the header specific data except the data for cookies. Can you please help me in finding cookie from response? Your help is much appreciated. Thanks, Mohit
type: Question
downvote count: 0
tagged with: javascript
tagged with: jquery
has title: How to get response session cookie in Jquery

content-management-system
tags question: http://stackoverflow.com/q/29861582
tags question: http://stackoverflow.com/q/29850027
type: Tag
tag name: content-management-system

http://stackoverflow.com/comment/48049770
has text: From memory, I'll post an answer if I find a source, accessing the value of a password input field is forbidden by the HTML specification; as a security feature.
comment on: http://stackoverflow.com/q/29964035
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29967173
answer count: 2
tagged with: nvd3.js
tagged with: d3.js
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/30066232
has body: I want to display the web traffics with StackedAreChart use nvd3.js. I need to show a tick per hour on X axis:00:00 01:00 02:00 ... 24:00. How do I do that? reference the StackedAreaChart in this page nv.addGraph(function() { var chart = nv.models.stackedAreaChart() .x(function(d) { return d[0] }) .y(function(d) { return d[1] }) .clipEdge(true) .useInteractiveGuideline(true) ; chart.xAxis .showMaxMin(false) //.ticks(d3.time.hour,2) //I wrote this line，but is does not work .tickFormat(function(d) { return d3.time.format('%H:%M')(new Date(d)) }); chart.yAxis.tickFormat(d3.format(',.2f')); d3.select('#chart svg') .datum(data) .transition().duration(500).call(chart); nv.utils.windowResize(chart.update); return chart; });
type: Question
has answer: http://stackoverflow.com/a/30035453
tagged with: javascript
has title: how to make xAxis hourly ticks(like 0,1,2,...,23) in StackedAreChart use nvd3.js?
score: 0

http://stackoverflow.com/q/29997563
answer count: 3
has answer: http://stackoverflow.com/a/29997671
tagged with: arrays
downvote count: 0
tagged with: variables
tagged with: jquery
favorite count: 0
has title: jQuery - Array element as selector
tagged with: attributes
linked to: http://stackoverflow.com/q/3943494
type: UnansweredQuestion
score: 1
has body: I created a little script to "like" posts on a certain forum that I frequent, the script works as intended, liking every post on a certain thread. Now I want to improve it by making it like posts of certain users, rather than every user, so far, I managed to make it work for a specific user: $(function(){ var TargetLink = $("[data-author='SpecificUser'] span:contains('Like')" ); if (TargetLink.length ) TargetLink.each ( function () { var clickEvent = document.createEvent ("HTMLEvents"); clickEvent.initEvent ("click", true, true); this.dispatchEvent (clickEvent); } ); }); But I can't figure out how to make it work for several users since I'm very new to jquery and javascript, in fact I only started learning it just so I could make this script. My idea is have an array with user names, make the value of the atribute "data-autor" a variable and then loop the liking function, but I can't figure out how to do it. The html tree looks something like this: . . . Like . . . . . . Like I want to make something like this: var userNames = ["User1", "User 2", "User 3",...,"User N"]; and then use the elements of the array as the value of the attribute [data-autor='userNames'] in my script, so only post from a specific list of users gets liked, but I have no idea how, I already read several questions but none seem to help me with my specific problem, all the tutorials I find are very basic and doesn't deal with using elements from an array as attribute values.
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/29997700
has answer: http://stackoverflow.com/a/29997670
tagged with: javascript

http://stackoverflow.com/a/35655742
has body: You should always minify your javascript to improve performance. There is a reference !! http://crmbook.powerobjects.com/extending-crm/javascript/crm-javascript-best-practices/
answers question: http://stackoverflow.com/q/29921593
score: 0
type: Answer

http://stackoverflow.com/a/29988456
has body: It should work - function two(a,b){ console.log(a+b); } function one(){ two(1,2); two(3,4); } one(); output: 2 7
downvote count: 0
score: 1
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/48097616
answers question: http://stackoverflow.com/q/29988335

http://stackoverflow.com/comment/47858584
type: AnswerComment
score: 0
type: Comment
has text: Note that `.val()` method returns a string. Either convert the string into a number or use the `==` operator.
comment on: http://stackoverflow.com/a/29866657

http://stackoverflow.com/a/29906516
has comment: http://stackoverflow.com/comment/47937951
has body: I cannot comment just yet, but as to the matter of reading an external JSON file: If your file is available on some URL, you can use AJAX through jQuery to easily get the JSON data you need, parse it and store it in a variable local to your webpage/application. Quick example: var myJSON; //the json object data you're going to draw to canvas with $(document).ready(function(){ $.ajax({ url: "myurl.com/myjsonfile", dataType: "text", success: function(data) { myJSON = $.parseJSON(data); drawToCanvas(myJSON); //you can, perhaps, make the code //Xufox provided into a function that //you pass your myJSON var to once it //is loaded. } }); }) The '$.ajax' call will handle obtaining the data from the URL you specified above, and will execute the 'drawToCanvas()' method only once the data has been loaded and passed to myJSON (which is then passed to the method). You could reference the parameter directly in your function, or store it in a local variable: function drawToCanvas(jsonObj) { var json = jsonObj; ctx.beginPath(); for(var i in json){ ctx.lineTo(json[i].x,json[i].y); } ...
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/47936295
answers question: http://stackoverflow.com/q/29904750

titanium
type: Tag
tags question: http://stackoverflow.com/q/29889455
tag name: titanium
tags question: http://stackoverflow.com/q/29948606
tags question: http://stackoverflow.com/q/29857179
tags question: http://stackoverflow.com/q/29965007
tags question: http://stackoverflow.com/q/29969714
tags question: http://stackoverflow.com/q/29919633

http://stackoverflow.com/comment/47883915
comment on: http://stackoverflow.com/a/29879445
score: 0
type: Comment
has text: screenshot link: https://dl.dropboxusercontent.com/s/6ho3tz7ntpwymwd/webproblem-2.JPg
type: AnswerComment

http://stackoverflow.com/comment/48060172
score: 1
type: QuestionComment
type: Comment
has text: `#gmap_canvas { margin: 0 auto;}` may do the trick.
comment on: http://stackoverflow.com/q/29970234

http://stackoverflow.com/comment/48003358
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29941156
has text: see the link i posted, and the solution posted by Halayem bottom would fix your problem, but i would just get rid of that nasty alert.

http://stackoverflow.com/comment/47986705
score: 0
has text: Sorry. I explained myself poorly. Essentially what I'm trying to do is `indexOf` a string pulled from JSON data, then see if it contains one or more values from a pre-defined array. There are multiple arrays, but every value in a single array would trigger the same event. I'm using a switch statement, but don't want to write and a case for each array value in every single array because well, that would be a TON of cases. basically it boils down to "Does this string contain ANY values from this other array?" if not does it contain any values from another array? Make more sense?
type: Comment
comment on: http://stackoverflow.com/a/29932186
type: AnswerComment

http://stackoverflow.com/comment/47903819
type: Comment
type: QuestionComment
has text: Underscore is an integral and currently inseparable part of meteor. Therefore it is going to be included in your project regardless of you declaring a dependency on your package. Also, there is an ongoing assessment to swap underscore for lodash in not so distant future. Also, these libraries are very efficient in what they do and are huge boost to developer productivity. Therefore, I sincerely suggest you to get to know them and you'll be very happy that you did.
comment on: http://stackoverflow.com/q/29884182
score: 0

http://stackoverflow.com/q/29851947
tagged with: javascript
has comment: http://stackoverflow.com/comment/47839883
favorite count: 0
has comment: http://stackoverflow.com/comment/90721391
has body: I wrote some code to test Sortable with protractor: it('test Sortable', function(done) { var originText, liElems, items, itemList, driver = browser.driver this.timeout(10000) driver.get('http://rubaxa.github.io/Sortable/') itemList = driver.findElement(By.id('foo')) items = function() { return driver.findElements(By.css('#foo &gt; li')) } items().then(function(items) { liElems = items return Promise.map(liElems, function(liElem) { return liElem.getText() }) }).then(function(texts) { originText = texts //return driver.actions().mouseMove(liElems[7]).mouseDown().mouseMove(liElems[1]).mouseUp().perform() return driver.actions().dragAndDrop(liElems[7], liElems[1]).perform() }).then(function() { return Promise.map(items(), function(liElem) { return liElem.getText() }) }).then(function(newText) { expect(newText).to.not.eql(originText) }).then(done() }) I tried mouseMove, dragAndDrop, but it not work, can anyone help me?
has title: How to spec Sortable with protractor
has comment: http://stackoverflow.com/comment/96020317
answer count: 0
upvote count: 2
type: UnansweredQuestion
score: 1
linked to: http://stackoverflow.com/q/25664551
downvote count: 1
type: Question
tagged with: jquery-ui-sortable
tagged with: protractor
has comment: http://stackoverflow.com/comment/47850062

http://stackoverflow.com/comment/48097900
comment on: http://stackoverflow.com/q/29985377
type: Comment
type: QuestionComment
has text: Along related lines, you may be interested in how the iOS and Android Sage apps work - code is on github, I believe. They function using an API of the cell server, so what you want should be possible.
score: 0

http://stackoverflow.com/a/29918964
upvote count: 1
has comment: http://stackoverflow.com/comment/47961557
has comment: http://stackoverflow.com/comment/47962636
score: 1
has comment: http://stackoverflow.com/comment/47965577
answers question: http://stackoverflow.com/q/29918892
has comment: http://stackoverflow.com/comment/47960606
downvote count: 0
has comment: http://stackoverflow.com/comment/47959465
has comment: http://stackoverflow.com/comment/53324263
has body: NodeJS would just act like any server, so you would need to have some end point that returns some data which you should be able to view in your browser via a url. This is the url you would use in your get request from angularjs. See this tutorial for how to implement nodejs as your web server
type: Answer
has comment: http://stackoverflow.com/comment/47960411

http://stackoverflow.com/a/29954184
has comment: http://stackoverflow.com/comment/48029406
has body: Quick update I have finally achieved what I was looking for. More then 1 iframe on a page auto reloading every 5 seconds. If anyone is interested https://jsfiddle.net/
score: 0
answers question: http://stackoverflow.com/q/29947502
type: Answer

http://stackoverflow.com/q/29910350
has body: I'm trying to make a simple DropDownList (something that is simple and fun in c# but somehow frustrating in this context) to allow me to navigate around my MVC App. I'm not experienced with JavaScript at all, but I've spent most of the day trying all sorts of things and using Chrome's JavaScript Console to try and troubleshoot what I can. This is what I've boiled it down to. Razor Engine View: Index @Html.DropDownList("DDLRegion", new SelectList(ViewBag.Tables), new { @id = "DDLRegion" }) @Html.ActionLink("Area1", "Index", "Area1") @Html.ActionLink("Area2", "Index", "Area2") @Html.ActionLink("Area3", "Index", "Area3") @section Scripts{ } The latest error from the JavaScript console is complaining about missing a / on the case '0' block for the @Url.Action method (translates to end up as '/Area1').
has answer: http://stackoverflow.com/a/29910420
has title: Why can't I get my DropDownList change event work?
answer count: 1
has comment: http://stackoverflow.com/comment/47942800
tagged with: jquery
tagged with: asp.net
tagged with: razor
accepted answer: http://stackoverflow.com/a/29910420
type: AnsweredQuestion
score: 0
type: Question
tagged with: asp.net-mvc
tagged with: javascript

python-3.x
tags question: http://stackoverflow.com/q/29973674
type: Tag
tag name: python-3.x

http://stackoverflow.com/a/79530601
score: 0
answers question: http://stackoverflow.com/q/29882361
type: Answer
has body: I came across the attribute label for Users can filter the list via label but upon selection value is the one being submitted not the label. I have tested it today 24-Mar-2025 on the current Firefox, Chrome, Edge browsers You may even test this from W3schools https://www.w3schools.com/tags/tryit.asp?filename=tryhtml5_datalist

http://stackoverflow.com/comment/47913656
type: Comment
comment on: http://stackoverflow.com/a/29894243
type: AnswerComment
has text: The #about div is in the ng-view directive, and this HTML element exist in the view about.html
score: 0

http://stackoverflow.com/comment/47936118
score: 0
comment on: http://stackoverflow.com/a/29906476
type: AnswerComment
has text: You just saved my life! It works perfect, only thing, is there a way to add an alert if the user tries to click the button and it is still disabled?
type: Comment

http://stackoverflow.com/q/29967752
tagged with: http://stackoverflow.com/tag/json
type: Question
has answer: http://stackoverflow.com/a/29968016
answer count: 1
has body: I'm trying to set global application data in lib/config.js (maybe it should be in something more like settings.js or settings.json) like so: AppData = { name : 'Foo', author : 'Mr. Bar', socialLinks : [ { name : 'FaceSpace' , url : 'facespace.com/foo' }, { name : 'Twitgram' , url : 'twitgram.net/foo' } ] } So I can use it in various templates like head.html: {{AppData.name}} Or home.html: Welcome to {{AppData.name}} Or footer.html: {{#each AppData.socialLinks}} {{name}} {{/each}} ... Created by {{AppData.author}} I tried searching for examples of this pattern with no luck. It's quite possible I'm asking the wrong questions.
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29968016
score: 0
tagged with: meteor
has title: Global application data in Meteor
type: AnsweredQuestion

http://stackoverflow.com/q/29849729
tagged with: javascript
tagged with: jquery
upvote count: 1
answer count: 1
accepted answer: http://stackoverflow.com/a/29851165
tagged with: templates
tagged with: mention
favorite count: 0
has body: Note: This could be a documentation for the feature of templating the list item for the plugin jQuery.mentionsInput. So I request the users, not to close this or delete this question. TIA. I am using jQuery.mentionsInput in my project. Everything works fine. I am calling the plug-in using this: $(".mention").mentionsInput({ onDataRequest: function (mode, query, callback) { $.getJSON('/usersList', function(responseData) { responseData = _.filter(responseData, function(item) { return item.name.toLowerCase().indexOf(query.toLowerCase()) &gt; -1 }); callback.call(this, responseData); }); } }); And the source of /usersList looks like this: [ { "id": "Praveen", "name": "Praveen Kumar", "avatar": "/img/users/1.jpg", "type": "user" }, { "id": "jeff", "name": "Jeff Atwood", "avatar": "/img/users/2.jpg", "type": "user" }, { "id": "pekka", "name": "Pekka Gaiser", "avatar": "/img/users/3.jpg", "type": "user" }, { "id": "billgates", "name": "Bill Gates III", "avatar": "/img/users/4.jpg", "type": "user" } ] If you could see, there's a Full Name (name) and a username (id) associated with every user. I would like the plug-in to display the username along with the full name, so I made an amendment to the JSON like this: "name": "Praveen Kumar (@Praveen)", But this gives an effect like below in the textarea: Hello Praveen Kumar (@Praveen), how are you? Instead of displaying like: Hello Praveen Kumar, how are you? I want this to be displayed only when the suggestion takes place and not during the insertion into the textbox. I know this can be changed using templates, but there's no documentation anywhere given on their website. Can someone help? I am using this: templates: { wrapper: _.template('&lt;div class="mentions-input-box"&gt;&lt;/div&gt;'), autocompleteList: _.template('&lt;div class="mentions-autocomplete-list"&gt;&lt;/div&gt;') } Any heads-up on this part? Thanks in advance.
has answer: http://stackoverflow.com/a/29851165
tagged with: mentionsinput.js
type: AnsweredQuestion
downvote count: 0
score: 1
has title: How do I use templating in MentionsInput.js?
type: Question

http://stackoverflow.com/comment/47882127
has text: urw ... but plz use event listeners instead of onclick attribute https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener
score: 0
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/29877798

twitter-bootstrap
tags question: http://stackoverflow.com/q/29862158
tags question: http://stackoverflow.com/q/29930568
tags question: http://stackoverflow.com/q/29985079
tags question: http://stackoverflow.com/q/29953825
tag name: twitter-bootstrap
tags question: http://stackoverflow.com/q/29853123
tags question: http://stackoverflow.com/q/29985690
tags question: http://stackoverflow.com/q/29984862
tags question: http://stackoverflow.com/q/29847498
tags question: http://stackoverflow.com/q/29878561
tags question: http://stackoverflow.com/q/29911622
tags question: http://stackoverflow.com/q/29959115
tags question: http://stackoverflow.com/q/29893390
tags question: http://stackoverflow.com/q/29916017
tags question: http://stackoverflow.com/q/29879945
tags question: http://stackoverflow.com/q/29910802
tags question: http://stackoverflow.com/q/29912015
tags question: http://stackoverflow.com/q/29868778
tags question: http://stackoverflow.com/q/29928780
tags question: http://stackoverflow.com/q/29981852
tags question: http://stackoverflow.com/q/29925527
tags question: http://stackoverflow.com/q/29942769
tags question: http://stackoverflow.com/q/29992780
tags question: http://stackoverflow.com/q/29930637
tags question: http://stackoverflow.com/q/29942291
tags question: http://stackoverflow.com/q/29936854
tags question: http://stackoverflow.com/q/29910178
tags question: http://stackoverflow.com/q/29971434
tags question: http://stackoverflow.com/q/29855302
tags question: http://stackoverflow.com/q/29959509
tags question: http://stackoverflow.com/q/29901301
tags question: http://stackoverflow.com/q/29989199
tags question: http://stackoverflow.com/q/29861670
tags question: http://stackoverflow.com/q/29954028
tags question: http://stackoverflow.com/q/29924489
tags question: http://stackoverflow.com/q/29949841
tags question: http://stackoverflow.com/q/29999753
tags question: http://stackoverflow.com/q/29965209
tags question: http://stackoverflow.com/q/29874962
tags question: http://stackoverflow.com/q/29900463
tags question: http://stackoverflow.com/q/29864482
tags question: http://stackoverflow.com/q/29942098
tags question: http://stackoverflow.com/q/29963634
tags question: http://stackoverflow.com/q/29958402
tags question: http://stackoverflow.com/q/29875177
tags question: http://stackoverflow.com/q/29858641
tags question: http://stackoverflow.com/q/29987089
tags question: http://stackoverflow.com/q/29867101
tags question: http://stackoverflow.com/q/29931679
tags question: http://stackoverflow.com/q/29861164
tags question: http://stackoverflow.com/q/29898105
tags question: http://stackoverflow.com/q/29946840
tags question: http://stackoverflow.com/q/29908866
tags question: http://stackoverflow.com/q/29883678
tags question: http://stackoverflow.com/q/29918537
tags question: http://stackoverflow.com/q/29996661
tags question: http://stackoverflow.com/q/29947811
tags question: http://stackoverflow.com/q/29910823
tags question: http://stackoverflow.com/q/29877490
tags question: http://stackoverflow.com/q/29935312
tags question: http://stackoverflow.com/q/29943896
type: Tag
tags question: http://stackoverflow.com/q/29950697
tags question: http://stackoverflow.com/q/29845515
tags question: http://stackoverflow.com/q/29882964
tags question: http://stackoverflow.com/q/29933871
tags question: http://stackoverflow.com/q/29952781
tags question: http://stackoverflow.com/q/29868631
tags question: http://stackoverflow.com/q/29952249
tags question: http://stackoverflow.com/q/29949178
tags question: http://stackoverflow.com/q/29870420
tags question: http://stackoverflow.com/q/29955732
tags question: http://stackoverflow.com/q/29898361
tags question: http://stackoverflow.com/q/29945568
tags question: http://stackoverflow.com/q/29859709
tags question: http://stackoverflow.com/q/29892036
tags question: http://stackoverflow.com/q/29877665
tags question: http://stackoverflow.com/q/29881047
tags question: http://stackoverflow.com/q/29965136
tags question: http://stackoverflow.com/q/29962585

http://stackoverflow.com/q/29967424
has answer: http://stackoverflow.com/a/29967602
tagged with: angularjs
type: UnansweredQuestion
tagged with: css
has body: I have tried lots of options to auto check the radio buttons based on the angularjs value I have assigned $scope.loyaltyType = "points"; Here is my HTML code Punch Card Points % Of Purchase Reward Voucher Help me out to find if any other alternative way exist?
has title: auto check radio buttons using jstl
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/29967656
tagged with: javascript
tagged with: jquery
score: 0
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/a/29984667
has comment: http://stackoverflow.com/comment/48093285
downvote count: 0
type: Answer
has body: You could just set the X-Requested-With header and then check for this server side. Many frameworks, like JQuery, add this automatically to AJAX requests. X-Requested-With is a de-facto standard for indicating that the request is made via AJAX. You do not need a random token as it is not possible for this header to be sent cross domain without the server opting in via CORS. Therefore, setting and checking a non-standard header is a valid way to protect against CSRF. The OWASP CSRF Prevention Cheat Sheet does not mention it, however it does mention checking the Origin header. However, the logic for this is not straightforward as many browsers do not send Origin for same origin requests. Also this only works for AJAX requests. With a normal form POST it is not possible to add extra headers. Also, in the past there have been bugs with plugins like Flash that allowed any header to be set enabling an attacker to use Flash to make a cross-domain request. However, issues like these have long since been patched. If you want a token as well as part of a defence in depth strategy, you could adapt X-Requested-With to include a random token that you then check. e.g. X-Requested-With: XMLHttpRequest;0123456789ABCDEF. Then token could simply be a cookie value created just for CSRF prevention purposes (generated with a cryptographically secure algorithm and entropy source of course).
has comment: http://stackoverflow.com/comment/48093193
has comment: http://stackoverflow.com/comment/48093326
has comment: http://stackoverflow.com/comment/48094058
score: 2
upvote count: 2
has comment: http://stackoverflow.com/comment/48094091
has comment: http://stackoverflow.com/comment/48094463
has comment: http://stackoverflow.com/comment/54940801
answers question: http://stackoverflow.com/q/29962965
has comment: http://stackoverflow.com/comment/48093461
has comment: http://stackoverflow.com/comment/48093522

http://stackoverflow.com/a/29938491
has comment: http://stackoverflow.com/comment/49150459
upvote count: 8
has comment: http://stackoverflow.com/comment/47998616
has comment: http://stackoverflow.com/comment/48000063
type: AcceptedAnswer
score: 8
type: Answer
answers question: http://stackoverflow.com/q/29937114
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29937114
has body: What I usually do is set the locale as a html-tag attribute &lt;html lang="{{ app.request.locale }}"&gt; which results in &lt;html lang="EN"&gt; This is also useful for SEO, and you can always get the locale in JS by calling $('html').attr('lang');

http://stackoverflow.com/q/29954209
has comment: http://stackoverflow.com/comment/48029359
answer count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/48029317
tagged with: ajax
has comment: http://stackoverflow.com/comment/48029448
has answer: http://stackoverflow.com/a/29954412
accepted answer: http://stackoverflow.com/a/29954412
has title: Undo preventDefault on checkbox in AJAX call
linked to: http://stackoverflow.com/q/21614055
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/48029256
has body: When the user tries to check an unchecked checkbox (I do nothing if it's already checked), I prevent the checkbox from getting checked and validate it with an AJAX call. But I can't figure out how to "check" it again. I tried to use $(this).trigger('click'); but it doesn't work. I also tried moving preventDefault to the fail condition. But that made the call not work, ever. I guess because the AJAX call changes the scope. $(document).ready(function(){ $('input:checkbox').click(function(e) { if( $(this).prop('checked') &amp;&amp; $(this).val()=='on' ) { e.preventDefault(); var name = $(this).attr('name'); var pivot_attendee_program = name.split(/\]\[|\[|\]/); var data = { 'pivot' : pivot_attendee_program[0], 'attendee_id' : pivot_attendee_program[1], 'program_id' : pivot_attendee_program[2] }; //console.log(data); $.ajax({ type: "GET", url: '{{ route('ageCheck') }}', data: data, success: function(result){ console.log('success'); if(result == 'pass'){ console.log('pass'); $(this).trigger('click'); } else{ //result == 'fail' console.log('fail'); } }, error: function(result){ alert(JSON.stringify(result)); } }); //validate Age //ajax check age of attendee against program //ajax check age of attendee against program_seg } }); });
type: Question
has comment: http://stackoverflow.com/comment/48029474
tagged with: javascript
has comment: http://stackoverflow.com/comment/48029301
score: 0

http://stackoverflow.com/comment/47921022
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29886379
has text: @cody Sure. That is similar to my answer above, except you are using attaching your data to your controller instance the same as using `this.__` (which I took from your question you wanted to avoid). The only issue with your answer is that you are returning an object but using `this.__` (through a variable). You do not need to return anything, nor need that local `results` variable. Instead you should set `vm.results = []` to initialize your results to an empty array.

http://stackoverflow.com/a/29928632
upvote count: 2
type: Answer
score: 2
has body: You can access the current amount using the value attribute. function coinsEarned(){ var current = document.getElementById("Balance"); var coins = Math.floor(Math.random()*10000+1000); current.value = +current.value + coins; } document.getElementById("MyButton").onclick = coinsEarned;
has comment: http://stackoverflow.com/comment/47979267
downvote count: 0
answers question: http://stackoverflow.com/q/29928564

infinite-scroll
tag name: infinite-scroll
tags question: http://stackoverflow.com/q/29859134
type: Tag
tags question: http://stackoverflow.com/q/29926413
tags question: http://stackoverflow.com/q/29936521
tags question: http://stackoverflow.com/q/29865099
tags question: http://stackoverflow.com/q/29943258

rxjs
tags question: http://stackoverflow.com/q/29946512
tags question: http://stackoverflow.com/q/29969625
type: Tag
tag name: rxjs
tags question: http://stackoverflow.com/q/29858674

http://stackoverflow.com/comment/47827035
has text: Wouldn't the output be Vehicle, Vehicle, Car?
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/29849959

http://stackoverflow.com/comment/47842190
comment on: http://stackoverflow.com/q/29857911
score: 0
type: Comment
type: QuestionComment
has text: Hmm. interesting. I'll do some more playing around.

http://stackoverflow.com/a/29908885
score: 1
downvote count: 0
type: Answer
upvote count: 1
has body: function OrderListBy(prop) { return function (a, b) { if (a[prop] &gt; b[prop]) { return 1; } else if (a[prop] &lt; b[prop]) { return -1; } return 0; } } Call this function: Sort by name - YourArray.sort( OrderListBy("name") );
answers question: http://stackoverflow.com/q/29908744

http://stackoverflow.com/q/29922150
has answer: http://stackoverflow.com/a/29927994
answer count: 2
has body: Is there a way in Openlayers 3 to get the map that is attached to a specific html element? Something like: var map = new ol.Map({ view: new ol.View({ center: [0, 0], zoom: 1 }), layers: [ new ol.layer.Tile({ source: new ol.source.MapQuest({layer: 'osm'}) }) ], target: 'map' }); //Later on, in a different file var myMap = $("#map").ol.Map()
downvote count: 0
favorite count: 0
tagged with: openlayers
has title: Openlayers3 get map from element
score: 6
accepted answer: http://stackoverflow.com/a/29927994
upvote count: 6
type: AnsweredQuestion
type: Question
tagged with: javascript
possible better answer: http://stackoverflow.com/a/45124577
tagged with: gwt-openlayers
has answer: http://stackoverflow.com/a/45124577

http://stackoverflow.com/q/29928510
type: Question
has body: how is it going? I'm having some trouble with the visual composer for WordPress... I was testing a widget, so I inserted some HTML and JS on an element inside the VC on the Home, and Saved the Page. Everything look good on the output, but when I try to edit the page again through the Admin panel, I get errors refering to the Script previously added, and the VC does not load. So, I can't open the element to remove the Script, and I can't seem to find this content anywhere on the database (searched wp_posts), so I can do it manually. Anyone have ideas on how to possibly solve this? I reeally didn't want to overwrite my database just to fix one page. Thanks in advance.
answer count: 1
has comment: http://stackoverflow.com/comment/47980893
has comment: http://stackoverflow.com/comment/47979515
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29967571
has title: Visual Composer doesn't load after inline script was added to the page on WordPress
score: 0
type: UnansweredQuestion
tagged with: wordpress
has comment: http://stackoverflow.com/comment/47981562
tagged with: php
has comment: http://stackoverflow.com/comment/47979202

http://stackoverflow.com/comment/47999892
has text: @OddDev It looks like you have to manually define a list of all the emoticons (which is want to avoid doing), and it replaces them with images. There's nothing of use for me there.
comment on: http://stackoverflow.com/q/29935513
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/48045929
has text: @NullPoiиteя nothing because $id is not defined.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29962617

http://stackoverflow.com/comment/105234567
type: Comment
comment on: http://stackoverflow.com/a/29899898
score: 0
type: AnswerComment
has text: +new Date() + 7*24*60*60*1000 will not work when the year changes. current date 30-dec-2019 , when we add this line of code , it will not generate next year date

http://stackoverflow.com/q/29864246
answer count: 1
has comment: http://stackoverflow.com/comment/47853657
tagged with: javascript
has answer: http://stackoverflow.com/a/29864754
score: 0
tagged with: drag-and-drop
tagged with: http://stackoverflow.com/tag/html
has body: With this tutorial i made simple drag and drop web app. But I cant do it with DOM. Here is my code jsfinddle . It is not working on jsfiddle but if u download it it will. The script should be placed behind the divs. When you uncoment A it will work (not in jsfiddle). So how can i made it with DOM ?
tagged with: css
has comment: http://stackoverflow.com/comment/47853832
has comment: http://stackoverflow.com/comment/47853732
has comment: http://stackoverflow.com/comment/47853767
has comment: http://stackoverflow.com/comment/47853762
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47853781
accepted answer: http://stackoverflow.com/a/29864754
has comment: http://stackoverflow.com/comment/47853731
tagged with: dom
type: Question
linked to: http://stackoverflow.com/q/978740
has title: JS Drag and drop with DOM

http://stackoverflow.com/q/29880097
type: Question
score: -2
has body: I have this function : function getDatas() { var xmlhttp = new XMLHttpRequest(); var response = null; xmlhttp.open("POST", "getdatas.php", true); xmlhttp.onreadystatechange = function() { if(xmlhttp.readyState === 4) { if(xmlhttp.status === 200) { response = xmlhttp.responseText; return response; } else {return xmlhttp.statusText;} } }; xmlhttp.send(null); } The response is in a JSON format and correctly filled. How to return the response for another use like : var datas = getDatas(); UPDATE : After the callback I have this : function AppViewModel() { var _self = this; getDatas(function(error, result) { if(error) { alert(error); } else { _self.datas = result; console.log(_self.datas); } }); console.log(_self.datas); } The first console.log(_self.datas); works well but the second is undefined.
downvote count: 2
duplicate of: http://stackoverflow.com/q/14220321
accepted answer: http://stackoverflow.com/a/29880135
answer count: 1
tagged with: javascript
favorite count: 0
tagged with: ajax
has title: Return datas inside XMLHttpRequest.onreadystatechange
has comment: http://stackoverflow.com/comment/47884331
has answer: http://stackoverflow.com/a/29880135
linked to: http://stackoverflow.com/q/14220321
type: AnsweredQuestion
upvote count: 0
tagged with: knockout.js

http://stackoverflow.com/comment/47979851
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29928924
has text: If you drop here the code we might be a help for you.

http://stackoverflow.com/comment/75341433
score: 1
comment on: http://stackoverflow.com/a/35134901
type: AnswerComment
has text: This is accurate but you missed one important step. After you've edited the code following the breakpoint, you'll need to save it before continuing the execution. See ["Step 6: Apply a fix > Step 2"](https://developers.google.com/web/tools/chrome-devtools/javascript/#step_6_apply_a_fix).
type: Comment

http://stackoverflow.com/a/29960070
has body: I got solution for this: .margin{ margin-top:200px; } } /* keyframes definition for WebKit browsers */ @-webkit-keyframes travel { from { right: 10px; } to { right: 10px; } } @-webkit-keyframes bounce { from, to { bottom: 40px; -webkit-animation-timing-function: ease-out; } 50% { bottom: 140px; -webkit-animation-timing-function: ease-in; } } @-webkit-keyframes bounce1 { from, to { bottom: 40px; -webkit-animation-timing-function: ease-out; } 50% { bottom: 140px; z-index:9; -webkit-animation-timing-function: ease-in; } } /* keyframes definition for other browsers */ @keyframes travel { from { right: 10px; } to { right: 10px; } } @keyframes bounce { from, to { bottom: 45px; animation-timing-function: ease-out; } 50% { bottom: 140px; animation-timing-function: ease-in; } } @keyframes bounce1 { from, to { bottom: 45px; animation-timing-function: ease-out; } 50% { bottom: 140px; z-index:9; animation-timing-function: ease-in; } } /* styles for the stage and animated elements */ #traveler { position: absolute; width: 75px; height: 100px; -webkit-animation-name: travel; -webkit-animation-timing-function: linear; -webkit-animation-iteration-count: infinite; -webkit-animation-direction: alternate; -webkit-animation-duration:2.8s; animation-name: travel; animation-timing-function: linear; animation-iteration-count: infinite; animation-direction: alternate; animation-duration: 2.8s; } #bouncer { position: absolute; width: 75px; z-index:10; height: 100px; border-radius: 10px; /*background: url(../img/jump.png) no-repeat;*/ background:green; -webkit-animation-name: bounce; -webkit-animation-iteration-count: infinite; -webkit-animation-duration: 2.2s; animation-name: bounce; animation-iteration-count: infinite; animation-duration: 2.2s; } #bouncer2 { position: absolute; z-index:11; width: 75px; height: 100px; border-radius: 10px; /*background: url(../img/pyonpyon.png) no-repeat;*/ background:red; -webkit-animation-name: bounce1; -webkit-animation-iteration-count: infinite; -webkit-…
has comment: http://stackoverflow.com/comment/48041048
type: Answer
has comment: http://stackoverflow.com/comment/48040801
answers question: http://stackoverflow.com/q/29959451
score: 3
has comment: http://stackoverflow.com/comment/48041134
downvote count: 0
upvote count: 3

http://stackoverflow.com/a/29979053
downvote count: 0
type: Answer
score: 1
upvote count: 1
has body: You could move that part of code to directive so that placing only directive element there would be enough, Code will be reuse as you want. Html &lt;my-directive template-url="abc.html" click-function="refreshData()"&gt;&lt;/my-directive&gt; Directive app.directive('myDirective', function(){ return { restrict: 'AE', templateUrl: function(ele, attr){ return attr.templateUrl }, link: function(scope, element, attrs){ element.find('button').on('click', function(){ scope.$apply(function(){ scope.$eval(attrs.clickFunction()) }); }) } } }) Above directive you could pass your templateUrl name in attribute which would do the work of ng-include &amp; for click event you need to pass click event reference on clickFunction attribute. That will call on click of button.
answers question: http://stackoverflow.com/q/29978850

http://stackoverflow.com/comment/47944516
has text: You will have to sent it as a string `someFunction('025468');` then when needed parse it to a number for computation
type: Comment
type: QuestionComment
score: 8
comment on: http://stackoverflow.com/q/29911246

http://stackoverflow.com/q/29912694
upvote count: 1
tagged with: css
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29912754
accepted answer: http://stackoverflow.com/a/29912754
downvote count: 0
score: 1
has body: I got a code in JavaScript, HTML and CSS about a form having a "name" field and "value" field align horizontally, then I got a JS code that will add field. The problem starts when I add a field, the added field goes vertically, I want it to be horizontal like my first forms. Here is my code. Case Number Name Value Excellent Good Ok Poor Bad Just in case. Here is my CSS: .form-style-6{ font: 95% Arial, Helvetica, sans-serif; max-width: 600px; margin: 10px auto; padding: 16px; background: #F7F7F7; } .form-style-6 h1{ background: #43D1AF; padding: 20px 0; font-size: 140%; font-weight: 300; text-align: center; color: #fff; margin: -16px -16px 16px -16px; } .form-style-6 input[type="text"], .form-style-6 select { -webkit-transition: all 0.30s ease-in-out; -moz-transition: all 0.30s ease-in-out; -ms-transition: all 0.30s ease-in-out; -o-transition: all 0.30s ease-in-out; outline: none; box-sizing: border-box; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; width: 39%; background: #fff; margin-bottom: 4%; margin-left: 0.2%; border: 1px solid #ccc; padding: 3%; padding-left: 3%; color: #555; font: 95% Arial, Helvetica, sans-serif; float:center; } .form-style-6 input[type="text"]:focus, .form-style-6 input[type="date"]:focus, .form-style-6 input[type="datetime"]:focus, .form-style-6 input[type="email"]:focus, .form-style-6 select:focus { box-shadow: 0 0 5px #43D1AF; padding: 3%; border: 1px solid #43D1AF; } .form-style-6 input[type="submit"], .form-style-6 input[type="button"]{ box-sizing: border-box; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; width: 100%; padding: 3%; background: #43D1AF; border-bottom: 2px solid #30C29E; border-top-style: none; border-right-style: none; border-left-style: none; color: #fff; } .form-style-6 input[type="submit"]:hover, .form-style-6 input[type="button"]:hover{ background: #2EBC99; }
type: Question
answer count: 1
tagged with: javascript
favorite count: 0
has title: JavaScript align additional field

http://stackoverflow.com/comment/48013292
score: 0
comment on: http://stackoverflow.com/q/29930297
type: QuestionComment
type: Comment
has text: I found a jsfiddle that shows a basic doughnut structure and posted it

http://stackoverflow.com/comment/47891122
type: QuestionComment
has text: I dont get it...you mean like overriding the name but with the same functionality?
comment on: http://stackoverflow.com/q/29883469
score: 0
type: Comment

http://stackoverflow.com/q/29858980
answer count: 2
has answer: http://stackoverflow.com/a/29859020
downvote count: 0
possible better answer: http://stackoverflow.com/a/29859028
favorite count: 0
has answer: http://stackoverflow.com/a/29859028
accepted answer: http://stackoverflow.com/a/29859020
type: AnsweredQuestion
score: 2
upvote count: 2
has body: So I found this link that gives good explanation of how scripts are loaded: http://www.html5rocks.com/en/tutorials/speed/script-loading/ But I'm having some trouble understanding what happens if I do this: &lt;script&gt; var script = document.createElement("script"); script.src = "//www.domain.com/script.js"; document.getElementsByTagName("head")[0].appendChild(script); &lt;/script&gt; &lt;script&gt; console.log(myVar); &lt;/script&gt; script.js contains e.g. var myVar = 'foobar'; So my question is... since the script.js is appended in a separate script tag, does this guarantee that script.js will be loaded and executed before the console.log()?
type: Question
has title: javascript execution order when appended to dom
tagged with: javascript

http://stackoverflow.com/comment/48069660
type: QuestionComment
type: Comment
has text: Have you included jquery library then in your file?
comment on: http://stackoverflow.com/q/29974108
score: 0

http://stackoverflow.com/q/29973200
accepted answer: http://stackoverflow.com/a/29984825
type: Question
has title: Using signalR with a javascript timer in an MVC 5 web application Memory consumption / how to
tagged with: asp.net-mvc
tagged with: javascript
score: 0
has body: I'm using maček's answer from this post How to create a stopwatch using JavaScript? to create javascript timers in an HTML table for each tr. When someone starts the timer I would like it to be available for everyone else looking at that same tr element that may be on the page at a different computer. I'm very new to signalR and have only played with some examples. What I'd like to know is "Is this possible", if so how? And if I had 1,000 timers going would this consume a lot of server memory? The timer is not stored in a database.
linked to: http://stackoverflow.com/q/20318822
tagged with: stopwatch
answer count: 1
tagged with: timer
has answer: http://stackoverflow.com/a/29984825
type: AnsweredQuestion
tagged with: signalr

http://stackoverflow.com/q/29862115
has answer: http://stackoverflow.com/a/29863899
has title: How do I get the built in formatting for UserAccounts Meteor to work?
tagged with: atmosphere.js
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29863899
has body: I have included the UserAccounts (Semantic UI) package with the meteor app. On inserting the routes and the {{> atForm}}, this is how my front page looks. Which is very different from the examples shown here: UserAccount Page Steps taken: Deleted the entire Css Deleted and reinstalled other packages like Unstyled or boostrap But nothing works. Formatting is still the one in the picture. Can someone please help or provide advice? Let me know which codes you need to review, I'll post them on request as soon as Im able to. Thank you!
has comment: http://stackoverflow.com/comment/47851763
type: AnsweredQuestion
tagged with: meteor
tagged with: user-accounts
type: Question
score: 0
tagged with: meteor-accounts
answer count: 1

http://stackoverflow.com/a/29953614
answers question: http://stackoverflow.com/q/29943753
type: Answer
has body: The problem was in json, that was passed by ajax. You have to ensure your json is simple like: {[ {"CityId":3,"CityName":"Minsk","PostalCode":"220000"}, "CityId":4,"CityName":"Brest","PostalCode":"224000"}, "CityId":5,"CityName":"Vitebsk","PostalCode":"210000"}, "CityId":6,"CityName":"Gomel","PostalCode":"246000"} ]}
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29943753
score: 0

http://stackoverflow.com/comment/47902327
type: Comment
has text: I do not any error on console. It just does not work, does not add and remove classes. But in my IDE I get error: "Unresolved function or method () "
type: AnswerComment
comment on: http://stackoverflow.com/a/29889207
score: 0

http://stackoverflow.com/comment/47935466
score: 0
comment on: http://stackoverflow.com/q/29880274
type: Comment
type: QuestionComment
has text: I thought that I don't need to use ng-controller = "MainCtrl" in the HTML because the routing in the app.js config function handles that. Is this right?

http://stackoverflow.com/comment/47873134
type: QuestionComment
comment on: http://stackoverflow.com/q/29874148
has text: http://stackoverflow.com/a/19846600/2025923
score: 0
type: Comment

http://stackoverflow.com/comment/47957259
score: 0
type: AnswerComment
has text: I am approving the answer as it seems to be the correct one. But the little grey cells in my head still have trouble wrapping themselves around it .... :o) All I can get out of this is that splitting up the operation into several `expressions` in stead of gathering it in one `expression` seems to produce the desired result. My brain tells me that is illogical - but then again it is also totally new to Javascript ...
type: Comment
comment on: http://stackoverflow.com/a/29917732

http://stackoverflow.com/q/29904750
tagged with: javascript
has body: I'm trying to draw through on a HTML5 canvas. I managed to draw on the canvas but I need to do it dynamically. This is my JavaScript code: var c=document.getElementById("yellow"); var ctx=c.getContext("2d"); ctx.beginPath(); ctx.moveTo(247,373); ctx.lineTo(0,390); ctx.lineTo(5,21); ctx.lineTo(245,0); ctx.lineTo(247,373); ctx.closePath(); ctx.fillStyle="#ffca05"; ctx.globalAlpha=0.7; ctx.strokeStyle = '#ffca05'; ctx.fill(); ctx.stroke(); I need to read the data from this json array and draw using these coordinates. [{"x":"247", "y":"373"}, {"x":"0", "y":"390"},{"x":"5", "y":"21"},{"x":"245", "y":"0"}, {"x":"247", "y":"373"}]
linked to: http://stackoverflow.com/q/29477973
accepted answer: http://stackoverflow.com/a/29905448
answer count: 2
linked to: http://stackoverflow.com/q/500504
tagged with: html5-canvas
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/29906516
upvote count: 7
has comment: http://stackoverflow.com/comment/47932333
type: AnsweredQuestion
has title: how draw in canvas read a json?
possible better answer: http://stackoverflow.com/a/29906516
score: 7
tagged with: http://stackoverflow.com/tag/json
type: Question
has answer: http://stackoverflow.com/a/29905448

http://stackoverflow.com/comment/83585560
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29855929
has text: I've had similar issues. You should make sure there are no other events happening that will trigger layout and repaint. What happens is that the animation gets interrupted (from scrolling for example) and the event never fires. In my case I implemented a simple timeout that gets cleared if the animationend event fires. Or ... it does the same stuff that the animationend event had to do.

http://stackoverflow.com/comment/47851572
score: 0
type: Comment
type: QuestionComment
has text: @RGraham then when it is good to use angular.js because as a developer you need to debug your application again and again.Then see the error on console or add two files is not a good thing ?
comment on: http://stackoverflow.com/q/29863070

http://stackoverflow.com/q/29866647
score: 0
tagged with: canvas
answer count: 1
has title: image not following mouse on canvas
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29866894
accepted answer: http://stackoverflow.com/a/29866894
linked to: http://stackoverflow.com/q/17130395
type: Question
type: AnsweredQuestion
tagged with: javascript
has comment: http://stackoverflow.com/comment/47858190
has body: I am having trouble creating game on html canvas. The premise of the game is you have to catch the balloons before they hit the ground. I am having problems with the background of the canvas and the basket is not moving with the mouse. The background should be black and the basket should be following the mouse curser. https://jsfiddle.net/pgkL09j7/8/ Sean Coyne

http://stackoverflow.com/comment/48048447
comment on: http://stackoverflow.com/q/29964071
score: 0
type: QuestionComment
type: Comment
has text: `element.css({top: '674px', left: '1722px' })`

http://stackoverflow.com/q/29989092
has title: Two planes which very close to each other
tagged with: three.js
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29989233
type: Question
tagged with: javascript
has body: i have got a problem with 2 planes which are very close to each other. One of the planes is causing glitches or even disappearing on certain point of view. Here is the code: var renderer, scene, camera, controls, mesh; init(); animate(); function init() { renderer = new THREE.WebGLRenderer(); renderer.setSize( window.innerWidth, window.innerHeight ); document.body.appendChild( renderer.domElement ); scene = new THREE.Scene(); camera = new THREE.PerspectiveCamera( 16, window.innerWidth / window.innerHeight, 1, 50000 ); camera.position.set(8000, 4000, 13000); controls = new THREE.OrbitControls( camera ); controls.target = new THREE.Vector3(0,0,0); controls.minPolarAngle = 0 controls.maxPolarAngle = (Math.PI / 2) - 0.05; mesh = new THREE.Mesh( new THREE.PlaneBufferGeometry( 7000, 7000 ), new THREE.MeshBasicMaterial); mesh.position.y = 0; mesh.rotation.x = - Math.PI / 2; mesh.receiveShadow = true; scene.add( mesh ); mesh = new THREE.Mesh( new THREE.PlaneBufferGeometry( 2000, 2000 ), new THREE.MeshBasicMaterial({color:0x00ff00})); mesh.position.y = 5; mesh.rotation.x = - Math.PI / 2; mesh.receiveShadow = true; scene.add( mesh ); } function animate() { requestAnimationFrame( animate ); controls.update(); renderer.render( scene, camera ); } Here is the fiddle: http://jsfiddle.net/mae1storm/2hLjn1t5/1/ What can i do to fix this problem? Sorry for my bad english, Thank You.
score: 0
has answer: http://stackoverflow.com/a/29989233
answer count: 1

http://stackoverflow.com/q/29954301
type: Question
score: 12
has comment: http://stackoverflow.com/comment/48055678
upvote count: 12
downvote count: 0
has comment: http://stackoverflow.com/comment/48328367
tagged with: javascript
possible better answer: http://stackoverflow.com/a/30190530
has answer: http://stackoverflow.com/a/30223914
has comment: http://stackoverflow.com/comment/48043270
has title: Why does my OpenLayers 3 map not show in Internet Explorer 11?
has comment: http://stackoverflow.com/comment/48356565
answer count: 3
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/48316662
favorite count: 0
has comment: http://stackoverflow.com/comment/48184024
has answer: http://stackoverflow.com/a/29970480
has comment: http://stackoverflow.com/comment/48300063
has answer: http://stackoverflow.com/a/30190530
tagged with: css
type: AnsweredQuestion
tagged with: internet-explorer
has comment: http://stackoverflow.com/comment/48313634
has body: I am trying to serve up a map in Internet Explorer that works fine in Firefox or Chrome. While debugging I noticed that something was missing when I tried to bring up the map in IE. This is the html that is in Firefox with the working map: This is the html that is missing essential elements for the map: This occurs after I draw a bounding box and submit a search, the search is supposed to find and results that are in the bounding box. Then draw the whole area that each result covers. When the results are supposed to be displayed is when the map does not appear in Internet Explorer 11. A blank map-panel is still displayed but it is missing the map tiles. When you "zoom in" to the map I get this error: Unable to get property 'style' of undefined or null reference. Can anyone help me figure out why IE leaves these elements out?
has comment: http://stackoverflow.com/comment/48315233
accepted answer: http://stackoverflow.com/a/30223914
tagged with: openlayers-3

http://stackoverflow.com/a/29903943
type: Answer
accepted answer of: http://stackoverflow.com/q/29903920
answers question: http://stackoverflow.com/q/29903920
score: 3
upvote count: 3
type: AcceptedAnswer
downvote count: 0
has body: The semicolon goes at the end: done = $(this).hasClass('done') ? 1 : 0;

http://stackoverflow.com/comment/47931479
type: Comment
comment on: http://stackoverflow.com/a/29904028
score: 0
type: AnswerComment
has text: You were correct about currVolume. That is what it originally was. I'm not getting the error now... However, I'm not getting any sound in Chrome either. It does work in Safari, however.

http://stackoverflow.com/a/29875462
type: Answer
answers question: http://stackoverflow.com/q/29875298
score: 0
has body: try this: Html: Is The Best Team? Css: .badge { height: 100px; width: 100px; display: table-cell; text-align: center; vertical-align: middle; border-top-right-radius: 100%; background: red; } #anotherDiv { font-size:12px; padding-right:20%; padding-top:15%; }

http://stackoverflow.com/comment/48179561
has text: The idea is to use these vectors to rotate the orbital paths of the quads The quads are created using threejs and merged into one geometry Then Im using the quads x position to find an index to select a vector from the array
type: QuestionComment
comment on: http://stackoverflow.com/q/29989418
type: Comment
score: 0

http://stackoverflow.com/comment/47820486
has text: can you create a demo?
comment on: http://stackoverflow.com/q/29847452
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29943313
answers question: http://stackoverflow.com/q/29942554
downvote count: 0
type: Answer
upvote count: 1
has body: To have it really accurate you can use the "Date" object in Javascript. Be careful it is aware of the local timezone. The script underneath shows 17:42 instead of 15:42 if you are in GMT+2 (like me :)). var beginDate = "29/04/2015"; var beginHour = "13:32"; var dateo = new Date(beginDate.split("/").reverse().join("-") + "T" + beginHour + ":00"); var hourDuration = "2"; var minuteDuration = "10"; var enddate = new Date(dateo.getTime() + (hourDuration * 3600000) + (minuteDuration * 60000 )); alert(enddate);
score: 1

http://stackoverflow.com/comment/47880693
score: 0
type: AnswerComment
type: Comment
has text: Thanks here u go http://stackoverflow.com/questions/29876253/simple-web-spa-with-api-and-mongoose-issue-with-ids
comment on: http://stackoverflow.com/a/29863396

http://stackoverflow.com/q/29943901
type: UnansweredQuestion
has body: Using ExtJS 5.1, when I load grid panel it is showing correct paging number in paging tool. but during page load time it always show Page 1 of 5. The Previous and Next Buttons are disabled. # var store = new Ext.data.Store({ autoLoad: {params:{start: 0, limit: 5}}, pageSize: 5, remoteSort: true, model: 'TenantDetails', proxy: { type: 'ajax', enablePaging : true, url: 'http://localhost:8080/restcountries-dev/rest/page/v0.5/tenant', reader: new Ext.data.JsonReader({ type: 'json' , totalProperty:15, rootProperty:'tenant' }) }, listeners:{ load:function(store){ Ext.getCmp('tenant_detail_grid').getSelectionModel().select(0, true); } } }); # And Paging toolbar is defined as below. bbar: Ext.create('Ext.PagingToolbar', { store: store, displayInfo: true, displayMsg: '{0} - {1} of {2}', emptyMsg: "No topics to display" }) # Don't know what exactly I'm missing.Thanks
type: Question
tagged with: datagridview
answer count: 1
tagged with: javascript
tagged with: extjs
score: 0
tagged with: extjs5
has title: ExtJs 5.1 paging tool bar in grid panel
has answer: http://stackoverflow.com/a/29947725

http://stackoverflow.com/a/29864218
answers question: http://stackoverflow.com/q/29864089
type: Answer
score: 0
has body: Do not use $(".intro_lg").fadeOut use $(this).fadeOut because ".intro_lg" is class and can be on another html elements. And better way for this is not replace image "src", but hide and show images(exists in dom), because image loading by browser is take time. for example html: &lt;img src="path1" class="intro_lg" alt=""/&gt; &lt;img src="path2" class="intro_lg" alt="" style="display: none;"/&gt; Script: $(".intro_lg").click(function() { $(this).fadeOut(1000, function() { $(".intro_lg").next().fadeIn(1000); }); return false; });

http://stackoverflow.com/comment/48502152
has text: Yes it should be possible. Check the new code, it may be easier to edit. I'll give you some help tomorrow if you didn't find. (I think you should make a loop which calls getbase64URI, and then the callback to drawVisual...)
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/30135485
type: Comment

http://stackoverflow.com/a/29967857
downvote count: 0
has body: @Sourabh- thank you for ur help, this is the solution: .factory('eliteApi', function() { var leagues1 = JSON.stringify({"name": "Spring Fling Tournament 2014","id": 2009,"homeScreen": "* 5th Grade Championship - 7:30m MAC 3\n* 6th Grade Championship - 6:30pm MAC 4\n* 7th Grade White Championship - 7:30pm MAC 4\n* 7th Grade Green Championship - 7:30pm MAC 2\n* 8th Grade Championship - 7:30pm MAC 1\n* 9th Grade Championship - 8:30pm MAC 4\n* 10th Grade Championship - 8:30pm MAC 1\n* 11th Grade Championship - 8:30pm MAC 3","rulesScreen": null}); var leagues = JSON.parse(leagues1); return { getLeagues : function getLeagues(){ return leagues; } }; }) .controller('LeaguesCtrl', [ '$scope','eliteApi', function($scope, eliteApi) { var leagues = eliteApi.getLeagues(); var leagueData = eliteApi.getLeaguesData(); })
type: Answer
answers question: http://stackoverflow.com/q/29965608
score: 1
upvote count: 1

http://stackoverflow.com/q/29984114
possible better answer: http://stackoverflow.com/a/35437573
has answer: http://stackoverflow.com/a/35437573
accepted answer: http://stackoverflow.com/a/30185850
type: Question
answer count: 2
tagged with: pusher
downvote count: 0
tagged with: websocket
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/48091131
score: 3
has answer: http://stackoverflow.com/a/30185850
has title: Error when setting the Pusher cluster to 'eu'
has comment: http://stackoverflow.com/comment/48092736
upvote count: 3
has body: I'm using the Pusher Javascript library to create a realtime webapp. Everything works like a charm, however when I set the cluster parameter to eu (my users will be connecting from France only), I get an error. This is the code I use: var pusher = new Pusher('&lt;thisismykey&gt;', { encrypted: true, authEndpoint: '{{ baseUrl() }}/pusher_auth', cluster: 'eu' // This }); And this is the error I get: { "type": "WebSocketError", "error": { "type": "PusherError", "data": { "code": 4001, "message": "Could not find app by key &lt;thisismykey&gt;. Perhaps you're connecting to the wrong cluster." } } } Am I allowed to use this parameter? Or is there a thing to do in my Pusher dashboard? The Pusher docs are not quite clear about this.
type: AnsweredQuestion

http://stackoverflow.com/q/29947027
upvote count: 1
has comment: http://stackoverflow.com/comment/48015407
has answer: http://stackoverflow.com/a/29947147
type: AnsweredQuestion
has title: Why won't my Javascript popup work anymore?
accepted answer: http://stackoverflow.com/a/29947147
downvote count: 10
type: Question
score: -9
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/48015100
has comment: http://stackoverflow.com/comment/48015065
answer count: 1
favorite count: 0
has body: Afternoon, I've made a few modifications to the product pages on my website, at some point the popup that confirms a product has been added to the shopping basket has stopped working and I'm unclear as to why... Original Page: http://www.dibor.co.uk/Product.asp?ProductId=Y646&amp;title=gentlemenand New Page: http://www.dibor.co.uk/Product2.asp?ProductId=Y646&amp;title=gentlemenand You will see when you click 'add to cart' that on the original page, the popup appears. I'm stumped and I look forward to hearing from you. Kind Regards, Shaun
has comment: http://stackoverflow.com/comment/48015124
has comment: http://stackoverflow.com/comment/48017117

http://stackoverflow.com/comment/48392133
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29986657
has text: Without sessionStorage, localStorage, or cookies. You're really going to need a server-side solution.

http://stackoverflow.com/q/29949691
score: 2
answer count: 0
upvote count: 2
has comment: http://stackoverflow.com/comment/48020889
type: UnansweredQuestion
duplicate of: http://stackoverflow.com/q/3434278
has comment: http://stackoverflow.com/comment/48020647
has comment: http://stackoverflow.com/comment/48021162
type: Question
tagged with: javascript
has title: Is it OK to use SomeID.attribute instead of getElementById("SomeID")
tagged with: getelementbyid
downvote count: 0
has comment: http://stackoverflow.com/comment/48025483
has body: I know using something like document.getElementById("img1").attribute is an standard way to access to elements, but what about img1.attribute? Is it OK to use it? Few years ago I used to use NameValue.attribute (I mean when I had an element like this &lt;input name="NameValue"&gt;) to get and set elements attributes but today I tested it on FF and it didn't work. So I tested IdValue.attribute on IE, FF and Chrome and it worked.
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/48020904
linked to: http://stackoverflow.com/q/3434278

jasmine
tags question: http://stackoverflow.com/q/29923888
tag name: jasmine
tags question: http://stackoverflow.com/q/29913964
tags question: http://stackoverflow.com/q/29928856
tags question: http://stackoverflow.com/q/29953089
tags question: http://stackoverflow.com/q/29963365
tags question: http://stackoverflow.com/q/29998663
tags question: http://stackoverflow.com/q/29904768
tags question: http://stackoverflow.com/q/29895277
tags question: http://stackoverflow.com/q/29870127
tags question: http://stackoverflow.com/q/29906540
tags question: http://stackoverflow.com/q/29865717
tags question: http://stackoverflow.com/q/29925337
tags question: http://stackoverflow.com/q/29921882
tags question: http://stackoverflow.com/q/29972211
tags question: http://stackoverflow.com/q/29977836
type: Tag
tags question: http://stackoverflow.com/q/29961420
tags question: http://stackoverflow.com/q/29897856
tags question: http://stackoverflow.com/q/29857911
tags question: http://stackoverflow.com/q/29952833
tags question: http://stackoverflow.com/q/29942491
tags question: http://stackoverflow.com/q/29994396
tags question: http://stackoverflow.com/q/29846206

http://stackoverflow.com/comment/47821911
score: 0
has text: "Is giving me errors" is not a good description.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29845765

http://stackoverflow.com/a/29979286
type: Answer
has body: I think the simplest way is considering only the top-left quadrant, and fill the others by symmetry: var arr = Array(n); for(var i=0; i&lt;n/2; ++i) { arr[ i ] = new Array(n); arr[n-1-i] = new Array(n); for(var j=0; j&lt;n/2; ++j) arr[ i ][j] = arr[ i ][n-1-j] = arr[n-1-i][j] = arr[n-1-i][n-1-j] = + !(Math.min(i,j) % 2); } function fillArray(n) { var arr = Array(n); for(var i=0; i&lt;n/2; ++i) { arr[ i ] = new Array(n); arr[n-1-i] = new Array(n); for(var j=0; j&lt;n/2; ++j) arr[ i ][j] = arr[ i ][n-1-j] = arr[n-1-i][j] = arr[n-1-i][n-1-j] = + !(Math.min(i,j) % 2); } var table = document.createElement('table'); for(var i=0; i&lt;n; ++i) { var row = table.insertRow(); for(var j=0; j&lt;n; ++j) row.insertCell().textContent = arr[i][j]; } return table; } document.body.appendChild(fillArray(9)); td { width: .8em; height: .8em; line-height: .8em; }
answers question: http://stackoverflow.com/q/29978793
upvote count: 5
accepted answer of: http://stackoverflow.com/q/29978793
score: 5
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/47841405
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29857262
has text: @tymeJV Sorry to be a bother. I tried it but it's still not working. This is what I wrote `$(document).ready ( function () { $("#<% =tb.ClientID%>").keydown ( function () { debugger; alert("hello"); } ); } );`
type: AnswerComment

http://stackoverflow.com/comment/47825204
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/29848855
type: Comment
has text: Hmm, I'm not sure I get what you're saying

http://stackoverflow.com/a/30006302
upvote count: 3
answers question: http://stackoverflow.com/q/29994139
score: 3
has body: Here's a working fiddle: http://jsfiddle.net/yz87b53d/3/ You should accept meetamit's answer since that essentially was the issue. movingAverageLine(data.map(function(d) { return d.y; }))
has comment: http://stackoverflow.com/comment/48131149
has comment: http://stackoverflow.com/comment/48131847
has comment: http://stackoverflow.com/comment/48132213
downvote count: 0
has comment: http://stackoverflow.com/comment/48132069
type: Answer

http://stackoverflow.com/comment/48071680
score: 0
type: Comment
type: QuestionComment
has text: regular expressions? http://www.w3schools.com/jsref/jsref_obj_regexp.asp
comment on: http://stackoverflow.com/q/29975926

http://stackoverflow.com/q/29847941
type: Question
tagged with: javascript
score: 2
tagged with: html5-canvas
answer count: 1
downvote count: 0
has body: I'm working on HTML5/js Canvas project which is about Designing Online Stamps.I have to design a stamp in Circle which consists top Circular Text and Bottom Circular Text and center of them one image..(You can refer ScreenShot).for both Texts i have set 2 different Text boxes.But I'm not getting desired output texts are overlapping Each other.please correct me where I went wrong..I'm attaching screenshots. &lt;canvas id="canvas1" width="600" height="400"&gt;&lt;/canvas&gt; Text-top: &lt;input type="text" id="text_cnv" size="40" maxlength="" /&gt; Text-bottom: &lt;input type="text" id="text_cnv2" size="40" maxlength="" /&gt; &lt;script&gt; var ctx = document.getElementById('canvas1').getContext('2d'); var r = 99; var space = Math.PI / 12; ctx.font = "bold 30px Courier"; document.getElementById('text_cnv').onkeyup = function() { textCircle(this.value,150,150,r,space,1); } document.getElementById('text_cnv2').onkeyup = function() { textCircle(this.value,150,150,r,space); } function textCircle(text,x,y,radius,space,top){ space = space || 0; var numRadsPerLetter = (Math.PI - space * 2) / text.length; ctx.save(); ctx.translate(x,y); var k = (top) ? 1 : -1; ctx.rotate(-k * ((Math.PI - numRadsPerLetter) / 2 - space)); for(var i=0;i&lt;text.length;i++){ ctx.save(); ctx.rotate(k*i*(numRadsPerLetter)); ctx.textAlign = "left"; ctx.textBaseline = (!top) ? "top" : "bottom"; ctx.fillText(text[i],0,-k*(radius)); ctx.restore(); } ctx.restore(); } ctx.beginPath(); ctx.arc(150, 150, r, 0, Math.PI * 2, false); ctx.closePath(); ctx.fillStyle = "blue"; &lt;/script&gt; &lt;/body&gt;
favorite count: 0
upvote count: 2
has title: HTML5/ Javascript Canvas stamp design project
tagged with: php
tagged with: css
has answer: http://stackoverflow.com/a/29849089
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29849089

http://stackoverflow.com/comment/64983364
type: AnswerComment
comment on: http://stackoverflow.com/a/29981486
type: Comment
has text: What about a slide mechanism for sliding out an UNMOUNTED component, while sliding in a new MOUNTED component? I can't seem to get this to work w/o trickery.
score: 0

http://stackoverflow.com/comment/48124047
score: 0
comment on: http://stackoverflow.com/a/29965238
type: AnswerComment
has text: Thanks Jaagup! Will test it tomorrow and let you know of the result!
type: Comment

http://stackoverflow.com/comment/47938994
type: QuestionComment
has text: To post code, indent by 4 spaces (or use the {} button), don't use the \` character. Ah, Barmar has done it for you.
comment on: http://stackoverflow.com/q/29908282
score: 0
type: Comment

http://stackoverflow.com/q/29871362
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/47867789
score: 0
has comment: http://stackoverflow.com/comment/47869112
has body: I'm trying to refactor some animation code into a class object so it can then be instantiated. The original code was just a file with some functions and variables, and it called the variables from the functions, which is turning out to be a little bit of a problem since one of the things the code had was a constructor to populate an array. I'm a little confused at how to put this aspect into the new class constructor function, since this mini class Particle has a method of its own called .use that has some ctx variables inside that. But how do they point to the ctx information thats contained in the rest of the function since all that is in another scope area? I tried adding the .use method with a prototype like DrawSlinky.prototype.Particle.use and when it gets to the point where it should call this function, it says that it isn't a function, so I imagine that that didn't work. Here's the code as it is right now, with the error following : DrawSlinky.prototype.Particle = function(x, y, color, area, velocity, rad){ this.x = x; this.y = y; this.vx = Math.cos(rad) * velocity; this.vy = Math.sin(rad) * velocity; this.color = color; this.area = area; this.use = function(){ this.x += this.vx *= .99; this.y += this.vy *= .99; this.ctx.fillStyle = ctx.shadowColor = this.color; this.ctx.shadowBlur = this.area; this.ctx.beginPath(); this.ctx.arc(this.x, this.y, this.area/2, 0, Math.PI*2); this.ctx.fill(); } }; This is giving me an error that the ctx property is not defined. How do I work around this and access the ctx information in the rest of the object outside of the .Particle mini constructor?
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47868405
has comment: http://stackoverflow.com/comment/47869508
type: Question
tagged with: object
has answer: http://stackoverflow.com/a/29872266
tagged with: refactoring
has comment: http://stackoverflow.com/comment/47869083
has comment: http://stackoverflow.com/comment/47868386
has title: Trying to refactor an animation into a class object, how to construct its interrelating parts

http://stackoverflow.com/a/29914433
answers question: http://stackoverflow.com/q/29914362
upvote count: 5
has body: Your e is undefined inside $("#faqOne").click(function(){ showFaqOne.showClickedFaq(e); }); Change it to $("#faqOne").click(function(e){//Now e is there showFaqOne.showClickedFaq(e); });
type: Answer
downvote count: 0
score: 5

http://stackoverflow.com/comment/47971346
comment on: http://stackoverflow.com/a/29923852
type: Comment
has text: both. click the link then hit enter. and focus the link hit enter on the link then hit enter on the input
score: 0
type: AnswerComment

http://stackoverflow.com/comment/48131567
score: 0
type: Comment
comment on: http://stackoverflow.com/a/30002875
type: AnswerComment
has text: @ScottinTexas You can do this in many ways, but I can't help you until you post the code of the controller and the model. I need to know what your data types are and how you want to interpret the values sent to the controller.

http://stackoverflow.com/a/29889521
accepted answer of: http://stackoverflow.com/q/29886234
score: 4
has body: CasperJS is built on top of PhantomJS which has two contexts. The page context (casper.evaluate()) is sandboxed. It is the only way to access the DOM, you need to use it. var name = casper.evaluate(function(){ return document.getElementById('Boundless').children[0].children[2].children[0].children[1].children[0].innerHTML; }); casper.echo(name); Everything that you want to use inside of it, you have to explicitly pass in. It has no access to variables defined outside. The PhantomJS documentation also has something important to say: Note: The arguments and the return value to the evaluate function must be a simple primitive object. The rule of thumb: if it can be serialized via JSON, then it is fine. Closures, functions, DOM nodes, etc. will not work!
answers question: http://stackoverflow.com/q/29886234
type: AcceptedAnswer
type: Answer
upvote count: 4
downvote count: 0

http://stackoverflow.com/a/47098271
has comment: http://stackoverflow.com/comment/98686822
type: Answer
downvote count: 0
score: 3
has comment: http://stackoverflow.com/comment/98718070
has body: Ideal solution is to move date picker popup div inside modal dialog. $("#dialog-form").dialog({ modal: true, width: 500, height: 500 }); $("#datepicker").datepicker({ changeMonth: true, changeYear: true, beforeShow: function(el, dp) { $(el).parent().append($('#ui-datepicker-div')); $('#ui-datepicker-div').hide(); } } }); Note: Will have to update css a bit. Check jsfiddle link for actual demo. JsFiddle: http://jsfiddle.net/469zV/414/
upvote count: 3
has comment: http://stackoverflow.com/comment/98717965
answers question: http://stackoverflow.com/q/29887850
has comment: http://stackoverflow.com/comment/98690379

http://stackoverflow.com/a/29923972
upvote count: 1
has comment: http://stackoverflow.com/comment/48006070
score: 1
type: AcceptedAnswer
downvote count: 0
has body: You can export the stage as an image: var stageImage = myStage.toImage(); If you need to export less than all layers on the stage, you need to flatten all the desired layers into a single canvas. Create an in-memory canvas using document.createElement and set the new canvas element's size to be the same as the stage. All KineticJS layers are actually canvas elements. Draw each layer onto the in-memory canvas. You can get a reference to each layer's canvas with var layer1Canvas=layer.getCanvas() and then draw that canvas to the in-memory canvas using context.drawImage(layer1Canvas,0,0) [and the same with layer2]. At this point your 2 layers have been flattened onto a single canvas that can be exported using inMemoryCanvas.toDataURL.
accepted answer of: http://stackoverflow.com/q/29919222
type: Answer
answers question: http://stackoverflow.com/q/29919222

http://stackoverflow.com/a/29961383
has body: &lt;script&gt; var result_string = '&lt;?php echo $result_string; ?&gt;'; var newpara = document.createElement("p"); var add_footer = document.createTextNode(result_string); newpara.appendChild(add_footer); var getFooter = document.getElementsByTagName('footer'); alert(getFooter); getFooter.innerHTML = "&lt;p&gt;" + result_string + "&lt;/p&gt;"; // $("#getFooter").append(newpara); &lt;/script&gt;
type: Answer
score: 0
answers question: http://stackoverflow.com/q/29961289

http://stackoverflow.com/comment/48098242
type: Comment
comment on: http://stackoverflow.com/a/29989432
type: AnswerComment
has text: While using `id` instead of `name` is definitely more common and standard approach, that's not really the issue at hand.
score: 0

http://stackoverflow.com/comment/48043431
comment on: http://stackoverflow.com/q/29961050
has text: Oh, thank you. But I've mentioned FB.ui only for example — I'm not using Facebook JS SDK on my web page.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47934208
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29877874
has text: So call getPosition() on the marker object and then call the function?

http://stackoverflow.com/comment/48032723
comment on: http://stackoverflow.com/a/29955878
score: 0
type: Comment
type: AnswerComment
has text: Good idea. I'll add a bit more detail. =)

http://stackoverflow.com/q/29938657
answer count: 4
has answer: http://stackoverflow.com/a/29939079
has title: Strange .replace() behaviour in Chrome browser
upvote count: 7
has comment: http://stackoverflow.com/comment/47998787
has body: &lt;div&gt; &lt;input type="text" class="allownumericwithdecimal"/&gt;saadad &lt;/div&gt; $(".allownumericwithdecimal").live("keypress keyup ", function (event) { $(this).val($(this).val().replace(/[^0-9\.]/g, '')); var text = $(this).val(); if (!((event.which &gt;= 48 &amp;&amp; event.which &lt;= 57) || event.which == 8 || event.which == 46 || event.which == 110 || event.which == 0)) { var text = $(this).val(); if ((text.indexOf('.') != -1) &amp;&amp; (text.substring(text.indexOf('.'), text.indexOf('.').length).length &gt; 2)) { //event.preventDefault(); } } var text = $(this).val(); if ((event.which &gt;= 48 &amp;&amp; event.which &lt;= 57) &amp;&amp; (text.indexOf('.') != -1)) { if ((text.substring(text.indexOf('.'), text.indexOf('.').length).length) &gt; 2) { //event.preventDefault(); } if (event.which == 190) { //event.preventDefault(); } } if (text.indexOf('.') != -1 &amp;&amp; event.which == 190) { if (text.match("^[0-9]+(\.[0-9]{0,2})?$")) {} else { $(this).val(''); } } if (text.indexOf('.') == -1 &amp;&amp; text.length &gt; 7 &amp;&amp; (event.which != 190 &amp;&amp; event.which != 8 &amp;&amp; event.which != 46 &amp;&amp; event.which != 110 &amp;&amp; event.which != 0)) { event.preventDefault(); } }); http://jsfiddle.net/Lx9h2smh/ The problem is If I type a value in textBox say 3434 and now I want to make it 35434 by putting cursor after 3 and pressing 5, it works fine in Firefox and IE but in chrome the 5 get added after value and it becomes 34345. The culprit line is one which replace non numeric characters. How to handle this issue??
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/48004355
has comment: http://stackoverflow.com/comment/48003619
score: 7
has answer: http://stackoverflow.com/a/29938900
accepted answer: http://stackoverflow.com/a/29938900
has answer: http://stackoverflow.com/a/29939564
tagged with: replace
type: Question
has comment: http://stackoverflow.com/comment/47998730
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/29938845
possible better answer: http://stackoverflow.com/a/29939564

http://stackoverflow.com/a/29858126
type: Answer
has comment: http://stackoverflow.com/comment/47844043
upvote count: 6
has comment: http://stackoverflow.com/comment/47842318
downvote count: 1
score: 5
has comment: http://stackoverflow.com/comment/47842252
answers question: http://stackoverflow.com/q/29858041
has body: Yes, it is possible: - var page = window.location.pathname if page === "/about" link(rel='stylesheet', href='css/about.css') else link(rel='stylesheet', href='css/main.css') Please note that above snippet assumes the template is executed in browser environment. If this is not the case, you can get the pathname using the language that you are using and pass it to the template as a datum. As an example, if you are using the Express framework, path property of the request object returns the path part of the URL.
has comment: http://stackoverflow.com/comment/47843906

http://stackoverflow.com/a/29977641
type: Answer
score: 0
answers question: http://stackoverflow.com/q/29977128
has body: youll want a function lke this for the animating simulataneously $(function () { $("#first").animate({ //youre animation here in the format of width: '600px' }, { duration: 200, queue: false }); $("#second").animate({ //if you want you can change several attributes at once such as width: '600px', height: '600px' }, { duration: 200, queue: false }); }); and then you will to set the width of the div or span that your using as a container to a percentage, with css. so it will auto resize try 90% and play around with it. of course from what you said you will want to change the actual animation parameters to make the first Dom move up and the second Dom to move down.... that should be pretty simple... so i hoope this helps!

http://stackoverflow.com/a/30154137
has comment: http://stackoverflow.com/comment/96069967
has comment: http://stackoverflow.com/comment/92337649
answers question: http://stackoverflow.com/q/29907536
upvote count: 97
score: 96
type: Answer
has comment: http://stackoverflow.com/comment/100278436
has body: The threejs rotation uses Radians (as you might know) you can use this mesh.rotation.x = Math.PI / 2; or mesh.rotation.set(new THREE.Vector3( 0, 0, Math.PI / 2));
downvote count: 1

http://stackoverflow.com/comment/47935176
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/29906058
has text: Quotes are a good practice when using non-standard identifiers. It helps distinguish from array indices or other possible points of confusion. I'd also recommend accessing it as extensions["28"] in most cases to again prevent issues. You are correct though, in the case of numbers it isn't strictly required.
type: Comment

http://stackoverflow.com/a/29870366
has body: The following code should be easy to understand - it basically queries the DOM for the first dropdown list's select element and the second dropdown lists' options elements. It attaches an event handler to the onchange event of the first select, so that whenever its value changes, the handler function is called to check all the options on the second select against the selected value. If the value matches, it sets a disabled attribute on the option, otherwise if the option has a disabled attribute (from a previous selection), it removes it. You can add this to your page before the closing body tag, changing secondSelect to the name of your second dropdown. &lt;script&gt; var select1 = document.querySelector('select[name="anfang"]'), secondList= document.querySelectorAll('select[name="secondSelect"] option'); select1.onchange = function(){ var selected = this.value; for(var i=0;i&lt;secondList.length;i++){ if(secondList[i].value==selected) secondList[i].setAttribute('disabled',true); else if(secondList[i].getAttribute('disabled')) secondList[i].removeAttribute('disabled'); } } &lt;/script&gt; If you would like to hide the element altogether (instead of disabling it), you can to use the style attribute instead of disabled: &lt;script&gt; var select1 = document.querySelector('select[name="anfang"]'), secondList= document.querySelectorAll('select[name="secondSelect"] option'); select1.onchange = function(){ var selected = this.value; for(var i=0;i&lt;secondList.length;i++){ if(secondList[i].value==selected) secondList[i].style.display = "none"; else if(secondList[i].style.display == "none") secondList[i].removeAttribute('style'); } } &lt;/script&gt;
has comment: http://stackoverflow.com/comment/47865985
accepted answer of: http://stackoverflow.com/q/29870230
answers question: http://stackoverflow.com/q/29870230
type: Answer
has comment: http://stackoverflow.com/comment/47866126
downvote count: 0
has comment: http://stackoverflow.com/comment/47865997
score: 2
has comment: http://stackoverflow.com/comment/47866176
has comment: http://stackoverflow.com/comment/47866301
upvote count: 2
has comment: http://stackoverflow.com/comment/47866255
type: AcceptedAnswer

http://stackoverflow.com/comment/47905340
score: 1
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29889481
has text: @TheDarkKnight: If you can't control the content of the sites you're trying to look at, I don't think there's a purely client-side solution. You'll have to have a server somewhere that you query, which can in turn query the hosts you're testing (since server-side code won't run up against the Same Origin Policy).

http://stackoverflow.com/q/29980442
tagged with: ajax
has title: Showing a dialogue after file has been uploaded (Ajax/PHP/Javascript)
tagged with: php
has comment: http://stackoverflow.com/comment/48080651
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29980577
has comment: http://stackoverflow.com/comment/48080470
type: Question
has comment: http://stackoverflow.com/comment/48080534
has body: So I am using Javascript with AJAX to send form data to a PHP file. Once it's done uploading the file to the server, I want a dialogue box to appear to say it's successful, then it reloads. I have that dialogue box done, but it will appear even if there's an error. I though creating a flag would solve this, but it doesn't. I need to wait for the progress to be 100% complete, so I put the code in the progress function. Here's my code: function uploadImage(){ var done = false; var xr = new XMLHttpRequest(); xr.upload.addEventListener("progress", progressHandler, false); xr.addEventListener("error", errorHandler, false); xr.addEventListener("abort", abortHandler, false); xr.open("POST", "php/uploadImage.php", true); xr.onreadystatechange = function(){ if(xr.readyState == 4 &amp;&amp; xr.status == 200){ var response = xr.responseText; if(response=="success"){ done=true; }else{ _("errorMessage").innerHTML = response; } } } xr.send(formdata); function progressHandler(event){ var percent = (event.loaded / event.total) * 100; _("imageUploadBar").style.width = Math.round(percent) + "%"; if((percent == 100) &amp;&amp; (done)){ completeHandler(); } } function completeHandler(){ bootbox.dialog({ message: "Image upload is completed.", title: "Upload Success", buttons: { success: { label: "Continue", className: "btn btn-success", callback: function() { location.reload(); } } } }); } } So you can see that if the upload file return success, set done to be true, and if percent is 100, then fire, but this will not fire the completeHandler() function. Any ideas why or how to get around this?
has comment: http://stackoverflow.com/comment/48080702
accepted answer: http://stackoverflow.com/a/29980577
score: 0
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/48080587
has comment: http://stackoverflow.com/comment/48081091

http://stackoverflow.com/comment/47841307
has text: Is user a Parse.User object?...
comment on: http://stackoverflow.com/q/29855241
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47907594
has text: It's all good, I forgot the return on my $q.all. I feel silly now. Is what I have done the correct way of doing it? I probably shouldn't be returning promises all the way through my architecture? But if I didn't do that how could I wrap multiple calls in a $q.all - do they have to be promises?
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29892038

http://stackoverflow.com/comment/47876911
type: QuestionComment
has text: no, i download the source code and tried to get the dependencies manually, without node and bower
score: 1
comment on: http://stackoverflow.com/q/29876023
type: Comment

http://stackoverflow.com/q/29904635
has comment: http://stackoverflow.com/comment/47932430
has title: AngularJS : How to do ng-bind logic check?
tagged with: angularjs
has comment: http://stackoverflow.com/comment/47932170
has comment: http://stackoverflow.com/comment/47932518
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47932659
has comment: http://stackoverflow.com/comment/47931971
has comment: http://stackoverflow.com/comment/47932872
has comment: http://stackoverflow.com/comment/47931980
type: Question
tagged with: angularjs-ng-model
has answer: http://stackoverflow.com/a/29905263
answer count: 2
has body: I have some tweets data coming in, sometimes the database returns a different JSON object depending on the server (local, production etc). Sometimes the tweet content is in tweets[i].text and sometimes it's in tweets[i].highlights.text My current markup: {{t.text}} Is there a way to check in ng-bind if t.text exists? And if not then set the model to t.highlights.text? ng-if: Using ng-if on the div that renders the actual tweet inside the list: + @{{t.fields.user_name}} {{t.text}} {{t.highlights.text}} {{t.fields.formatted_date_difference}} ago
tagged with: javascript
possible better answer: http://stackoverflow.com/a/29905138
has answer: http://stackoverflow.com/a/29905138
score: 0
has comment: http://stackoverflow.com/comment/47932129
has comment: http://stackoverflow.com/comment/47932243
tagged with: angularjs-ng-repeat
accepted answer: http://stackoverflow.com/a/29905263
has comment: http://stackoverflow.com/comment/47932189

http://stackoverflow.com/a/38235414
answers question: http://stackoverflow.com/q/29992687
upvote count: 1
downvote count: 0
has body: how about having a container parent directive that can contain either dir1 or dir2; then dir1, dir2 and subDir will communicate through the container directive, granted when you use the set of directives you need to wrap them in the container directive but it buys you flexibility, it will let you add dir3 without modifying the structure myApp .controller('SomeCommonController', function() { this.someMethod = function(data) { // do something for updating scope variables } ... return this; }) .directive('container', function() { return { controller: 'SomeCommonController', template : '&lt;container&gt;&lt;/container&gt;', ... } }) .directive('myDir1', function() { return { require: '^container', link: function(scope, elem, attrs, parentDirectiveCtrl) { scope.someMethod = function(data) { parentDirectiveCtrl.someMethod(data); }; }, template : '&lt;sub-dir ng-repeat="sth in aList" data="sth"&gt;&lt;/sub-dir&gt;', ... } }) .directive('myDir2', function() { return { ink: function(scope, elem, attrs, parentDirectiveCtrl) { scope.someMethod = function(data) { parentDirectiveCtrl.someMethod(data); }; }, template : 'Something Different with calling &lt;sub-dir data="otherData"&gt;&lt;/sub-dir&gt;', ... } }) .directive('subDir', function() { return { scope: { data : "=" } require: '^^container', // parent directive template: '&lt;button ng-click="someMethod(data);"&gt;&lt;/button&gt;' link: function(scope, elem, attrs, parentDirectiveCtrl) { scope.someMethod = function(data) { parentDirectiveCtrl.someMethod(data); }; }, ... } })
type: Answer
score: 1

http://stackoverflow.com/a/29900860
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/29900628
downvote count: 0
has body: Similar to T.J. Crowder's answer, but using splice to do the array math: var test=['1','2','3','4','5','6','7','8','9','10','11','12','13']; function processBatchesOfFive() { var fiveItemBatch = test.splice(0, 5); // process the batch here console.log('Now processing: ' + fiveItemBatch); if(test.length){ setTimeout(processBatchesOfFive, 1000); // modify delay here } } Here it is in action: http://jsbin.com/nuneyu/1/edit?js,console Note: this version mutates the test array, so you might want to make a copy of it first.
type: Answer

http://stackoverflow.com/a/29946510
type: Answer
answers question: http://stackoverflow.com/q/29930297
has comment: http://stackoverflow.com/comment/48166522
has comment: http://stackoverflow.com/comment/48180388
has body: Change var myPie = new Chart(document.getElementById("canvas").getContext("2d")).Doughnut(pieData,{percentageInnerCutout : 80}); by var myPie = new Chart(document.getElementById("canvas").getContext("2d")).Doughnut(pieData,doughnutOptions); You can find all the available options here http://www.chartjs.org/docs/#getting-started-global-chart-configuration For you color text you can add this option var doughnutOptions= { scaleLabel: '&lt;p style="color: red"&gt;&lt;%=value%&gt;&lt;/p&gt;' } Change style="color: red" by the color you want
score: 0
has comment: http://stackoverflow.com/comment/48062988

http://stackoverflow.com/q/29987969
has answer: http://stackoverflow.com/a/29988124
downvote count: 0
tagged with: javascript
answer count: 6
has comment: http://stackoverflow.com/comment/48095865
has comment: http://stackoverflow.com/comment/48098550
linked to: http://stackoverflow.com/q/19638981
has comment: http://stackoverflow.com/comment/48095302
score: 48
has answer: http://stackoverflow.com/a/53070878
has answer: http://stackoverflow.com/a/29988202
linked to: http://stackoverflow.com/q/5505155
upvote count: 48
has answer: http://stackoverflow.com/a/29988252
favorite count: 0
possible better answer: http://stackoverflow.com/a/53070878
accepted answer: http://stackoverflow.com/a/29988202
linked to: http://stackoverflow.com/q/3755606
has comment: http://stackoverflow.com/comment/48096078
type: AnsweredQuestion
tagged with: conditional-statements
tagged with: internet-explorer
has body: I need a particular script to be triggered in Internet Explorer browsers Only! I've tried this: &lt;!--[if IE]&gt; &lt;script&gt;&lt;/script&gt; &lt;![endif]--&gt; Unfortunately this actually stops the script from being loaded. EDIT: For everyone asking why I need this: IE makes scrolling extremely jumpy when using some animations. In order to address this I need to implement a script that provides smooth scrolling to IE. I don't want to apply it to other browsers as they don't need it and this script although making the scrolling smoother also makes it a bit unnatural.
has comment: http://stackoverflow.com/comment/48095241
has comment: http://stackoverflow.com/comment/48095332
has title: How to load a script only in IE
has answer: http://stackoverflow.com/a/51836078
has answer: http://stackoverflow.com/a/29988069
linked to: http://stackoverflow.com/q/19999388
type: Question

http://stackoverflow.com/comment/48017493
score: 0
has text: @TrueBlueAussie Fixed. With instead of .
type: AnswerComment
comment on: http://stackoverflow.com/a/29947795
type: Comment

http://stackoverflow.com/a/29963046
has comment: http://stackoverflow.com/comment/48046363
has body: Is there any security (or other kind of) risk to that? There is no: as soon as you can pass it from the client and check on the server - you're fine Also, how often should I refresh the CSRF token? Do I need a new one for every request, or every few requests, or once per site-visit and day, or...? Generally you should not refresh it at all. If it's generated using cryptographically strong random number generator - you can have one per session. What important is that it was not possible to guess it, so it should not derive from any known data.
downvote count: 0
answers question: http://stackoverflow.com/q/29962965
type: Answer
upvote count: 1
score: 1

http://stackoverflow.com/comment/65168772
has text: @user1703761 It is the accepted solution because it works. Please explain what problems this will cause if it is so terrible.
type: Comment
score: 2
comment on: http://stackoverflow.com/a/32671263
type: AnswerComment

http://stackoverflow.com/comment/47992382
type: QuestionComment
comment on: http://stackoverflow.com/q/29934970
type: Comment
has text: in countries array i have names of all countries but here mentioned just few countries.
score: 0

http://stackoverflow.com/a/29972679
has comment: http://stackoverflow.com/comment/48067005
has body: Technically, the answer is no because the wrapper exists outside the scope of the ngRepeat. So it's not possible to set conditions on the wrapper based upon a property of each item. You can on the other hand still reproduce the same markup. It just requires filtering and some creative thinking. {{item}} {{item}}
answers question: http://stackoverflow.com/q/29971766
score: 0
has comment: http://stackoverflow.com/comment/48066737
has comment: http://stackoverflow.com/comment/48065302
type: Answer

http://stackoverflow.com/comment/48102449
has text: Maybe you should look into requestAnimationFrame (https://developer.mozilla.org/fr/docs/Web/API/Window/requestAnimationFrame)
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29991407
score: 0

http://stackoverflow.com/q/29974907
has body: I am trying to fill one of my table with json result from controller. I check out console.log(result); it has the data which I am passing from controller Here is my controller code Dim result As New Microsoft.VisualBasic.Collection() Do While rst.Read result.Add(New With {.batch = rst!batch_no, .expiry = rst!expiry_date, .qty = rst!bal_qty, .mrp = rst!mrp, .prchasedate = rst!purchase_date}) Loop Return Json(result, JsonRequestBehavior.AllowGet) Here is the script I am using $('#MedicineID').blur(function () { //Perform your AJAX call to the Controller Action $.ajax({ url: "@Url.Action("FillBatchTable", "MedicinePurchase")", dataType: "json", data: document.getElementById("MedicineID").value, success: function (result) { var row = ""; $.each(result, function () { row += " " + result.batch + " " + " " + result.expiry + " " + " " + result.qty + " " + " " + result.mrp + " " + " " + result.prchasedate + " "; }); $("#BatchNoDetailsBody").html(row); console.log(result); //Your success message }, error: function (result) { alert("Error" + result); //Your error message } }); }); I am getting data in my javascript console Array[1] 0: Object batch: "L14382" expiry: "/Date(1451500200000)/" mrp: 85 prchasedate: "/Date(1393353000000)/" qty: 7 And in view time I am getting my table field with an undefined value its just show me undefine in each row And another issue is I cant pass value of MedicineID to controller
score: 0
answer count: 2
possible better answer: http://stackoverflow.com/a/29975039
accepted answer: http://stackoverflow.com/a/29980496
has answer: http://stackoverflow.com/a/29975039
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json
has title: Cannot fill my html table with json result
type: Question
tagged with: asp.net-mvc
has answer: http://stackoverflow.com/a/29980496
has comment: http://stackoverflow.com/comment/48076494
tagged with: javascript

variables
tags question: http://stackoverflow.com/q/29989817
tag name: variables
tags question: http://stackoverflow.com/q/29979252
tags question: http://stackoverflow.com/q/30000492
tags question: http://stackoverflow.com/q/29995747
tags question: http://stackoverflow.com/q/29908807
tags question: http://stackoverflow.com/q/29997563
tags question: http://stackoverflow.com/q/29985304
tags question: http://stackoverflow.com/q/29967255
tags question: http://stackoverflow.com/q/29926720
type: Tag
tags question: http://stackoverflow.com/q/29885618
tags question: http://stackoverflow.com/q/29855662
tags question: http://stackoverflow.com/q/29881068

http://stackoverflow.com/a/29914028
has comment: http://stackoverflow.com/comment/47950172
has body: How accurate is IP based Geolocation? Country level (or in the US state level) is usable, beyond that it's not precise enough. I don't have specific statistics, but from experience I would guess a rate around 70% correct results for city level precision. And around 95+% correct results for countries. Can it be used for server redirection based on IP address/location? Depends on how what you wish to redirect to. If you wish to redirect to city specific pages then it's probably not a wise plan. On the other hand if you wish to redirect to different language versions of your site you're better off looking at the language request headers. Any other method to get exact zipcode of that location? The most precise results that are possible to get is using the HTML5 Geolocation, obviously that is however client side and not server side.
score: 0
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29913791
has comment: http://stackoverflow.com/comment/47950318
accepted answer of: http://stackoverflow.com/q/29913791
type: Answer

http://stackoverflow.com/q/29897194
has comment: http://stackoverflow.com/comment/47917186
has comment: http://stackoverflow.com/comment/47917463
has comment: http://stackoverflow.com/comment/47917116
has comment: http://stackoverflow.com/comment/47917277
upvote count: 3
downvote count: 3
has comment: http://stackoverflow.com/comment/47917325
has comment: http://stackoverflow.com/comment/47917508
type: Question
has comment: http://stackoverflow.com/comment/47917897
has comment: http://stackoverflow.com/comment/47917503
has body: I am using the below string and I want to return the substring with the blankspaces in javascript. How can I do this? As of now I used the normal substring function but its giving me the result after removing the blankspaces. var Sting="CREC 20140615001CREC_GLOSS 18_0000033122 GLO4265 SGLB201406152014090120140531 TESTFOREF 0000000000033122 8-1 EQTY GB 21419 ACTUALS EUR000000000462098830 8738 N C70390000501F SQTY BUY 212102 49500.00@ 9.34 8738 8738 " var x= Sting.substring(1,27) Result x= CREC 20 I don't want it like this, rather, I want my result to be x= CREC 20
tagged with: javascript
has comment: http://stackoverflow.com/comment/47917063
score: 0
answer count: 3
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29897311
favorite count: 0
has comment: http://stackoverflow.com/comment/47917099
has answer: http://stackoverflow.com/a/29897475
linked to: http://stackoverflow.com/q/6163169
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47917734
has answer: http://stackoverflow.com/a/29897603
has title: Returning a String with whitespaces

http://stackoverflow.com/q/29922850
has comment: http://stackoverflow.com/comment/47967786
tagged with: cordova
has answer: http://stackoverflow.com/a/29925720
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47986365
tagged with: camera
tagged with: http://stackoverflow.com/tag/json
type: Question
score: 0
has title: How to add image file in json using phonegap?
answer count: 1
has body: I have a problem saving an image in JSON. I can access the mobile camera using this code: var pictureSource; // picture source var destinationType; // sets the format of returned value // Wait for PhoneGap to connect with the device // document.addEventListener("deviceready",onDeviceReady,false); // PhoneGap is ready to be used! // function onDeviceReady() { pictureSource=navigator.camera.PictureSourceType; destinationType=navigator.camera.DestinationType; } function onPhotoFileSuccess(imageData) { // Get image handle console.log(JSON.stringify(imageData)); var smallImage = document.getElementById('smallImage'); smallImage.style.display = 'block'; smallImage.src = imageData; location.href = "#pageone"; } function capturePhotoWithFile() { navigator.camera.getPicture(onPhotoFileSuccess, onFail, { quality: 50, destinationType: Camera.DestinationType.FILE_URI }); } function onFail(message) { alert('Failed because: ' + message); } My problem is that I have a form with text that should take and save a picture. This is my code that adds and saves the form without the image: function Add(){ var client = JSON.stringify({ repairNum : $("#repairNum").val(), fname : $("#fname").val(), lname : $("#lname").val(), address : $("#address").val(), }); jewelryRepair.push(client); localStorage.setItem("jewelryRepair", JSON.stringify(jewelryRepair)); alert("The data was saved."); return true; } My question is, how can I insert the image file in this function add()? Thanks a lot!
tagged with: javascript

http://stackoverflow.com/q/29933945
tagged with: angularjs
tagged with: openid-connect
score: 4
answer count: 0
type: UnansweredQuestion
type: Question
has title: Angular $http.post() request sent as OPTIONS to IdentityServer v3 Token Endpoint
tagged with: post
upvote count: 4
tagged with: identityserver3
downvote count: 0
tagged with: javascript
has body: I have a sample app to Authorize using IdentityServer v3 and OpenID Connect Authorization Code Flow in client side. I can successfully get the authorization_code and the session_state but when i call the token endpoint a problem occurs. Token Endpoint responds with Invalid HTTP status code 405 Here is the code for the Angular.js config. Angular.js app.js angular.module('oidc3', ['oauth', 'ngStorage', 'base64']) .config(function ($locationProvider, $httpProvider) { $locationProvider.html5Mode(true); $httpProvider.defaults.withCredentials = true; $httpProvider.defaults.useXDomain = false; delete $httpProvider.defaults.headers.common['X-Requested-With']; $httpProvider.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded'; }); loginController angular.module('oidc3') .controller('LoginController', function ($scope, $http, $timeout, $location, $base64) { var getParamsFromUrl = function(url) { var splitted = url.split('?'); splitted = splitted[1].split('&amp;'); var params = {}; for (var i = 0; i &lt; splitted.length; i++) { var param = splitted[i].split('='); var key = param[0]; var value = param[1]; params[key] = value } return params; }; var getToken = function (url, data, header) { $http.defaults.headers.common.Authorization = header; return $http.post(url, data); }; if($location.absUrl().split('?')[1]) { $scope.params = getParamsFromUrl($location.absUrl()); var tokenEndpoint = 'https://localhost:44333/connect/token'; var client_id = 'codeclient'; var client_secret = 'secret'; var str = client_id + ':' + client_secret; var baseEncoded = $base64.encode(str); var tokenData = {}; tokenData.grant_type = 'authorization_code'; tokenData.code = $scope.params.code; tokenData.redirect_uri = 'http://localhost:8000/login.html'; var reqHeader = 'Basic ' + baseEncoded; getToken(tokenEndpoint, tokenData, reqHeader) .success(function (data, status, headers, config) { console.log(data); console.log(status); console.log(headers); console.log(config); }).error(func…
favorite count: 0

http://stackoverflow.com/a/29997044
score: 0
has comment: http://stackoverflow.com/comment/48121506
has comment: http://stackoverflow.com/comment/48120107
has comment: http://stackoverflow.com/comment/48121539
answers question: http://stackoverflow.com/q/29995748
has body: I found a solution, using the following code PHP if(isset($_GET['display']) != 'yes'){ $slider = 'block'; $aboutus = 'none'; }else{ $slider = 'none'; $aboutus = 'block'; } Then I removed the display stying from the external stylesheet for the .slideShow and .aboutus and added inline styles just for the display within the head section of the html code as follows &lt;style type="text/css"&gt; .sliderWrapper { display: &lt;?php echo $slider; ?&gt; } .aboutUs { display: &lt;?php echo $aboutus; ?&gt; }; &lt;/style&gt; Then it worked as required.
type: Answer

http://stackoverflow.com/comment/131064453
type: Comment
score: 0
type: AnswerComment
has text: `window[nameOfComponent]` is unnecessary here and can be replaced by `nameOfComponent`
comment on: http://stackoverflow.com/a/33835395

http://stackoverflow.com/comment/47954557
type: QuestionComment
comment on: http://stackoverflow.com/q/29916592
has text: @ManishShukla, No.. It's not related to my question.
score: 0
type: Comment

http://stackoverflow.com/comment/47992232
has text: When does seekToTime() get called? Chances are that the first time the HTML5 video has not loaded yet, however the second time it is pulling out of cache so its faster hence working.
type: QuestionComment
comment on: http://stackoverflow.com/q/29935042
type: Comment
score: 1

http://stackoverflow.com/comment/48012683
type: QuestionComment
comment on: http://stackoverflow.com/q/29944526
score: 0
type: Comment
has text: Yep, the problem is not within importing react but document doesn't exist cause you are not running the script on a browser as @insin said

http://stackoverflow.com/a/29897594
upvote count: 1
type: Answer
answers question: http://stackoverflow.com/q/29897176
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/47918406
has body: You code would be look like below $(document).ready(function() { var myItems; $.getJSON("../assets/data/address.json", function(data) { myItems = data.Addresses.AddressList; var ulElement = $('&lt;ul&gt;&lt;/ul&gt;') $.each(myItems, function(index, value) { $('&lt;li&gt;&lt;/li&gt;').appendTo(ulElement).text(value.HouseNumber + ' '+ value.Street + ' ' + value.Postcode); }) $('#mainDiv').append(ulElement); }); });

http://stackoverflow.com/q/29907163
type: UnansweredQuestion
has body: I'd like to access form elements via myForm.elements, and then access each element by it's name, for example, myForm.elements.month. Typescript doesn't like this b/c it doesn't know that form.elements contains a property of month. I thought, let's create an interface! So I did, (see code below), but I'm getting this typescript error: Neither type 'HTMLCollection' nor type 'FormElements' is assignable to the other Here's the code I'm working with: interface FormElements { day: HTMLInputElement; month: HTMLInputElement; year: HTMLInputElement; } class BirthdateInput { constructor(form: HTMLFormElement) { var elements: FormElements = &lt;FormElements&gt; form.elements; // error here this.day = elements.day; this.month = elements.month; this.year = elements.year; } } Any ideas on how to better cast my form.elements object so typescript won't complain?
type: Question
tagged with: typescript
tagged with: casting
has answer: http://stackoverflow.com/a/70995964
tagged with: javascript
score: 12
has title: How to work with form elements in typescript
favorite count: 0
has answer: http://stackoverflow.com/a/32202780
has answer: http://stackoverflow.com/a/29907403
answer count: 4
upvote count: 12
has answer: http://stackoverflow.com/a/29907188
downvote count: 0

http://stackoverflow.com/q/29919772
type: Question
has comment: http://stackoverflow.com/comment/47971234
has comment: http://stackoverflow.com/comment/47964317
has comment: http://stackoverflow.com/comment/47964279
has comment: http://stackoverflow.com/comment/47967819
tagged with: javascript
has comment: http://stackoverflow.com/comment/47960594
score: 6
has body: Here is a sample of my code: function QueueService() { var key = Config.get("AWS.accessKeyID"); var secret = Config.get("AWS.secretKey"); var credentials = new AWS.Credentials(key, secret, sessionToken = null); this._sqs = new Promise.promisifyAll(new AWS.SQS({apiVersion: '2012-11-05', region: "us-west-2", endpoint: "sqs.us-west-2.amazonaws.com", credentials: credentials})); } QueueService.prototype.FillBirdQueue = function(birds) { var self = this; birds.forEach(function(bird_batch) { var params = { Entries: bird_batch, QueueUrl: Config.get("AWS-Queue.Birds") }; return self._sqs.sendMessageBatchAsync(params); }); }; If I omit the var self = this; and call return this._sqs.sendMessageBatchAsync(params); I get an error because _.sqs is undefined. It would appear that this has changed and the only way around it is to save it for later using var self = this;. I feel like there's a better way of going about this, but I'm not entirely sure how to use the tools at my disposal. I'm currently using Bluebird and Lodash, both of which support binding. In the past, I've passed this by executing the following in Bluebird: somethingAsync().bind(this).then(function(result){}); I haven't been able to use this pattern because I'm not doing anything async at first. I'm only calling one promise and need to be able to access the variable I defined in my constructor to do so. I'm overlooking something..what can it be?
linked to: http://stackoverflow.com/q/22814097
has comment: http://stackoverflow.com/comment/47961648
has comment: http://stackoverflow.com/comment/47967718
favorite count: 0
tagged with: promise
duplicate of: http://stackoverflow.com/q/22814097
has title: How do I keep from losing 'this' context in a JavaScript application?
has comment: http://stackoverflow.com/comment/47961149
type: UnansweredQuestion
tagged with: lodash
tagged with: node.js
linked to: http://stackoverflow.com/q/28708216
tagged with: bluebird
answer count: 0
has comment: http://stackoverflow.com/comment/47960636
duplicate of: http://stackoverflow.com/q/28708216
upvote count: 7
downvote count: 1

http://stackoverflow.com/q/29855039
has comment: http://stackoverflow.com/comment/47836465
has comment: http://stackoverflow.com/comment/47836275
has comment: http://stackoverflow.com/comment/47836514
type: Question
has comment: http://stackoverflow.com/comment/47837031
tagged with: http://stackoverflow.com/tag/html
tagged with: carousel
has comment: http://stackoverflow.com/comment/47836343
tagged with: css
has comment: http://stackoverflow.com/comment/47836453
has comment: http://stackoverflow.com/comment/47835975
answer count: 0
score: 0
has title: Carousel with button controls
has body: I am working on this carousel. I have the carousel moving the way i want now i am trying to add some controls below it, small buttons to link with the carousel images. So whenever one is active corresponding carousel is active as well. i am not sure why it is not working.. Any help here is the code HTML jquery $(document).ready(function () { // settings var $slider = $('.slider'); var $slide = 'li'; var $transition_time = 1000; // 1 second var $time_between_slides = 4000; // 4 seconds var $btn = $('.buttons'); var $buttonanchor = 'li'; function slides() { return $slider.find($slide); } slides().fadeOut(); // set active classes slides().first().addClass('active'); slides().first().fadeIn($transition_time); //set buttons function button() { return $btn.find($buttonanchor); } button().first().removeClass('btnnotactive'); button().first().addClass('btnactive'); button().first().fadeIn($transition_time); $interval = setInterval( function () { var $i = $slider.find($slide + '.active').index(); slides().eq($i).removeClass('active'); slides().eq($i).fadeOut($transition_time); if (slides().length == $i + 1) $i = -1; // loop to start slides().eq($i + 1).fadeIn($transition_time); slides().eq($i + 1).addClass('active'); var $j = $btn.find($buttonanchor + '.btnnotactive').index(); button().eq($j).removeClass('.btnactive'); if (button().length == $j + 1) $j = -1; button().eq($j + 1).fadeIn($transition_time); button().eq($j + 1).addClass('btnnotactive'); } , $transition_time + $time_between_slides ); }); CSS #carousel { min-width: 255px; min-height: 290px; margin: 0 auto; } .slider { margin: 10px 0; width: 580px; /* Update to your slider width */ height: 250px; /* Update to your slider height */ position: relative; overflow: hidden; } .slider li { display: none; position: absolute; top: 0; left: 0; list-style: none; } .buttons { /*padding:0 0 5px 0;*/ } .buttons li { display: inline; background-image: url("http://www.iconmay.com/thumbnails/detail/3/violet%20button%20violet%20dot%2…
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/48185163

http://stackoverflow.com/a/29899997
downvote count: 0
type: Answer
has body: This is awkward, because as the answers to this question reveal, browsers do not expose the 'raw' text value of HTML5 numeric inputs, and return an empty string as the element value in the case of both invalid and null inputs. You therefore cannot reliably differentiate between non-numeric and missing values - which is ultimately what your error messaging requires. You can't even sniff for keypresses and see if users enter invalid characters that way, because you don't know if users copy/paste invalid content. In the past I have written custom bindings that create text inputs and coerce them to numbers, but these will have limitations like bringing up the wrong mobile keypad, as you acknowledge. It's disappointing, but I can't think of a solution for this problem.
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/29891655

http://stackoverflow.com/a/29937793
answers question: http://stackoverflow.com/q/29937353
type: Answer
downvote count: 0
score: 1
has body: replace your code with these Protected Sub btnOK1_Click(ByVal sender As Object, ByVal e As EventArgs) Dim alertMsg As String Dim alertScript As String alertMsg = String.Format("You Selected {0}", "My Message") alertScript = String.Format(" ", alertMsg) ScriptManager.RegisterStartupScript(Page, Page.GetType, "Alert", alertScript, False) End Sub
upvote count: 1

http://stackoverflow.com/a/56021822
answers question: http://stackoverflow.com/q/29941794
type: Answer
has body: Simple possible way i have used: Add below html tag, where you want move the leaflet controls: &lt;div id="custom-map-controls"&gt;&lt;/div&gt; JavaScript code: $(document).ready(function () { var newParent = document.getElementById('custom-map-controls'); var oldParent = document.getElementsByClassName("leaflet-top leaflet-right") while (oldParent[0].childNodes.length &gt; 0) { newParent.appendChild(oldParent[0].childNodes[0]); } });
score: 0

http://stackoverflow.com/comment/47963852
comment on: http://stackoverflow.com/q/29921270
has text: What does "it seems to not want to work" mean?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29906818
tagged with: mobile
has body: I need to open vk.com, facebook, twitter apps when user clicks on url, in case this app is installed. Otherwise, new tab should be opened with http url. Are there some ready solutions for this? I need this to work at ios, android &amp; windows devices.
tagged with: ios
tagged with: javascript
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
answer count: 1
favorite count: 0
has title: How i can make crossbrowser native-app urls with http url fallback on website?
type: UnansweredQuestion
tagged with: android
has answer: http://stackoverflow.com/a/29908052
score: 1
linked to: http://stackoverflow.com/q/13675535
type: Question

http://stackoverflow.com/q/29950085
has answer: http://stackoverflow.com/a/29950135
favorite count: 0
has comment: http://stackoverflow.com/comment/48022520
has comment: http://stackoverflow.com/comment/48023487
tagged with: angularjs
upvote count: 2
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/48021144
has comment: http://stackoverflow.com/comment/48021329
has body: I'm new to angular.js and have a simple question. I am trying to make a calculator that takes input and then adds that input value to a total. However, the scope.add function will not work. Below is my code. Any help greatly appreciated. html code: {{result}} Total Calories controller.js angular.module('calorific.controllers', []) .controller('calcCtrl', function($scope) { $scope.result = 0; $scope.reset = function() { $scope.result = 0; }; $scope.add = function(i) { $scope.result = result + i; return result; }; });
score: 2
has comment: http://stackoverflow.com/comment/48023478
has comment: http://stackoverflow.com/comment/48021568
has comment: http://stackoverflow.com/comment/48021299
has comment: http://stackoverflow.com/comment/48021355
type: Question
has comment: http://stackoverflow.com/comment/48021037
tagged with: javascript
has title: addition in angular js
answer count: 2
has comment: http://stackoverflow.com/comment/48021546
has comment: http://stackoverflow.com/comment/48022439
has answer: http://stackoverflow.com/a/29950348
downvote count: 0

http://stackoverflow.com/comment/47897238
type: QuestionComment
type: Comment
score: 0
has text: oops, very obvious, thanks
comment on: http://stackoverflow.com/q/29874075

http://stackoverflow.com/q/29907141
has body: I’m trying to trigger a complete CSS3 animation with a single click on an anchor element. My current version is working (based on lots of searching here and on Google), but it requires two clickable elements to be present. Here’s what I have so far: http://codepen.io/ProfessorSamoff/pen/rVNOdv As you’ll see, the jQuery is pretty typical: $('a.puff').click(function() { $('a.puff').addClass('active'); $(this).removeClass('active'); }); I know that I’m probably missing something pretty simple, so any help is appreciated. Thanks, Tim
type: Question
upvote count: 2
answer count: 2
has comment: http://stackoverflow.com/comment/47937481
possible better answer: http://stackoverflow.com/a/29907458
has answer: http://stackoverflow.com/a/29909971
has answer: http://stackoverflow.com/a/29907458
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: css-animations
has title: How to add and remove a class from a single element with one click…
has comment: http://stackoverflow.com/comment/47936922
has comment: http://stackoverflow.com/comment/47937251
score: 0
has comment: http://stackoverflow.com/comment/47937341
downvote count: 2
has comment: http://stackoverflow.com/comment/47937195
has comment: http://stackoverflow.com/comment/47937487
has comment: http://stackoverflow.com/comment/47936983
has comment: http://stackoverflow.com/comment/47939943
tagged with: css
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47937347
accepted answer: http://stackoverflow.com/a/29909971

http://stackoverflow.com/comment/47867581
comment on: http://stackoverflow.com/q/29871280
score: 0
type: Comment
type: QuestionComment
has text: if you need one time source for any clients .. you need to use server-side time and present it via js. Like this http://www.javascriptkit.com/script/script2/servertime.shtml

http://stackoverflow.com/comment/47820404
type: Comment
score: 1
comment on: http://stackoverflow.com/q/29847390
has text: I think you missed some code
type: QuestionComment

http://stackoverflow.com/comment/48175133
type: AnswerComment
comment on: http://stackoverflow.com/a/30014292
score: 0
type: Comment
has text: No, I will not change the Ajax-call that works perfectly fine under productive conditions. I want to change some settings in my browsers to make them accept the data from the remote server during maintaining the document on my local computer.

http://stackoverflow.com/q/29868936
upvote count: 2
score: 1
has comment: http://stackoverflow.com/comment/47863200
has answer: http://stackoverflow.com/a/29870438
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/29868974
type: AnsweredQuestion
tagged with: javascript
has comment: http://stackoverflow.com/comment/47863128
answer count: 2
tagged with: canvas
has body: I am creating a game (using HTML5 canvas) that involves catching falling apples, i know, how original! I am having trouble finding a way to make it so multiple apples fall? Here is the code in JSFiddle: https://jsfiddle.net/pgkL09j7/12/ var apple_x = 100; var apple_y = 0; var basket_x = 100; var basket_y = 100; var points = 0; var basket_img = new Image(); basket_img.src = "http://s18.postimg.org/h0oe1vj91/basket.png"; var Countable = function () {} //Background colour of canvas var c = document.getElementById("c"); var ctx = c.getContext("2d"); ctx.fillStyle = "#000"; ctx.fillRect(0, 0, 500, 500); //Here is the event listener c.addEventListener("mousemove", seenmotion, false); ////////////////////// function seenmotion(e) { //This is the code for the mouse //moving over the canvas. var bounding_box = c.getBoundingClientRect(); basket_x = (e.clientX - bounding_box.left) * (c.width / bounding_box.width) - basket_img.width / 2; basket_y = (e.clientY - bounding_box.top) * (c.height / bounding_box.height) - basket_img.height / 2; } function start_game() { setInterval(game_loop, 50); } function game_loop() { // The code above is called every 50ms and is a // frame-redraw-game-animation loop. c.width = c.width; // Below is the code that draws the objects draw_apple(apple_x, apple_y); draw_basket(basket_x, basket_y); // Below is the code that updates the balloons location apple_x++; if (apple_y &gt; c.height) { apple_y = 0; } //Here is the collision detection code if (collision(apple_x, apple_y, basket_x, basket_y)) { points -= 0.5; } //Here is the code for the point system points += 1; // and let's stick it in the top right. var integerpoints = Math.floor(points); // make it into an integer ctx.font = "bold 24px sans-serif"; ctx.fillText(integerpoints, c.width - 50, 50); } context.clearRect(0, 0, 500, 500); function collision(basket_x, basket_y, apple_x, apple_y) { if (apple_y + 85 &lt; basket_y) { return false; } if (apple_y &gt; basket_y + 91) { return false; } if (appl…
favorite count: 0
possible better answer: http://stackoverflow.com/a/29868974
tagged with: http://stackoverflow.com/tag/html
has title: How can i get the multiple apple/s to fall?
accepted answer: http://stackoverflow.com/a/29870438

http://stackoverflow.com/a/29953852
type: Answer
score: 2
upvote count: 2
has body: type="button" isn't a submit button. It's a "does nothing" button that you can hang JavaScript from. You are looking for type="submit".
answers question: http://stackoverflow.com/q/29953803
downvote count: 0

http://stackoverflow.com/q/29848997
has answer: http://stackoverflow.com/a/29850645
downvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47829522
favorite count: 0
has comment: http://stackoverflow.com/comment/47828265
has comment: http://stackoverflow.com/comment/47827945
tagged with: http://stackoverflow.com/tag/html
has title: Iframe event to parent
type: UnansweredQuestion
tagged with: iframe
score: 2
has body: So, I'd like to trigger an event in my iframe like : $('body').trigger('my_event'); And I'd like to bind this event on my main page that contains the iframe : $('iframe').find('body').bind('my_event', function() { console.log('My event !'); } But this does not work. However, I can trigger the event from my iframe to my parent body. So i've got (in my iframe) : $(top).find('body').trigger('my_event'); And in my main page : $('body').bind('my_event', function() { console.log('My event !'); } And this works well. Why ? And yes, I do know about the cross-domain policy. My main page and my iframe both are from the same domain. Thanks !
type: Question
upvote count: 2
has comment: http://stackoverflow.com/comment/47828226
has comment: http://stackoverflow.com/comment/47829067

http://stackoverflow.com/comment/48075539
score: 0
comment on: http://stackoverflow.com/q/29976671
has text: Yes I am using plupload queue
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29983730
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/48087249
has comment: http://stackoverflow.com/comment/48087374
downvote count: 0
has body: Technically there is no difference between ctrl and ctrl2. The reason why you should do what you did in ctrl and not what you did in ctrl2 is this: It is a good idea to bind the controller this to a variable so that you can reference it later. this changes meaning depending on the context you use it in. If you reference this inside a function, it refers to that function. If you want to bind something to the controller from within a function, you cannot do it using this. When we inject $scope into a controller, we use $scope as 'glue' between the controller and the view. A sort of mediator between the two. If we use controller as syntax we are dealing directly with the controller instance, and thus we must reference myCtrl.myVar instead of myVar (when it is attached to $scope). You have this code in your fiddle: Name: Name: It may seem that this code is behaving strangely, but it actually isn't. Regardless of which button you click, they both give you back 4. This is because you are instantiating the same controller two times. When angular digests the page it hits the first instantiation, assigns 3 to c.name, then it hits the second instantiation, which assigns 4 to c.name, so when you try to call up a reference to c.name it is giving you the second value.
type: Answer
answers question: http://stackoverflow.com/q/29983479

http://stackoverflow.com/comment/47954515
comment on: http://stackoverflow.com/q/29916654
score: 0
type: Comment
type: QuestionComment
has text: When you say compression what do you mean? Do you mean JS minification or servlet HTTP compression?

http://stackoverflow.com/comment/48091902
comment on: http://stackoverflow.com/a/29985888
type: Comment
score: 0
type: AnswerComment
has text: It worked. What does tagName call? And why is it in uppercase?

http://stackoverflow.com/a/29892619
has body: A common alternative to using sleep() with hardcoded time intervals is to use wait() and explicitly wait for a specific condition to be met. For example, wait for element to be visible: var EC = protractor.ExpectedConditions; var elm = element(by.css('.md-header-items-container')); browser.wait(EC.visibilityOf(elm), 4000);
answers question: http://stackoverflow.com/q/29890595
upvote count: 3
type: Answer
score: 3
has comment: http://stackoverflow.com/comment/47994350
downvote count: 0

http://stackoverflow.com/comment/47873319
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29874261
has text: Your question seems to be missing a lot of context. You're already keeping an array of connections in the `clients` array (though you need to know when they disconnect). So, use whatever logic you want to select a particular socket from the clients array and send some data over that socket.

http://stackoverflow.com/q/29963398
has body: A thought would be to have different welcome message displayed each time user visites a page, like: First visit - Welcome Second visit - Hi again Next visit and forever after - no message Can anyone tell me how would I would be able to accomplish this?
favorite count: 0
has title: Display a different sentences each time user visites a page
downvote count: 2
tagged with: php
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/48048190
type: Question
answer count: 2
upvote count: 0
score: -2
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29963683
has answer: http://stackoverflow.com/a/29963515
accepted answer: http://stackoverflow.com/a/29963683
possible better answer: http://stackoverflow.com/a/29963515
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/47953172
has text: Elements should not have same IDs. That is the reason why you can only access the first element with id equals to "a"
score: 3
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29915904

http://stackoverflow.com/q/29848617
tagged with: arrays
has comment: http://stackoverflow.com/comment/47823182
tagged with: javascript
has answer: http://stackoverflow.com/a/29848889
has body: In my case I have an array object $scope.folderfiles. I select some files from the list and I want to have the index of the selected files in the folderfiles. I've done this : for (var i=0; i &lt; $scope.selectedfiles.length; i++) { var pos = $scope.folderfiles.indexOf($scope.selectedfiles[i]); console.log(pos); } but I always get -1. When I bind selectedfiles I get the list I've selected which is included in my folderfiles array example: folderfiles: [{"id":135,"name":"dddd","mtime":1429881529000},{"id":136,"name":"qqq","mtime":1429881566000,"size":null}] selectedfiles: [{"id":135,"name":"dddd","mtime":1429881529000}] what's wrong ?
tagged with: angularjs
answer count: 3
has comment: http://stackoverflow.com/comment/47823408
has title: Search for an array elements in another array
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29848811
has answer: http://stackoverflow.com/a/29848809
possible better answer: http://stackoverflow.com/a/29848811
type: Question
accepted answer: http://stackoverflow.com/a/29848809
score: 0

http://stackoverflow.com/q/29956364
score: 1
type: Question
tagged with: javascript
tagged with: jquery
upvote count: 1
tagged with: ember.js
favorite count: 0
has body: I have a auto complete and i will like to go thru the list using the up and down key to be able to highlighted here it is a example that how I want to be able to work http://jsfiddle.net/YnpW3/2/. I created a auto complete jsbin for the purpose http://jsbin.com/xezowozutu/1/edit?html,css,js,output App.AutocompleteController = Ember.Controller.extend({ searchText: null, searchResults: function() { var searchText = this.get('searchText'); if (!searchText) { return; } var regex = new RegExp(searchText, 'i'); return ['one', 'two', 'three'].filter(function(name) { return name.match(regex); }); }.property('searchText') });
type: UnansweredQuestion
has title: How to highlight a autocomplete list using the the Up key and the Down key (Ember.js)
answer count: 0
downvote count: 0

http://stackoverflow.com/a/29871530
type: Answer
has body: There are two ways to do it: you can either try to use MouseEvent to simulate the mousedown (https://developer.mozilla.org/en/docs/Web/API/MouseEvent + check the links in the comments) or you can create an invisible div with select's options duplicated in it right under the select itself and upon a click event just make that div visible, thus emulating an open dropdown.
answers question: http://stackoverflow.com/q/29871144
score: 0

http://stackoverflow.com/comment/48686898
has text: This did help fix the issue only problem became the time delay after your help
type: Comment
score: 0
comment on: http://stackoverflow.com/a/29928621
type: AnswerComment

http://stackoverflow.com/a/29988947
type: Answer
accepted answer of: http://stackoverflow.com/q/29988900
answers question: http://stackoverflow.com/q/29988900
has comment: http://stackoverflow.com/comment/48097333
has body: Put the resize handler in the same DOM ready handler as the creation: e.g. $(document).ready(function () { var foo = new Class('value1', 'value2', 'value3', 'value4','value5','value6'); foo.method(); // RESIZE $(window).resize(function () { foo.method(); }); }); You can't use foo before it is created and a resize event handler is just as happy inside a DOM ready event handler. You either pass lots of simple parameters, or combine them into an object. var foo = new Class({ val1: 'value1', val2: 'value2', val3: 'value3', val4: 'value4', val5: 'value5', val6: 'value6' }); then your class becomes simpler: function Class(options) { this.options = options; this.method = function(){} }
has comment: http://stackoverflow.com/comment/48097368
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/48097475
score: 0
has comment: http://stackoverflow.com/comment/48097354
has comment: http://stackoverflow.com/comment/48104798
has comment: http://stackoverflow.com/comment/48097220
has comment: http://stackoverflow.com/comment/48097327

http://stackoverflow.com/comment/48101549
comment on: http://stackoverflow.com/q/29991016
score: 0
type: Comment
type: QuestionComment
has text: Is this homework? What have you tried for the iterative solution? Why are you pursuing the iterative solution if you already have a recursive solution?

http://stackoverflow.com/q/29971326
tagged with: css
score: 3
has body: I'm using a JQuery plugin called SMINT to create sticky navigation that becomes fixed to the top of the viewport when scrolling. I'm trying to leave a space before and after the navigation at the top of the page and multiple full height divs below. Using * {margin: 0; padding: 0; outline: 0; -moz-box-sizing:border-box; -webkit-box-sizing:border-box; box-sizing:border-box; } makes the divs full height (minus the sticky nav) but botches the initial navigation. (after scrolling the navigation is fine). Removing the border-box screws up the full-height. My attempt: https://jsfiddle.net/colintkelly/uxsg6mL8/ Live example: http://www.banditfish.com/black-fives/
upvote count: 3
type: Question
has answer: http://stackoverflow.com/a/29971657
tagged with: javascript
has title: Sticky navigation with full height divs
tagged with: sticky
answer count: 1
downvote count: 0
tagged with: jquery
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/29913521
has title: Is there a way to "expect" instance of certain Java class in JavaScript code?
has answer: http://stackoverflow.com/a/29913694
answer count: 4
score: 8
tagged with: casting
tagged with: javascript
type: AnsweredQuestion
downvote count: 0
has answer: http://stackoverflow.com/a/29913889
favorite count: 0
tagged with: angularjs
upvote count: 8
type: Question
has body: Assume that I have Foo.class in Java: public class Foo { public int id; public String data; } And that I have Foo "class" in JavaScript: function Foo(id, data) { this.id = id; this.data = data; } Also, assume that I have Java controller that returns instance of Foo.class as a response to a REST request. In my JavaScript (AngularJS) code the request is sent as: $http.get(url + 'bar/get-foo/') .success(function (response) { var foo = new Foo(response.id, response.data); logger.info("SUCCESS: /get-foo"); }) .error(function (error_message) { logger.error(error_message) }); And it works. But is there a way to avoid passing every property from response to Foo constructor (some sort of expecting the Foo object, or casting it into a Foo object)? I tried using Object.create(Foo, response) but I get TypeError: Property description must be an object: true Of course there's always a possibility of refactoring the JavaScript side Foo constructor into: function Foo(foo) { this.id = foo.id; this.data = foo.data; } But, that would require refactor of large portion of the codebase. Thanks for your time. I appreciate it! PS: For those who wonder why do I need this: It's not a problem with small classes like Foo, but some responses are instances of a much larger classes (with over a dozen of fields), which are not under my control. EDIT: I accepted Chichozell's answer simply because it requires the least amount of work. Robin's and jonnyknowsbest's answers also work, (and will work for pure JavaScript, unlike Chichozell's answer, which is AngularJS specific). Haven't tried Laurentiu L.'s answer, but looks like it should also work. Anyway this is A solution (not THE solution): .success(function (response) { var foo = new Foo(); angular.extend(foo, response); // angular.merge() for "deep-copy" //... } Big thanks to everyone who answered/commented/edited in this thread.
has answer: http://stackoverflow.com/a/29913908
tagged with: java
accepted answer: http://stackoverflow.com/a/29913889
has answer: http://stackoverflow.com/a/29913808
possible better answer: http://stackoverflow.com/a/29913694

angularjs-ng-model
tags question: http://stackoverflow.com/q/29904635
tag name: angularjs-ng-model
tags question: http://stackoverflow.com/q/29923286
type: Tag
tags question: http://stackoverflow.com/q/29891962
tags question: http://stackoverflow.com/q/29991873

http://stackoverflow.com/comment/47893691
has text: Awesome! Now 2/3 things draw, its just the AI that won't any Ideas on how to fix that? EDIT: I'm literally the stupidest person alive. I typed AI.y = (HEIGHT - AI.x) instead of AI.y = (HEIGHT - AI.height). Thanks for your answer!
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29884712
type: Comment

http://stackoverflow.com/comment/48005612
type: QuestionComment
comment on: http://stackoverflow.com/q/29942149
type: Comment
has text: Are you able to isolate this code into a [fiddle](http://jsfiddle.net/) please? At first glance it appears your sytnax for the function isn't correct. You're passing in a selector into the .on method when actually you should be passing in an option such as "click".
score: 0

http://stackoverflow.com/comment/47860222
has text: @AlexanderO'Mara I continued with the same variables from the block above, so `b = Object.create(a)`
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29867575

http://stackoverflow.com/comment/48003612
comment on: http://stackoverflow.com/q/29941224
type: Comment
type: QuestionComment
score: 0
has text: possible duplicate of [JavaScript: formatting number with exactly two decimals](http://stackoverflow.com/questions/1726630/javascript-formatting-number-with-exactly-two-decimals)

http://stackoverflow.com/comment/99026038
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/52685672
has text: I'm curious. Why `(this.count+(this.runAtStart ? 2 : 1)` it seems to make the first step take too long with a runAtStart = true and also seems to make first frame too long if not runAtStart = true. ?

http://stackoverflow.com/comment/48083591
comment on: http://stackoverflow.com/a/29981930
type: AnswerComment
type: Comment
has text: `var x = mod(3)(9)` is short for `var f = mod(3); var x = f(3);`.
score: 2

http://stackoverflow.com/comment/47825337
type: Comment
score: 0
has text: Yeah, Edward, i have included angular-resource.js
comment on: http://stackoverflow.com/q/29849149
type: QuestionComment

http://stackoverflow.com/q/29938041
has body: I m actually developping an application using Google Maps v3 and http://angular-ui.github.io/angular-google-maps. Actually, I have to display some polygons (and it works well) but I want to display information inside this, like how many beer bars are present here, or how many restaurant ect... In fact, I only need to display something, but I dont know how. I know how to make it with marker, but not with polygones and polylines... Can you help me ? Thanks for advance
answer count: 0
has title: Angular google map, polygones and informations inside them
upvote count: 1
type: Question
tagged with: javascript
tagged with: google-maps-api-3
linked to: http://stackoverflow.com/q/13017915
tagged with: google-maps
has comment: http://stackoverflow.com/comment/48024087
downvote count: 0
score: 1
linked to: http://stackoverflow.com/q/25930567
favorite count: 0
tagged with: angularjs
has comment: http://stackoverflow.com/comment/48075515
type: UnansweredQuestion

http://stackoverflow.com/comment/48104118
type: AnswerComment
has text: public PartialViewResult SaveUserDBPartial(string numberRoom) { var client = db.Client.Single(numberRoom); return PartialView("SaveUserDBPartial" , client); } Error(((((
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29991708

http://stackoverflow.com/comment/47947922
comment on: http://stackoverflow.com/q/29912641
has text: @JiewMeng: That simply won't happen with the code you've posted above. Something *else* is going on. Creating an [MCVE](/help/mcve) will either 1) Help you figure out what it is, or 2) Give you something you can post a question about. We can't answer the question as it is now, since the code in the question won't do that.
type: Comment
type: QuestionComment
score: 2

http://stackoverflow.com/q/29880660
tagged with: mysql-workbench
tagged with: jsp-tags
tagged with: mysql
type: Question
has body: Here is my sql code. I wanted to execute this queries through jsp: insert into student(student_name) values('sachin'); select last_insert_id(); set @a=last_insert_id(); insert into course(credits,course_name) values ('3','capstone'); select last_insert_id(); set @b=last_insert_id(); insert into faculty(faculty_name) values('bernard'); select last_insert_id(); set @c=last_insert_id(); insert into class(faculty_id,course_id,semester,day,time) values(@c,@b,'spring 2015','Friday','5.30pm'); select last_insert_id(); set @g=last_insert_id(); insert into grades(student_id,class_id,grade) values (@a,@g,'C'); insert into attendance(student_id,class_id,classes_attended,classes_missed) values (@a,@g,'25','5'); I tried to preserve the auto-incremented value of the table using this query set @a=last_insert_id(); in jsp but this is not working. I think this is not a right statement to preserve a value into a variable in jsp. Can anyone please tell me how to preserve the auto-incremented value in jsp? I'm trying to use the preserved value for another table. I got struck to here many days ago. Anyone help would be highly appreciated. Thanks in advance.
score: 0
has title: How to preserve last_insert_id() of mysql in jsp
has answer: http://stackoverflow.com/a/29883502
answer count: 1
tagged with: jsp
tagged with: javascript
type: UnansweredQuestion

http://stackoverflow.com/q/29947450
has title: How can I trigger jQuery fadeIn() fadeOut() from a element
possible better answer: http://stackoverflow.com/a/29947683
type: Question
has answer: http://stackoverflow.com/a/29947683
answer count: 2
has answer: http://stackoverflow.com/a/29947618
tagged with: javascript
tagged with: jquery
score: 0
has comment: http://stackoverflow.com/comment/48016014
tagged with: css
accepted answer: http://stackoverflow.com/a/29947618
has body: I have a hidden element on the page: &lt;div id="hidden"&gt;&lt;/div&gt; I have another element on the page that I want to be a button trigger: &lt;div id="trigger"&gt;&lt;/div&gt; I want to do something like this: $('#trigger').on('click', function(){ if($(this).val() == 'clicked') { $('#hidden').fadeIn(700); $('#trigger').fadeOut(250); } }); Do I have to do something to the trigger element in css and how do I listen for that event of clicking trigger?
type: AnsweredQuestion

http://stackoverflow.com/a/29854469
type: Answer
upvote count: 4
has body: Apply a position:relative on &lt;div id="page-content"&gt; Change the z-index on &lt;header class="site-header"&gt; to 2
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29853523
answers question: http://stackoverflow.com/q/29853523
score: 4
type: AcceptedAnswer

http://stackoverflow.com/comment/48188592
has text: The ng-disabled doesn't seems to work with select2 in my setup, even though it works fine with other select elements, or any other element. The way I found to get it working was setting it in my .js file. I've posted my sample as the answer. Thanks for the help though.
comment on: http://stackoverflow.com/a/29976034
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/48111135
type: Comment
comment on: http://stackoverflow.com/q/29995444
score: 0
has text: The issue seems to be inside the series propTypes...I'm testing with REact 0.13.2. What about you guys?
type: QuestionComment

http://stackoverflow.com/q/29925538
has answer: http://stackoverflow.com/a/29925682
has comment: http://stackoverflow.com/comment/47972903
answer count: 2
has body: As part of an assignment I have to enlargen an image using JavaScript through a mouseover. When the image is enlarged it shouldn't move any of the other elements on the page however. When the mouse is moved from the image, it should restore back to the original size. This is the code that I have so far but it just seems to do absolutely nothing. function imageEnlarge() { document.getElementById('1').style.height=100%; document.getElementById('1').style.width=100%; document.getElementById('1').style.position='absolute'; } function imageReset() { document.getElementById('1').style.height=80%; document.getElementById('1').style.width=80%; document.getElementById('1').style.position='absolute'; } &lt;img src="home2.jpg" class="homeimage" alt="View of a beach" id="1" onmouseover="imageEnlarge();" onmouseout="imageReset();" Any ideas on where I am going wrong. The feedback from my teachers hasn't been the best so I am at a complete loss where to go on this.
has comment: http://stackoverflow.com/comment/47972915
has title: Enlarge image through mouseover using JavaScript
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: mouseover
possible better answer: http://stackoverflow.com/a/29925631
tagged with: http://stackoverflow.com/tag/html
tagged with: css
upvote count: 2
has comment: http://stackoverflow.com/comment/47972748
type: Question
accepted answer: http://stackoverflow.com/a/29925682
score: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29925631
tagged with: image

http://stackoverflow.com/q/29908323
tagged with: osx-yosemite
tagged with: applescript
type: AnsweredQuestion
type: Question
has body: I'm having a hard time extracting presentationNotes from a keynote presentation using JXA (Javascript for osx) I don't want to use applescript. There is way more to this script than extracting notes. It seems rather simple. However when I get the presentationNotes its in an RichText object that doesn't seem to have anyway to get normal text. So I figured I'd open up textEditor and write them out to it. Well I can't figure out how to do that. var app = Application('Keynote') document = app.documents[0] slide_name = document.name() i = 1 // loop through folder contents folder_name = 'chapter'+i //create a folder var textEdit = Application('textEdit') textEdit.activate() var doc = textEdit.make({new:'document'}) doc.text = "fsdfsdfs" var c = 0; for(slide in document.slides){ var s = document.slides[slide] var note = s.presentationNotes // returns object specifier //textEdit.documents[0].push(note) // I've tried lots of things here. } Any ideas or help would be appreciated. I've seen some applescript examples, however I couldn't get them to translate. Apparently applescript as text doesn't relate to toString()
tagged with: automator
has answer: http://stackoverflow.com/a/29987753
accepted answer: http://stackoverflow.com/a/29987753
tagged with: javascript
score: 0
answer count: 1
tagged with: javascript-automation
has title: Extract PresentationNotes from keynote

http://stackoverflow.com/comment/48001239
score: 0
comment on: http://stackoverflow.com/q/29940078
has text: I think you are asking if *multiselect2side* natively compares ` `s from different `<optgroups`, and that would be a question for the docs. pasting your demo code into a fiddle shows what html natively handles.
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29955173
upvote count: 14
type: AcceptedAnswer
has body: Try that https://jsfiddle.net/zy7qy3v5/3/ $('button').click(function(){ var value = $(this).siblings('input').val(); alert(value); }) Dont put an unecessary jquery object in the siblings function. Your selector is returning every siblings. $('button').siblings('input') //Returns 1 element is not the same as $(this).siblings($('input[id="username_field"]')) //Returns 2 element See https://jsfiddle.net/8x04nbyx/5/
has comment: http://stackoverflow.com/comment/48031327
accepted answer of: http://stackoverflow.com/q/29955085
type: Answer
has comment: http://stackoverflow.com/comment/48031527
score: 14
answers question: http://stackoverflow.com/q/29955085
downvote count: 0

http://stackoverflow.com/comment/48307328
comment on: http://stackoverflow.com/q/29986657
type: Comment
has text: What is a partial? Sorry I am not aware of that.
score: 0
type: QuestionComment

http://stackoverflow.com/a/29951798
upvote count: 2
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/48024953
answers question: http://stackoverflow.com/q/29950979
accepted answer of: http://stackoverflow.com/q/29950979
type: Answer
has comment: http://stackoverflow.com/comment/48059854
downvote count: 0
has comment: http://stackoverflow.com/comment/48051338
has comment: http://stackoverflow.com/comment/48025270
has comment: http://stackoverflow.com/comment/48059958
has comment: http://stackoverflow.com/comment/48025101
has comment: http://stackoverflow.com/comment/48057101
score: 2
has comment: http://stackoverflow.com/comment/48049799
has comment: http://stackoverflow.com/comment/48046905
has body: You are really over complicating things first by not taking advantage of passing objects and arrays into your controller functions and also by using the DOM and not your data models to try to update states Consider this simplification that adds a checked property to each product via ng-model If it's not practical to add properties to the items themselves, you can always keep another array for the checked properties that would have matching indexes with the child arrays. Use $index in ng-repeat for that And passing whole objects into selectAll() Which allows in controller to do: $scope.selectAll = function(product, line){ angular.forEach(product.children, function(item){ item.checked=true; }); line.products=product.children; } With angular you need to always think of manipulating your data models first, and let angular manage the DOM Strongly suggest reading : "Thinking in AngularJS" if I have a jQuery background? DEMO

http://stackoverflow.com/a/32569034
has body: Just as another point I came across when trying to use this for myself, the ref variable isn't available during construction, and this isn't clear in the documentation. You can begin to reference the element as mentioned above (http://aurelia.io/hub.html#/doc/article/aurelia/binding/latest/binding-basics/5) anytime during or after the attached method is called.
upvote count: 4
downvote count: 0
score: 4
answers question: http://stackoverflow.com/q/29863044
has comment: http://stackoverflow.com/comment/75611627
type: Answer

database-security
type: Tag
tag name: database-security
tags question: http://stackoverflow.com/q/29906775

http://stackoverflow.com/comment/47868576
type: AnswerComment
score: 0
type: Comment
has text: what i've seen and like personally is immutable servers. so if you change your code you spin up a new instance with your new code rather than just changing the code on your existing server. i'm not aware of how it's typically done with php projects.
comment on: http://stackoverflow.com/a/29871765

http://stackoverflow.com/comment/47847346
score: 0
type: Comment
has text: @NicholasKyriakides Unfortunately, in my implementation the iframe just flickers onclick and disappears immediately. Any ideas?
comment on: http://stackoverflow.com/a/29860645
type: AnswerComment

http://stackoverflow.com/a/29846314
upvote count: 1
has body: If you are trying to use pure CSS, you could use :target Show things on click When this is clicked, css like #some_id:target {...} will activate.
type: Answer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/29846197

http://stackoverflow.com/comment/47995304
has text: After trying it I noticed that it no longer prompted the user for an input, so I was going to ask you how to repeat the question to the user, but Danilo already answered how to do that.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29936509
type: Comment

http://stackoverflow.com/q/29909199
answer count: 3
tagged with: modal-dialog
has answer: http://stackoverflow.com/a/29909236
has comment: http://stackoverflow.com/comment/47940825
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29909953
has title: Javascript runtime error: 'function' is undefined
has body: It says my function is undefined yet it is clearly defined below the body of the program's content. &lt;button type="button" class="btn btn-primary" data-dismiss="modal" id="CmdBranchEditOk" onclick="CmdBranchEditOk_OnClick()"&gt; @*Add*@ function CmdBranchAdd_OnClick() { alert('Hi'); @*$('#BranchEdit').modal({ show: true, backdrop: false }); document.getElementById('BranchEdit-BranchCode').value = ""; document.getElementById('BranchEdit-Branch').value = ""; document.getElementById('BranchEdit-CompanyID').value = "";*@ } at the moment, the main body of the function has been commented out to test if it can connect to the function. but when run and pressed, it return a javarscript runtime error stating that the function in the button in undefined. Edit #1: Sorry, copied wrong line of code xD Forgive me &lt;button style="float:left" id="CmdAddBranch" type="submit" class="btn btn-default" onclick="CmdBranchAdd_OnClick()"&gt;Add A Branch&lt;/button&gt; while I'm at it, here are the loaded scripts - the function was originally supposed to call for a modal but It should just alert for now. But it's doesn't. &lt;script src="~/js/jquery.js"&gt;&lt;/script&gt; &lt;script src="~/lib/bootstrap/js/bootstrap.js"&gt;&lt;/script&gt; &lt;script src="~/wijmo/controls/wijmo.min.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script src="~/wijmo/controls/wijmo.input.min.js"&gt;&lt;/script&gt; &lt;script src="~/wijmo/controls/wijmo.grid.min.js" type="text/javascript"&gt; &lt;/script&gt; &lt;script src="~/wijmo/controls/wijmo.chart.min.js"&gt;&lt;/script&gt; &lt;script src='http://code.jquery.com/jquery-latest.min.js' type='text/javascript'&gt;&lt;/script&gt; &lt;link href="~/wijmo/styles/wijmo.min.css" rel="stylesheet" /&gt; Edit #2: Here's the entire code block to see if it has any problems. @{ ViewBag.Title = "Branch"; } &lt;!-- Script Linkings --&gt; &lt;script src='http://code.jquery.com/jquery-latest.min.js' type='text/javascript'&gt;&lt;/script&gt; &lt;script src="~/lib/bootstra…
type: Question
tagged with: asp.net-mvc
tagged with: javascript
score: 0
tagged with: asp.net-mvc-5
has answer: http://stackoverflow.com/a/29909246

http://stackoverflow.com/comment/47867599
comment on: http://stackoverflow.com/q/29871293
has text: why is this tagged php? looks a js question to me.
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/48226751
type: Comment
has text: @doonot Are you sure you're only sending ints 1 to 7? It has to be the `disabledDays` that's causing issues (unless some other code is interfering)! Could you just put a `console.log(disabledDays)` above the actual call to `picker.set()`, or maybe you already have that..
score: 1
comment on: http://stackoverflow.com/a/29992789
type: AnswerComment

http://stackoverflow.com/a/29890711
has comment: http://stackoverflow.com/comment/47904975
accepted answer of: http://stackoverflow.com/q/29890699
has comment: http://stackoverflow.com/comment/47905603
upvote count: 1
answers question: http://stackoverflow.com/q/29890699
score: 1
has comment: http://stackoverflow.com/comment/47905203
has comment: http://stackoverflow.com/comment/47905788
has body: // set global object for using it inside the settimeout function var redirect; and then inside the xhr.onreadystatechange = function() { redirect = function(){ alert("in redirect"); window.top.location=migrationConfig.REDIRECT_LINK; } setTimeout('redirect()',3000);
type: AcceptedAnswer
downvote count: 0
type: Answer

http://stackoverflow.com/a/29983594
downvote count: 0
has body: function imageWp() { var word = 'Appendizitis'; $.ajaxPrefilter(function (options) { if (options.crossDomain &amp;&amp; jQuery.support.cors) { var https = (window.location.protocol === 'http:' ? 'http:' : 'https:'); options.url = https + '//cors-anywhere.herokuapp.com/' + options.url; } }); $.get( 'https://de.wikipedia.org/w/api.php?action=parse&amp;format=json&amp;prop=text&amp;section=0&amp;page=' + word + '&amp;callback=?', function (response) { var m; var urls = []; var regex = /&lt;img.*?src=\\"(.*?)\\"/gmi; while (m = regex.exec(response)) { urls.push(m[1]); } urls.forEach(function (url) { $("#viewer").append('&lt;img src="' + window.location.protocol + url + '"&gt;'); }); }); } imageWp(); &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt; &lt;div id="viewer"&gt;&lt;/div&gt;
type: Answer
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/29983413
accepted answer of: http://stackoverflow.com/q/29983413
type: AcceptedAnswer

http://stackoverflow.com/q/29901732
upvote count: 4
has title: How to call a function after AngularJS render all views
has answer: http://stackoverflow.com/a/29902279
linked to: http://stackoverflow.com/q/14968690
downvote count: 0
has answer: http://stackoverflow.com/a/43671911
type: Question
has comment: http://stackoverflow.com/comment/47926599
tagged with: javascript
score: 4
answer count: 3
favorite count: 0
has body: How to call a simple function, after all AngularJS views loaded successfully. function hello() { alert('All AngularJS works are done'); } &lt;!-- Below code is example about how I need a function for AngularJS loaded event --&gt; app.onAngularLoaded(function () { hello(); }); &lt;/script&gt;
tagged with: angularjs
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29901813

http://stackoverflow.com/q/29990885
type: Question
has title: Render a partial view inside a Jquery modal popup ( 2 different models)
tagged with: asp.net-mvc
tagged with: javascript
tagged with: jquery
linked to: http://stackoverflow.com/q/29975413
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/29991708
type: UnansweredQuestion
has body: My project is room-Booking. I have View which on model of rooms displays id of the room and her characteristic on foreach: @model IEnumerable<Room> @foreach (Room room in Model) { @room.NumberRoom @room.Categoryid @room.NumberOfSeats @room.CostPerNight Booking } And I have JS, which On buttonClick Render a partial view inside a Jquery modal popup: @Html.Partial("UserPartial", new Client()) UserPartial: @model Client @Html.Label("Surname") @Html.TextBoxFor(model => model.Surname) @Html.Label("Name") @Html.TextBoxFor(model => model.Name) @Html.ValidationMessageFor(model => model.Name) How to transfer NumberRoom in popup window from foreach? That, for example, in popup window gave out to me : "you chose the room number 5" please fill in your data: name,surname....... Controller: [HttpGet] public PartialViewResult UserPartial() { return PartialView("UserPartial" , new Client()); }

http://stackoverflow.com/a/29891988
downvote count: 0
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/29891792
has body: Your label "for" attribute are set to the same and not targeting the input (checkbox). Change the value (id of the input) and the image will be clickable. function togglecheckboxes(master,group){ var cbarray = document.getElementsByClassName(group); for(var i = 0; i < cbarray.length; i++){ var cb = document.getElementById(cbarray[i].id); cb.checked = master.checked; } } /* this will remove box input[type=checkbox] { display:none; } */ input[type=checkbox] + label { background: none; height: 50px; width: 72px; display:inline-block; cursor: pointer; padding: 0 0 0 0px; filter: grayscale(1); -o-filter: grayscale(1); -ms-filter: grayscale(1); -moz-filter: grayscale(1); -webkit-filter: grayscale(1); } input[type=checkbox]:checked + label { background: none; height: 50px; width: 72px; display:inline-block; cursor: pointer; padding: 0 0 0 0px; filter: grayscale(0); -o-filter: grayscale(0); -ms-filter: grayscale(0); -moz-filter: grayscale(0); -webkit-filter: grayscale(0); -o-transition:.1s; -ms-transition:.1s; -moz-transition:.1s; -webkit-transition:.1s; } label.all { margin-bottom: -17px; }
accepted answer of: http://stackoverflow.com/q/29891792
score: 1
type: AcceptedAnswer

http://stackoverflow.com/comment/47914844
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29895735
has text: I didn't add all code. Sorry for the confusion, both those things are there.
score: 0

http://stackoverflow.com/comment/47885378
score: 0
comment on: http://stackoverflow.com/a/29879740
type: Comment
has text: Yes, of course. `function subsctitute(str) { var pos = Math.floor(Math.random()*str.length); return str.substring(0, pos)+getRandomLetter()+str.substring(pos+1); } function getRandomLetter() { var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; var pos = Math.floor(Math.random()*letters.length); return letters.charAt(pos); }`
type: AnswerComment

http://stackoverflow.com/comment/48137949
comment on: http://stackoverflow.com/q/29991941
score: 0
type: Comment
type: QuestionComment
has text: I'm voting to close this as a duplicate - as suggested in comments and answers - of [In Angular, what's the conceptual difference between the error and catch functions for promises?](http://stackoverflow.com/questions/19596384/in-angular-whats-the-conceptual-difference-between-the-error-and-catch-functio)

calendar
tags question: http://stackoverflow.com/q/29864081
tags question: http://stackoverflow.com/q/29914764
tags question: http://stackoverflow.com/q/29974011
tags question: http://stackoverflow.com/q/29975636
tags question: http://stackoverflow.com/q/29987278
tag name: calendar
tags question: http://stackoverflow.com/q/29926664
type: Tag
tags question: http://stackoverflow.com/q/29889177

angularjs-scope
tags question: http://stackoverflow.com/q/29880033
tags question: http://stackoverflow.com/q/29891962
tags question: http://stackoverflow.com/q/29886600
tags question: http://stackoverflow.com/q/29865090
tags question: http://stackoverflow.com/q/29878716
tags question: http://stackoverflow.com/q/29878232
tags question: http://stackoverflow.com/q/29889798
tags question: http://stackoverflow.com/q/29876233
tags question: http://stackoverflow.com/q/29900254
tags question: http://stackoverflow.com/q/29864515
tags question: http://stackoverflow.com/q/29926821
tags question: http://stackoverflow.com/q/29970316
tags question: http://stackoverflow.com/q/29864891
tags question: http://stackoverflow.com/q/29953758
tags question: http://stackoverflow.com/q/29958723
tags question: http://stackoverflow.com/q/29857488
tags question: http://stackoverflow.com/q/29893538
tags question: http://stackoverflow.com/q/29971024
tags question: http://stackoverflow.com/q/29985527
tag name: angularjs-scope
tags question: http://stackoverflow.com/q/29939170
tags question: http://stackoverflow.com/q/29991873
tags question: http://stackoverflow.com/q/29940392
tags question: http://stackoverflow.com/q/29882401
tags question: http://stackoverflow.com/q/29990769
tags question: http://stackoverflow.com/q/29854109
tags question: http://stackoverflow.com/q/29885619
tags question: http://stackoverflow.com/q/29994652
tags question: http://stackoverflow.com/q/29872404
tags question: http://stackoverflow.com/q/29882873
type: Tag
tags question: http://stackoverflow.com/q/29861340
tags question: http://stackoverflow.com/q/29959061

http://stackoverflow.com/comment/47863132
comment on: http://stackoverflow.com/a/29867409
type: AnswerComment
score: 0
type: Comment
has text: I'm not sure either. Where and why are you seeing that message?

http://stackoverflow.com/comment/136788366
score: 0
type: Comment
comment on: http://stackoverflow.com/a/61873876
has text: this. its one function. CreateElement. i don't know what all the other posts are talking about.
type: AnswerComment

http://stackoverflow.com/a/49971497
score: 3
has body: Its because Float values can of type infinite and non-infinite, so in order to prevent this error, check whether the parsed float value is Infinite or not. For more details on parseFloat() read here parseFloat() function changeVolume(volume) { let volume = parseFloat(params.volume); if (isFinite(volume)) { gainNode.gain.value = volume; } }
downvote count: 0
upvote count: 3
type: Answer
answers question: http://stackoverflow.com/q/29903600

http://stackoverflow.com/a/29986788
has comment: http://stackoverflow.com/comment/48092811
has comment: http://stackoverflow.com/comment/48092856
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/48093006
answers question: http://stackoverflow.com/q/29986695
has comment: http://stackoverflow.com/comment/48092776
score: 0
has comment: http://stackoverflow.com/comment/48093226
has comment: http://stackoverflow.com/comment/48092930
accepted answer of: http://stackoverflow.com/q/29986695
type: Answer
has comment: http://stackoverflow.com/comment/48092971
has body: Yes it is a bad practice because JavaScript can be disabled and then your form is not working as expected anymore. Maybe you should look into the readonly property for form elements. To be clear: taking users that have JavaScript disabled into account isn't really something you have to worry about anymore. But still it's bad practice because there are build in tools to get the job done and you don't need JavaScript to hack around it.
has comment: http://stackoverflow.com/comment/48092922

http://stackoverflow.com/q/29917183
favorite count: 0
has title: How to include more than one class/sub-class in a javascript function
has comment: http://stackoverflow.com/comment/48005618
has comment: http://stackoverflow.com/comment/47955545
accepted answer: http://stackoverflow.com/a/29925466
has comment: http://stackoverflow.com/comment/47955825
type: AnsweredQuestion
upvote count: 0
has comment: http://stackoverflow.com/comment/47955594
tagged with: syntax
has comment: http://stackoverflow.com/comment/47955815
has answer: http://stackoverflow.com/a/29925466
score: -1
type: Question
tagged with: javascript
tagged with: jquery
has body: I have this javascript: $(document).ready(function() { $('#holder').toggleClass("visible"); $('a.link').click(function(event) { // Over-rides the link event.preventDefault(); // Sets the new destination to the href of the link newLocation = this.href; color = $(this).data("color"); $('body').css('background-color', color ); $('#holder').css('opacity','0' ); // Delays action window.setTimeout(function() { // Redirects to new destination window.location = newLocation; }, 250); }); $('h1').click(function(event) { $('#holder').toggleClass("visible"); }); }); I want to change the use of class body to something like body.subsection.container. How do I do this ? Also I want to include more than one class so something like body.subsection.container1, body.subsection.container2. Any help on this greatly appreciated. Cheers, Greg.
tagged with: class
tagged with: subclass
has comment: http://stackoverflow.com/comment/47955662
answer count: 1
downvote count: 1

http://stackoverflow.com/comment/47947791
score: 0
comment on: http://stackoverflow.com/q/29912844
has text: last drop down(department drop down) not populate
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29941625
has comment: http://stackoverflow.com/comment/48004119
has comment: http://stackoverflow.com/comment/48017032
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29949369
accepted answer: http://stackoverflow.com/a/29949369
tagged with: ajax
score: 0
has title: AJAX PHP LOGIN Page is not redirecting correctly
has comment: http://stackoverflow.com/comment/48004430
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/48021080
tagged with: php
has comment: http://stackoverflow.com/comment/48019654
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/48005785
has body: Basically I've got a AJAX Login page that is working and everything but when I successfully login I want it to redirect to a page without it reloading I'm not sure how its done as I am very new to langauge. Many thanks index.php Popup Login <?php session_start(); ?> <?php if(isset($_SESSION['user_name'])){ ?> Logout <?php }else {?> login <?php } ?> User Name: Password: login.php <?php session_start(); $username = $_POST['name']; $password = $_POST['pwd']; $mysqli=mysqli_connect(''); $query = "SELECT * FROM user WHERE username='$username' AND password='$password'"; $result = mysqli_query($mysqli,$query)or die(mysqli_error()); $num_row = mysqli_num_rows($result); $row=mysqli_fetch_array($result); if( $num_row >=1 ) { echo '1'; $_SESSION['user_name']=$row['username']; } else{ echo 'false'; } ?>
type: Question

http://stackoverflow.com/q/29876454
has body: I was working with jQuery and html and then I found that I have to write the nav bar code for each pages. So I decided to add a custom directive in the file. I have worked with angularJS a long time ago and I was only in basic. Some help would really be appreciating. Thank you. html file: AngularJS code: (function(){ navModule = angular.module("navModule", []); navModule.directive("navBar", function() { return { restrict: 'E', templateUrl: "custom/navBar.html" }; }); })(); and navBar.html code: This is navigation bar this is navigation bar and the errors are: XMLHttpRequest cannot load file:///C:/Users/Ibtehaz/OneDrive/3%20people/HandyUncle/navBar.html. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.(anonymous function) @ angular.min.js:87 angular.min.js:102 Error: Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'file:///C:/Users/Ibtehaz/OneDrive/3%20people/HandyUncle/navBar.html'. at Error (native) at file:///C:/Users/Ibtehaz/OneDrive/3%20people/HandyUncle/js/angular.min.js:87:37 at n (file:///C:/Users/Ibtehaz/OneDrive/3%20people/HandyUncle/js/angular.min.js:82:442) at f (file:///C:/Users/Ibtehaz/OneDrive/3%20people/HandyUncle/js/angular.min.js:80:174) at file:///C:/Users/Ibtehaz/OneDrive/3%20people/HandyUncle/js/angular.min.js:112:113 at n.$eval (file:///C:/Users/Ibtehaz/OneDrive/3%20people/HandyUncle/js/angular.min.js:126:15) at n.$digest (file:///C:/Users/Ibtehaz/OneDrive/3%20people/HandyUncle/js/angular.min.js:123:106) at n.$apply (file:///C:/Users/Ibtehaz/OneDrive/3%20people/HandyUncle/js/angular.min.js:126:293) at file:///C:/Users/Ibtehaz/OneDrive/3%20people/HandyUncle/js/angular.min.js:17:479 at Object.e [as invoke] (file:///C:/Users/Ibtehaz/OneDrive/3%20people/HandyUncle/js/angular.min.js:36:315)(anonymous function) @ angular.min.js:102 angular.min.js:102 Error: [$compile:tpload] http://errors.angularjs.org/1.3.15/$compile/tpload?p0=navBar.html at Error (nati…
has comment: http://stackoverflow.com/comment/47879897
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47883514
tagged with: css
has comment: http://stackoverflow.com/comment/47877216
downvote count: 0
has answer: http://stackoverflow.com/a/29876664
score: 1
linked to: http://stackoverflow.com/q/4208530
has title: Custom Directive not working in AngularJS error: $injector:modulerr
has comment: http://stackoverflow.com/comment/47877324
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/47877235
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29877996
has comment: http://stackoverflow.com/comment/47877972
has comment: http://stackoverflow.com/comment/47877252
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
favorite count: 0

http://stackoverflow.com/q/29853262
accepted answer: http://stackoverflow.com/a/29853375
downvote count: 1
type: AnsweredQuestion
score: 3
has title: Why does increment using ++ work with strings in javascript?
type: Question
upvote count: 4
has answer: http://stackoverflow.com/a/29853375
tagged with: javascript
tagged with: type-conversion
tagged with: unary-operator
has body: Normally when I get the value of a form input with jQuery I am obliged to convert it to a number before performing any mathematical operations. For instance, using the unary plus operator to convert, and then increment: var x = +$(this).val(); x += 1; But for some reason ++ works with strings and does the conversion automatically: var x = $(this).val(); x++; http://jsfiddle.net/m4nka9d3/ Why? Is this always safe?
answer count: 1
tagged with: increment
favorite count: 0
has comment: http://stackoverflow.com/comment/47832808

http://stackoverflow.com/comment/47972810
type: QuestionComment
has text: Ah. You just have to use string concatenation.
comment on: http://stackoverflow.com/q/29925541
score: 0
type: Comment

http://stackoverflow.com/q/29893284
favorite count: 0
has comment: http://stackoverflow.com/comment/47909710
has answer: http://stackoverflow.com/a/29893347
tagged with: php
downvote count: 1
type: AnsweredQuestion
has body: I would like to count number of submitted form by user with javascript and then put the number of submitted form in a value attribute of an input type hidden and then retrieve that value with PHP (with the name attribute of the input hidden) Here is a simple code I have tried, but it didn't work : form.html &lt;form method="post" action="submit.php"&gt; &lt;input type="text" name="name" placeholder="name"/&gt; &lt;input type="text" name="firstname" placeholder="firstname"/&gt; &lt;input type="hidden" name="nb_submit" value="" id="nb"/&gt; &lt;input type="submit" value="OK" onclick="count_nb_submit()"/&gt; &lt;/form&gt; after the html form ended, I have put the javascript code: &lt;script type="text/javascript"&gt; var nb=0; function count_nb_submit() { nb ++; return nb; document.getElementById('nb').value=nb; } &lt;/script&gt; submit.php &lt;?php echo $_POST["nb_submit"] ; ?&gt;
upvote count: 3
type: Question
has answer: http://stackoverflow.com/a/29893351
has answer: http://stackoverflow.com/a/29894719
accepted answer: http://stackoverflow.com/a/29893347
tagged with: hidden
score: 2
tagged with: javascript
has comment: http://stackoverflow.com/comment/47909600
has comment: http://stackoverflow.com/comment/47909701
possible better answer: http://stackoverflow.com/a/29893351
has comment: http://stackoverflow.com/comment/47909665
has answer: http://stackoverflow.com/a/29894897
has title: Passing a js variable value in an input type hidden and then retrieve it with php
tagged with: input
answer count: 4

http://stackoverflow.com/comment/48050610
comment on: http://stackoverflow.com/q/29965326
score: 0
type: Comment
type: QuestionComment
has text: That no works i try ........ :(

http://stackoverflow.com/comment/47895362
score: 1
has text: Always ready to help someone make a better answer than mine and steal all my rep! ;) Which reminds me -- you'd access numbered properties with `obj[_]`, not `obj._`.
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29885639

http://stackoverflow.com/q/29855261
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29857461
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/47837550
score: -1
has comment: http://stackoverflow.com/comment/47836874
tagged with: forms
tagged with: google-maps-api-3
tagged with: google-maps
upvote count: 0
has answer: http://stackoverflow.com/a/29857461
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
has body: I've been looking for a solution for hours but can't find one, I hope someone can help me as I'm new to google API, so here's what I'm trying to do: I have a form with a dynamic dropdown for region and city and based on user selection, this will update marker on google map with infowindow showing the address, lat and long.. my problem is on submitting the form, map shows blank.. here's my code: var Latlong = new google.maps.LatLng(61.10802786270912, 8.883177374999718); var map; var geocoder; var marker; function initialize() { geocoder = new google.maps.Geocoder(); var mapOptions = { zoom: 5, center: Latlong } map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions); marker = new google.maps.Marker({ position: Latlong, map: map, draggable:true, title: "Drag Me!" }); infowindow=new google.maps.InfoWindow(); infowindow.setOptions({ content: "Drag Marker" }); infowindow.open(map,marker); } function newmap(selectedregion, selectedcity){ var address = selectedregion+ "," +selectedcity; geocoder.geocode( { 'address': address}, function(results, status) { if (status == google.maps.GeocoderStatus.OK) { map.setCenter(results[0].geometry.location); map.setZoom(18); marker.setMap(null); marker = new google.maps.Marker({ map: map, position: results[0].geometry.location, draggable:true }); infowindow=new google.maps.InfoWindow(); infowindow.setOptions({ content: "test" }); infowindow.open(map,marker); } else { alert('Geocode was not successful for the following reason: ' + status); } }); } so this code will be called on page reload: $(window).load(function() { var selectedregion = document.getElementById('region').value; var selectedcity = document.getElementById('city').value; if(selectedregion == "" && selectedcity == ""){ initialize(); }else{ newmap(selectedregion, selectedcity); } }); It successfully calls the initialize function on first load, but it does not successfully process newmap function. I avoid using this: google.maps.event.addDomListener(windo…
has comment: http://stackoverflow.com/comment/47837696
has title: update google map on form submit

http://stackoverflow.com/q/29890178
upvote count: 25
has body: I want to call a function in ng-href and return the link from the function. When I click the function it sends page to that function in url. Like: localhost/pageLink() Link How can i run the function and return correct link?
type: Question
has answer: http://stackoverflow.com/a/29890211
tagged with: javascript
answer count: 2
downvote count: 0
favorite count: 0
has title: Angularjs function in ng-href
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/86889781
score: 25
tagged with: model-view-controller
tagged with: angularjs-ng-href
has answer: http://stackoverflow.com/a/40142369

http://stackoverflow.com/a/29900272
answers question: http://stackoverflow.com/q/29899590
has body: You can write a filter that would wrap original date filter provided by AngularJS and accept custom format, forwarding formatting to date if format is default or passed date is not today. Here is a sketch: .filter('my_date', ['dateFilter', function (dateFilter) { function filter(date, format, timezone) { var today = new Date(); if (!(date instanceof Date)) { date = new Date(date); } if (format == "today") { if (date.getFullYear() == today.getFullYear() &amp;&amp; date.getMonth() == today.getMonth() &amp;&amp; date.getDate() == date.getDate()) { return "Today"; } else { format = "yyyy/mm/dd"; // this is default } } return dateFilter(date, format, timezone); } return filter; }]) To use: There is a room for improvements here: you can check out more dedicated procedure for converting to date whatever was passed into filter in AngularJS source (it accepts JSON in particular); default format can be parameterized. NOTE. The outlined technique will work if you are ready to render input with date by yourself - i.e when you can select which filter to use. It will not work for ready-to-use datepicker-popup from AngularUI - it uses built-in date filter and there seems no way to override that except modifying sources of AngularUI. If popup is what you need you'll have to add "popup logic" by yourself
has comment: http://stackoverflow.com/comment/47928361
has comment: http://stackoverflow.com/comment/47948933
type: AcceptedAnswer
downvote count: 0
score: 1
type: Answer
has comment: http://stackoverflow.com/comment/47925613
accepted answer of: http://stackoverflow.com/q/29899590
upvote count: 1

http://stackoverflow.com/a/29966042
upvote count: 2
type: AcceptedAnswer
has body: right now i had the same problem. it seems to be a typo-problem. try to change or remove camel-case for your bindables. but your binding is also not ok. export class PupilsViewer { pupils = [ { name: 'John' }, { name: 'Eric' }, { name: 'Martin' }, { name: 'Simon' } ]; } app.html pupil.js import {customElement, bindable} from 'aurelia-framework'; @customElement('pupil') @bindable('info') export class Pupil { }
type: Answer
answers question: http://stackoverflow.com/q/29963074
score: 2
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29963074
has comment: http://stackoverflow.com/comment/48054379

http://stackoverflow.com/comment/48000166
type: QuestionComment
score: 0
has text: better do a single ajax call
comment on: http://stackoverflow.com/q/29939357
type: Comment

http://stackoverflow.com/comment/47909920
type: Comment
has text: Not if his form.js contains something that can get in conflict with $. Besides it's unnecessary, do you know any disadvantages still using it to be sure?
comment on: http://stackoverflow.com/a/29891393
type: AnswerComment
score: 0

firefox
tags question: http://stackoverflow.com/q/29986111
tags question: http://stackoverflow.com/q/29897260
tags question: http://stackoverflow.com/q/29849813
tags question: http://stackoverflow.com/q/29996008
tags question: http://stackoverflow.com/q/29939748
tags question: http://stackoverflow.com/q/29946761
tag name: firefox
tags question: http://stackoverflow.com/q/29915371
tags question: http://stackoverflow.com/q/29926679
tags question: http://stackoverflow.com/q/29880200
tags question: http://stackoverflow.com/q/29934304
tags question: http://stackoverflow.com/q/29893628
tags question: http://stackoverflow.com/q/29901438
type: Tag
tags question: http://stackoverflow.com/q/29863810
tags question: http://stackoverflow.com/q/29990329
tags question: http://stackoverflow.com/q/29878904
tags question: http://stackoverflow.com/q/29867924
tags question: http://stackoverflow.com/q/29863742
tags question: http://stackoverflow.com/q/29916848
tags question: http://stackoverflow.com/q/29983150
tags question: http://stackoverflow.com/q/29948369
tags question: http://stackoverflow.com/q/29957804
tags question: http://stackoverflow.com/q/29968549
tags question: http://stackoverflow.com/q/29856115
tags question: http://stackoverflow.com/q/29977325
tags question: http://stackoverflow.com/q/29936825
tags question: http://stackoverflow.com/q/29936845
tags question: http://stackoverflow.com/q/29852027

http://stackoverflow.com/q/29853278
has answer: http://stackoverflow.com/a/29853611
has answer: http://stackoverflow.com/a/29862922
answer count: 2
tagged with: ruby-on-rails-4
possible better answer: http://stackoverflow.com/a/29862922
tagged with: javascript
has title: Upload image post request over http to other application using Paperclip
accepted answer: http://stackoverflow.com/a/29853611
has body: I am able to upload image attachements using paperclip to my application. But I would like to send the image to another application via faraday connection. Other attributes are successfully sent but not the attachment image. I am not sure what I should do to achieve this.
tagged with: paperclip
linked to: http://stackoverflow.com/q/4007969
tagged with: ruby
type: AnsweredQuestion
score: 0
type: Question
linked to: http://stackoverflow.com/q/16958448

http://stackoverflow.com/comment/47827424
has text: +1 for nobility, it's amazing how 70+ developers have looked at this question and only a few pointed out an unclosed html tag, I suppose we all make mistakes
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29848473

readonly
tag name: readonly
tags question: http://stackoverflow.com/q/29971889
type: Tag

http://stackoverflow.com/comment/47997646
has text: You can use a event based system: http://jsfiddle.net/arunpjohny/kbg00us7/5/
comment on: http://stackoverflow.com/q/29937919
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29919222
type: Question
has body: I implemented a diagram tool using kineticJS and now I want to generate a PDF with some images captured from the kineticJS stage. It looks like this: My kineticJS div looks like this: What I want to achieve is a image like the one below, I did a print screen in my computer, but I don't know how to achieve this through code: I have checked this information Capture HTML Canvas as gif/jpg/png/pdf? Save PNG Canvas Image to HTML5 Storage (JAVASCRIPT)? but in my case I have two canvas because I have two layers. How can I do this? I really need to do this, is this possible (I really hope so)? Thanks in advance guys.
has answer: http://stackoverflow.com/a/29923972
accepted answer: http://stackoverflow.com/a/29923972
downvote count: 0
tagged with: javascript
answer count: 1
favorite count: 0
tagged with: kineticjs
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/6431281
has title: Get "print screen" from kineticJS div
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/923885
score: 1
upvote count: 1

http://stackoverflow.com/a/29877026
answers question: http://stackoverflow.com/q/29876904
type: Answer
score: 23
downvote count: 1
upvote count: 24
has body: Joe Fitter is right, but I think is better to export your pen (use the export to export.zip option for using your pen locally). This will give you a working version of your pen without having to copy and paste the CSS, JavaScript and HTML code and without having to make changes on it for making it work.
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/99345890
accepted answer of: http://stackoverflow.com/q/29876904

http://stackoverflow.com/q/29867101
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
favorite count: 0
has body: I built my own website and wanted to add different galleries, so I tried blueimp. It works perfectly, but when I'm closing the lightbox, I'm not able to scroll on my page anymore. Can somebody please help me? Here's a little code snippet: TAKE A LOOK ‹ › ×
tagged with: twitter-bootstrap
has comment: http://stackoverflow.com/comment/47867300
score: 6
upvote count: 6
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/31030050
type: Question
possible better answer: http://stackoverflow.com/a/30658032
has title: No scrolling after closing lightbox (blueimp)
has answer: http://stackoverflow.com/a/30658032
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47906987
accepted answer: http://stackoverflow.com/a/31030050
tagged with: blueimp
answer count: 2

http://stackoverflow.com/a/41507959
type: Answer
has body: I think the properties are placed on different objects. When you enable the loader, the code sets $scope.main.showLoader to true. The timeout callback on the other hand sets a variable this.showLoader to false. As @tpie already explained, this in this case only references to the timeout callback function itself. The HTML snippet you posted is not complete, so I can only guess. Using the following line to reset showLoader can solve the problem. $scope.main.showLoader=false;
answers question: http://stackoverflow.com/q/29960135
score: 0

http://stackoverflow.com/comment/48058936
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29969536
has text: Change `text` to `html`

http://stackoverflow.com/comment/64103555
type: Comment
has text: I've been looking into it a little bit. I think it has something to do with require.context being used in certain ways.
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/30047862

http://stackoverflow.com/comment/48225355
has text: @guest271314, yes it does.
score: 0
comment on: http://stackoverflow.com/q/29990540
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/50769440
has text: No, it's not what I'm trying to do. Please, read question again. I want to work with just ordinary file, waiting for appends to happen. It's not the same.
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/31328488
type: Comment

http://stackoverflow.com/a/29963026
has comment: http://stackoverflow.com/comment/48047496
score: 2
upvote count: 2
has comment: http://stackoverflow.com/comment/48050828
has comment: http://stackoverflow.com/comment/48047948
downvote count: 0
answers question: http://stackoverflow.com/q/29962617
type: Answer
has body: There's nothing wrong with the code above. Since these chars do appear, they are prepended after the echo $d - which might be caused by an output handler globally registered in PHP. Or something weired within the web server (nginx, apache, ...?). I would recommend to check that first before fiddling around in obviously proper three-liners. EDIT: It seems, that everything what PHP is spitting out anyhow is getting surrounded by some HTML-Tags: using var_dum($d) getting this response ���������� string '[{&quot .... This indicates, that there IS an output handler and any solution which tries to solve this by modifying $d will / must fail. EDIT 2: you might try: .... ob_end_clean(); ob_end_clean(); // number of calls depends on number of stacked output handlers, echo $d; exit(0);

http://stackoverflow.com/q/29915196
type: UnansweredQuestion
score: 0
has answer: http://stackoverflow.com/a/61855820
has comment: http://stackoverflow.com/comment/47952072
has title: Linkedin share button override document.onreadystatechange event function to null
has comment: http://stackoverflow.com/comment/47954204
tagged with: onreadystatechange
tagged with: social-networking
type: Question
tagged with: javascript
has body: I am embedding LinkedIn share button using script tags given me by Share Plugin Generator. When I add it to the footer of my site it sets the document.onreadystatechange. document.onreadystatechange = function() { if (document.readyState === 'complete') { // some code run here }} to null. How can I prevent it from overriding my onreadystatechange event?
tagged with: linkedin-api
answer count: 1
tagged with: dom-events

http://stackoverflow.com/q/29866971
has comment: http://stackoverflow.com/comment/47858976
favorite count: 0
has answer: http://stackoverflow.com/a/29867409
has comment: http://stackoverflow.com/comment/47860726
tagged with: node.js
type: AnsweredQuestion
has body: Attempting to display a string variable in postview.ejs sent by PostController.js in Sails val is the string variable [ ejs html javascript Sails express node.js ] PostController.js module.exports = { post : function (req, res) { var val = req.param('valeur'); console.log('val =', valeur); // controller test : no problem so far res.render('postview') postview.ejs (?) Post view // until now everything is running smoothly ejs code not working : is javascript relevant here ? What is the correct code in Sails to display val string in the return view ?
has title: ejs code to display a string variable sent by PostController.js in Sails
score: 1
upvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/29867409
tagged with: sails.js
downvote count: 0
tagged with: javascript
tagged with: jquery
answer count: 1

http://stackoverflow.com/q/29932338
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29932397
tagged with: dom
answer count: 3
downvote count: 0
tagged with: javascript
has title: Removing dynamically created elements with vanilla JavaScript by clicking on them
has answer: http://stackoverflow.com/a/29932475
has body: I wrote the code below to dynamically add li elements to a ul element. I want the user to be able to click on any one of them and have that li item removed. I know how to do this with JQuery but I want to know how to do it with vanilla JavaScript.I understand that removeChild() is the only method at my dispose to do this but I am a bit confused as to how to use it to accomplish the task at hand. Thank you. http://jsfiddle.net/3wk0866o/ HTML Submit JavaScript var form = document.getElementById("input-form"); function getInput(event){ event.preventDefault(); var inputValue = document.getElementById("input-field").value form.reset(); document.getElementById("list").innerHTML += " "+ inputValue +" "; } form.addEventListener("submit",getInput,false)
favorite count: 0
has answer: http://stackoverflow.com/a/29932420
possible better answer: http://stackoverflow.com/a/29932475
has answer: http://stackoverflow.com/a/29932397
score: 1
upvote count: 1
type: Question

http://stackoverflow.com/comment/65384868
score: 1
has text: I had the exact same error but in IntelliJ on PC (virtually same as webstorm I think) 14.1.3 after importing a TS project that was working fine outside of IntelliJ. Solved by File->Settings->Languages & Frameworks-> Typescript and adding --module commonjs to the 'command line options:'
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29997716

http://stackoverflow.com/q/29951847
upvote count: 3
downvote count: 1
type: Question
tagged with: javascript
has body: I spend some time to understand how Cross-Origin-Resource-Sharing works, and I cannot believe how this could be designed so insecure. When a website hosted on foo.com wants to request a resource which is stored at bar.com via ajax, the browser asks bar.com if the request is allowed. Only if bar.com explicitly allows asynchronous requests from foo.com (via the Access-Control-Allow-Origin response header), the resource is delivered to the client. It´s not a security problem if data should be read. But if data is sent to the requested server, it is. In the past, if a hacker successfully inserted JavaScript code in a website to steal cookie data or other informations, the Same-Origin-Policy prevented that he could send the informations to his own server directly. But thanks to CORS, a hacker can directly send the stolen information to his own server just by enabling any origin. I know, CORS is still under development, but already supported by almost all major browsers. So, why is CORS designed like this? Wouldn´t it be much more secure, if the originating server is asked for permission to send ajax requests? In my oppinion, this is a degradation of security. Or is it not? All "known issues" I found related to CORS are about weak configuration on the requested server.
has answer: http://stackoverflow.com/a/29951947
has answer: http://stackoverflow.com/a/29951929
tagged with: same-origin-policy
tagged with: cross-domain
answer count: 2
tagged with: cors
has comment: http://stackoverflow.com/comment/48024633
has title: Why does CORS allow sending data to any server?
possible better answer: http://stackoverflow.com/a/29951929
favorite count: 0
accepted answer: http://stackoverflow.com/a/29951947
score: 2
type: AnsweredQuestion

http://stackoverflow.com/q/29903478
answer count: 0
downvote count: 0
tagged with: d3.js
type: UnansweredQuestion
score: 1
type: Question
has title: Do not allow links between 2 nodes - Directed Graph Editor d3.js
upvote count: 1
has body: I've made use of "Directed Graph Editor" - http://bl.ocks.org/rkirsling/5001347 for my research project and I've updated it and now it looks like this - http://jsfiddle.net/fb89orLt/2/. My question is that how can I not allow a link to be drawn between 2 blue circles (for example, I do not want to allow d3 to draw link between "Starbucks" &amp; "Habitat for Humanity"). I was thinking on achieving something comparing the 2 nodes on the "drag-to-self" lines as already done in Directed Graph Editor, but couldn't think of a solution. Here's the code fragment where a new node is added and the "drag-to-self" condition is checked: enter code here // select node mousedown_node = d; if(mousedown_node === selected_node) selected_node = null; else selected_node = mousedown_node; selected_link = null; enter code here // reposition drag line drag_line .style('marker-end', 'url(#end-arrow)') .classed('hidden', false) .attr('d', 'M' + mousedown_node.x + ',' + mousedown_node.y + 'L' + mousedown_node.x + ',' + mousedown_node.y); enter code here restart(); }) .on('mouseup', function(d) { if(!mousedown_node) return; enter code here // needed by FF drag_line .classed('hidden', true) .style('marker-end', ''); enter code here // check for drag-to-self mouseup_node = d; if(mouseup_node === mousedown_node) { resetMouseVars(); return; } // unenlarge target node d3.select(this).attr('transform', ''); Please help me out in this issue. Thanks. Any help is greatly appreciated.
tagged with: javascript
favorite count: 0
tagged with: http://stackoverflow.com/tag/svg

http://stackoverflow.com/a/29883240
accepted answer of: http://stackoverflow.com/q/29881428
answers question: http://stackoverflow.com/q/29881428
type: Answer
has comment: http://stackoverflow.com/comment/47916103
has body: The problem is that your helper does not reference a reactive data source, which means it won't be re-executed whenever the state of the accordion is changed. You can fix this by using Semantic UI accordion plugin callbacks to track the current state of the widget and store it as a reactive data source. Template.accordion.onCreated(function(){ // you'll need to meteor add reactive-var to use this this.opened = new ReactiveVar(false); }); Template.accordion.onRendered(function(){ // store a reference to the template instance to use it later // in functions where the this keyword will be bound to something else var template = this; this.$(".ui.accordion").accordion({ onOpen:function(){ // here, the this keyword is bound to the currently opened item template.opened.set(true); }, onClose:function(){ // modify the reactive var accordingly template.opened.set(false); } }); }); Template.accordion.helpers({ opened:function(){ // Template.instance().opened is a reactive data source // this helper will get re-executed whenever its value is modified return Template.instance().opened.get(); } });
upvote count: 1
score: 1
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/74033045
score: 1
has text: Usage of $index should be avoided as it is ng-repeat index and not the actual array index of the scope object which is bound to the view; Sometimes this can go horribly wrong in case you are doing sorting or filtering for example you have an array bird[0] = parrot; bird[1] = crow ; if you filter for crow, your grid will result in $index = 0 but in reality, crow was at index 1.
comment on: http://stackoverflow.com/a/29947833
type: AnswerComment
type: Comment

http://stackoverflow.com/q/29964849
has comment: http://stackoverflow.com/comment/48050903
type: AnsweredQuestion
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/48049769
has comment: http://stackoverflow.com/comment/48050808
type: Question
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/48049875
has answer: http://stackoverflow.com/a/29965577
has comment: http://stackoverflow.com/comment/48050832
score: 0
has comment: http://stackoverflow.com/comment/48050656
answer count: 1
has body: I am new to jQuery and am looking to do a simple form validation. So if the value of the specified text field is a blank string, I would like the related div elements to show. My HTML and jQuery so far are below, any help would be awesome. Please enter your name Please enter your surname $(document).ready(function() { $("#frm").submit(function(event) { var vname = $("#txtname").val(), vsurname = $("#txtsurname").val(); if(vname == "") { $("#msg_name").text("Please fill this out"); event.preventDefault(); } else if (vsurname == "") { $("#msg_surname").text("Please fill this out"); event.preventDefault(); } }); });
accepted answer: http://stackoverflow.com/a/29965577
has title: jQuery form validation without a plugin

http://stackoverflow.com/comment/130161517
type: Comment
score: 1
comment on: http://stackoverflow.com/q/29853255
has text: Voting to close as a duplicate of the newer question which provides a better error description and has more views.
type: QuestionComment

http://stackoverflow.com/q/29906808
tagged with: javascript
has answer: http://stackoverflow.com/a/29907066
accepted answer: http://stackoverflow.com/a/29907066
has comment: http://stackoverflow.com/comment/47936366
duplicate of: http://stackoverflow.com/q/11922383
has comment: http://stackoverflow.com/comment/47936778
has title: Javascript nested object
type: Question
has comment: http://stackoverflow.com/comment/47936523
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/11922383
has comment: http://stackoverflow.com/comment/47936473
score: 0
has body: Considering this following javascript object below: Object { _id: "553ea677da00122e5413d8c2", { "labyname": "Mq", "data": [ [ [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] ], [ [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] ], null, null, null, null, "Mq"] }: "" } To access id in that object I can do something like that: var=object[0]["_id"] Can anyone tell me how to access "labyname" and "data?
answer count: 1

http://stackoverflow.com/comment/50785309
type: AnswerComment
has text: Haha good point, "one of" the strengths is easily working with system utilities, but sure you have a point. Tail-stream is a pretty clear example of how to accomplish what you're after. You could also write a native module? *ducks*
type: Comment
comment on: http://stackoverflow.com/a/31394491
score: 0

http://stackoverflow.com/q/29957088
has answer: http://stackoverflow.com/a/29957267
has title: Why doesn't my small custom function work correctly?
has body: I wrote a custom function that is not working as expected. This part of the code $(carta).stop().css("visibility","visible").fadeIn(); and this $(carta).stop().fadeOut(250); are not beeing triggered, but if I change the carta var for the id ("#carta1") it works. Does anybody knows what I should change for the function to work correctly? Here's the code; function yes(meal,carta){ var fadeTo_null = function(e){ e.preventDefault(); $("#probando").stop().fadeTo(250,0); $("#probando").css("visibility","hidden"); $(carta).stop().css("visibility","visible").fadeIn(); }; var fadeTo_back = function (e){ e.preventDefault(); $("#probando").stop().fadeTo(500,1); $("#probando").css("visibility","visible"); $(carta).stop().fadeOut(250); }; $(meal, carta).hover(fadeTo_null,fadeTo_back); }; $(document).ready(function(){ yes("#frueh" ,"#carta1"); });
type: Question
has comment: http://stackoverflow.com/comment/48034852
has comment: http://stackoverflow.com/comment/48034851
tagged with: javascript
score: 0
answer count: 3
has comment: http://stackoverflow.com/comment/48035831
tagged with: jquery
has comment: http://stackoverflow.com/comment/48034868
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/48034940
has answer: http://stackoverflow.com/a/29957269
has answer: http://stackoverflow.com/a/29957185

http://stackoverflow.com/q/29998893
tagged with: meteor
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/30056451
downvote count: 0
has body: I'm getting this error message in the terminal "Mail not sent; to enable sending, set the MAIL_URL environment variable." despite setting MAIL_URL environment variable. After this message the whole mail content html gets dumped in the terminal. I'm using 2 meteor packages for sending email: yogiben:pretty-emails and email with mailgun api service. Here's the source code for the mail config and sending email: if Meteor.isServer Meteor.startup -&gt; process.env.MAIL_URL = 'smtp://sandboxid.mailgun.org:mypassword@smtp.mailgun.org:587' return PrettyEmail.options = from: 'primaryemail@gmail.com' siteName: 'Meteor Test' companyAddress: 'sdfsf, gdfg-df' companyName: 'Code to Create' companyUrl: 'http://example.com' Accounts.sendVerificationEmail -&gt; Meteor.userId() This file is kept inside Project_Directory/both/_config directory. I'm currently developing this app on local ubuntu server.
score: 1
favorite count: 0
tagged with: coffeescript
type: Question
has answer: http://stackoverflow.com/a/41420900
has title: Meteor mail not sending despite setting MAIL_URL environment variable
tagged with: javascript
answer count: 2
upvote count: 1
tagged with: email

http://stackoverflow.com/comment/48041048
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29960070
has text: it gives same jumping effect. I have two images 1 with teddy arms down and 2nd with arms up. and both images bounce simultaneously. the only difference is z-index. I used z-index property to shuffle images .

http://stackoverflow.com/q/29938918
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47999622
tagged with: ajax
has comment: http://stackoverflow.com/comment/47999083
has answer: http://stackoverflow.com/a/29939011
has title: Ajax post data while loop php
score: 0
tagged with: php
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29939011
has body: Sorry, I am a beginner. I have some problem about ajax post data from while loop PHP. Here is my code. Assume that after while loop I have 5 records 5 buttons with different post data each record, but ajax will send only first data of record no matter I click which button in these 5 records ajax will send the same data of first record data But, if I use $(this).val() ajax will send right data in each records. Pls help. thx so much. In PHP. <?php while($rs = mysql_fetch_array($qr)) { ?> <input type="text" name="studentid" class="studentid" value="<?=$rs['studentid']?>"/> ไซต์ <option <?php if($rs['ssize'] == 'S') { ?> selected="selected" <?php } ?> value="S">S <option <?php if($rs['ssize'] == 'M') { ?> selected="selected" <?php } ?> value="M">M <button value="<?=$rs['id']?>" class="printBill btn btn-primary"> พิมพ์ใบเสร็จ <?php } ?> In JS. $(".printBill").click(function () { $.ajax({ url: "admin_search_save.php", data: { id:$(this).val(), studentid:$(".studentid").val(), ssize:$(".ssize").val(), }, success: function (data) { } }); });
type: Question

http://stackoverflow.com/a/29864055
has body: Some tests I did a while ago found that it was only working if you redirect to a site where the cache manifest is correctly specified. The application cache works per domain. This gives us two different cases: 1. it's a site on our domain or 2. it' an external site. Because you only need to specify the manifest on the main site (or any other site that is guaranteed to be visited, otherwise you can get strange behaviour) you can just put a bouncer in front of your house: Make a dummy page (=bouncer, displaying a spinner or progress bar) whith the cache manifest correctly specified. This dummy page can also check if there were changes and swap the cache. After loading all resources you just redirect to the "real" entry point of your application (the bouncer granted access). If it is an external page, then you have to choose another workaround like reading the content of the site on the server side and correct it there (so that it looks like it's a site on your domain). You can also cache the external site like any other resource and load the external site in an iframe, but simply put: the URI displayed in the browser has to be on your domain. If you think about it, it's just reasonable, otherwise I could make a site that caches stackoverflow forever and everyone who visited my site will have no more updates from stackoverflow (oversimplified, but it should get the point accross).
upvote count: 1
score: 1
accepted answer of: http://stackoverflow.com/q/29863841
answers question: http://stackoverflow.com/q/29863841
type: AcceptedAnswer
downvote count: 0
type: Answer

http://stackoverflow.com/q/29937735
has comment: http://stackoverflow.com/comment/47996997
downvote count: 3
upvote count: 1
has answer: http://stackoverflow.com/a/29937848
type: Question
score: -2
tagged with: http://stackoverflow.com/tag/json
tagged with: jsonp
has body: I'm getting some result when calling to some service as below. Call: &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"&gt;&lt;/script&gt; &lt;script&gt; function getData() { var clientID = '123'; var pageName = 'home'; var serviceURL = 'https://service.com/meta?_callback=home&amp;_o=' + clientID + '&amp;_t=' + pageName + ''; $.ajax({ url: serviceURL, method: 'GET', aynch:true, success: function (data) { console.log(data); }, error: function (data, textStatus, errorThrown) { alert('Service Call Error '+ errorThrown); } }); } &lt;/script&gt; Response: home({ "a": { "prop1": "data", "prop2": "data" }, "b": { "prop1": "data", "prop2": "data" } }); How to access data of this result using JavaScript ?
possible better answer: http://stackoverflow.com/a/29944575
has answer: http://stackoverflow.com/a/29937827
has comment: http://stackoverflow.com/comment/47997002
has answer: http://stackoverflow.com/a/29944575
tagged with: javascript
tagged with: jquery
favorite count: 0
answer count: 3
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47997000
accepted answer: http://stackoverflow.com/a/29937827
has title: Access JSON data inside brackets - home({"a": { "prop1": "data", "prop2": "data"});

http://stackoverflow.com/q/29928706
possible better answer: http://stackoverflow.com/a/29928941
has title: Numerical values in web page
accepted answer: http://stackoverflow.com/a/29928944
has body: I apologize if this is a duplicate and I realize this is rather broad. I'm having a bit of trouble trying to understand how I would approach the following: I want to define a numerical value and allow the user to click checkboxes say for a number of sides and the corresponding sides. Now after each successive side clicked the value (number of sides) would decrease and display the updated amount in the webpage. How would I go about this! Define all the variables etc in jquery then create functions to check if the checkboxes have been clicked then decrease the variable by updating it. However after this how would I actually use this variable in the html portion(s) to display the number of sides remaining? As I understand it html doesn't really have variables. Sorry if this was confusing I'm new to web programming
type: AnsweredQuestion
tagged with: javascript
tagged with: jquery
type: Question
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47979730
has answer: http://stackoverflow.com/a/29928941
has answer: http://stackoverflow.com/a/29928944
score: 0
answer count: 2

http://stackoverflow.com/q/29962584
score: 0
has comment: http://stackoverflow.com/comment/48045449
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/48045416
tagged with: angularjs
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29981107
has title: How to make my ui-view in Angular responsive?
type: Question
tagged with: responsive-design
answer count: 1
tagged with: javascript
has body: In Angular I have a nested ui-view with vertical tabs, which looks like this on desktop. on mobile, only the list should be visible with 100% width. when clicked, the content should be displayed, like this. My question is what is best practice to do this in Angular? Currently I'm doing this with enquire.js, but this is far from optimal. The code looks like this: enquire.register("screen and (max-width: 480px)", { match : function() { //FRANCHISE VIEW $( ".franchiseslide &gt; a" ).click(function() { $(".franchiseselectlist").css('display','none'); $(".franchisecontent").css('display', 'block'); $(".franchisecontent").css('width', '100%'); $(".viewback").css('visibility', 'visible'); }); $( ".viewback").click(function() { $(".franchiseselectlist").css('display','block'); $(".franchisecontent").css('display', 'none'); $(".viewback").css('visibility', 'hidden'); }); }, Could I solve this with ui-router or ui-sref-active? Optimally, the content on mobile should slide in with an animation. What would be the best way to implement ngAnimate?
has comment: http://stackoverflow.com/comment/48045547

http://stackoverflow.com/q/29997440
linked to: http://stackoverflow.com/q/1732348
has body: I've been trying to search for a word and add a span to it in order to give it some styling and functionality, and I've found a method of doing this, but it isn't very effective. I have a content script that is searching for the word searching and then I replace the innerHTML with an added span to the keyword. This is my JS file: function getText(){ return document.body.innerText } if(getText().indexOf("searching") &gt; -1) { document.body.innerHTML = document.body.innerHTML.replace(new RegExp("searching", "g"),"&lt;span class='spanDetected' id='spanDetected'&gt;"+ 'searching'+"&lt;/span&gt;"); console.log("true"); } And this is what the outcome is: So it seems to work on some level, but then the problem arises that it also changes URLS and Textboxes, like so: What is a better way of styling and adding functionality to a word?
tagged with: google-chrome-extension
has answer: http://stackoverflow.com/a/29997504
has comment: http://stackoverflow.com/comment/48130304
tagged with: google-chrome
linked to: http://stackoverflow.com/q/9329446
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/4489119
has title: Find a word on a webpage and add a span to it
type: Question
score: 0
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/48114560
accepted answer: http://stackoverflow.com/a/29997504

http://stackoverflow.com/a/29874060
type: Answer
score: 0
has body: You could try this function contains(array, entry) { for(var p=0; p &lt; array.length ; p++){ if(array[p][0] === entry){ return true; } } return false; } for(var n=0; n &lt; values1.length ; n++) { if(!contains(values2, values1[n][0])) { resultArray.push(values1[n]); } }
answers question: http://stackoverflow.com/q/29873693

http://stackoverflow.com/q/29955850
linked to: http://stackoverflow.com/q/2801601
accepted answer: http://stackoverflow.com/a/29955858
upvote count: 1
answer count: 1
tagged with: language-agnostic
favorite count: 0
has answer: http://stackoverflow.com/a/29955858
type: AnsweredQuestion
downvote count: 0
score: 1
has body: As far as I remember I have been aware of this peculiarity where the type of NaN is a number. Now, some people go out of their way to defend this as a 'common computer science principle', but in the end it still feels wrong to me (just because something is defined under the section numeric types doesn't make it a number). Either way, this made me wonder, are there any typical situations where this makes code easier to read? Normally it just means you have to add on an extra check that it's a number and not NaN which is quite a hassle. And for the life of me I can't remember ever having run into a situation where I wanted typeof NaN to return number. So, did I miss something? Or is it really as bad as it looks?
type: Question
has title: In what kind of code does it makes sense that `typeof NaN` is 'number'
tagged with: javascript

http://stackoverflow.com/comment/47832846
has text: @billynoah: That's a very, very good observation. In most languages with B-like syntax (C, Java, etc.), `++x` being essentially `x += 1` (not `x++`, the final value of the expression is different) would be an accurate statement. But not JavaScript, with its loose typing. :-)
type: AnswerComment
type: Comment
score: 0
comment on: http://stackoverflow.com/a/29853375

http://stackoverflow.com/q/29867085
answer count: 0
has title: memory leak when using base64 images
type: UnansweredQuestion
has body: I'm creating extension something similar to speed dial form. It creates new tab page with image thumbnails. screenshot for better understanding Those images are read from an array of base64 datauri. In html, I have container div in which I'm creating thumbnails from array loop. I've been trying different approaches to accomplish small(reasonable) memory usage, but without of luck. this is one chrome.storage.local.get('imgArray', function (result) { var imgArray = result.imgArray; var cnt = document.createElement('div'); cnt.id = 'contaier'; cnt.style.left = l+'px'; cnt.style.bottom = 0+'px'; cnt.style.width = l2+'px'; document.body.appendChild(cnt); for (var i=0, l=imgArray.length; i&lt;l; i++) { var sp = document.createElement('div'); sp.id = lv.id; sp.className = 'thumbNail'; cnt.appendChild(sp); sp.setAttribute("style", "background-image: url('" + imgArray[i].ss2 + "');"); /* other minor elements.... not important*/ } imgArray=null; }); Every time I resize window, memory jumps in step of 10-20MB, and that accumulates very fast, so I can easily get 400-500MB memory usage for 20-25 small image previews. I did played with different img sizes upon very creation of thumbnails, so I have images in approx. 1000x500px (imgArray[i].ss) and 500x250px (imgArray[i].ss2) Smaller images do consume less memory (not much) but still, mem. accumulation is the same... another approach with canvas, to avoid bg-image: for (var i=0, l=imgArray.length; i&lt;l; i++) { (function(lv) { var sp = document.createElement('div'); sp.id = lv.id; sp.className = 'thumbNail'; cnt.appendChild(sp); var canvas = document.createElement("canvas"); canvas.className = 'stImg'; var ctx = canvas.getContext("2d"); var img = new Image; img.onload = function(){ ctx.drawImage(img, 0, 0, canvas.width, canvas.height); }; img.src = lv.ss2; sp.appendChild(canvas); }(imgArray[i])); } I tried also with img element too, inside thumbnail div. Nulling original array helps a little but that is not a real problem. I have…
has comment: http://stackoverflow.com/comment/47862544
upvote count: 1
type: Question
score: 1
tagged with: base64
tagged with: image
has comment: http://stackoverflow.com/comment/47860834
tagged with: canvas
downvote count: 0
has comment: http://stackoverflow.com/comment/47866322
tagged with: javascript
has comment: http://stackoverflow.com/comment/47860662
tagged with: google-chrome-extension
has comment: http://stackoverflow.com/comment/47868002
has comment: http://stackoverflow.com/comment/47862340
favorite count: 0

http://stackoverflow.com/comment/47950457
score: 0
type: Comment
has text: Have you checked your browser console for errors? Are you sure you're targetting the correct classes? Is the javascript file loading? Django is a back-end framework, it can't "prevent" anything from happening on the front-end of your website. You'll need to post more code (eg, both the html and the javascript) for us to help you determine the issue.
type: QuestionComment
comment on: http://stackoverflow.com/q/29914287

http://stackoverflow.com/comment/47912236
has text: It works, but the the result goes to var item. I need to push the title value to some tag, so I need to each title goes to a tag. For example: on json that you gave as example there are 3 `title`, I need to show on HTML the following: ` title 1 ` ` title 2 ` ` title 3 `. How can I do this?
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/29851451
score: 0

http://stackoverflow.com/q/29900290
tagged with: javascript
tagged with: angular-dart
upvote count: 0
tagged with: dart
answer count: 1
has body: I am trying to understand google two programing language. Dart --> Produce Javascript Go --> Produce machine code If I need to combine Client - Server model. I am wondering how the architecture works. How does it work. Is there any example/sample. Example : Please explain this..... I type www.learnlang.com. I expect WEB UI is served using Dart and It is calling REST API developed in GO language. Note : Please don't relate google app engine. I am trying to understand the model in individual servers. Thank you.
tagged with: web
favorite count: 0
tagged with: go
has answer: http://stackoverflow.com/a/29900370
score: -1
has title: Client - Server model using Dart as Client and Go language as Server
type: UnansweredQuestion
downvote count: 1
type: Question

flux
tag name: flux
tags question: http://stackoverflow.com/q/29986108
tags question: http://stackoverflow.com/q/29989926
type: Tag
tags question: http://stackoverflow.com/q/29955904

http://stackoverflow.com/comment/48127827
type: AnswerComment
comment on: http://stackoverflow.com/a/29998972
score: 0
type: Comment
has text: That is exactly what I am trying to do: I am trying to mock the "$mdSidenav" service from Angular Material. As you can see in the Jasmine code, I have created a mock object called "mock__mdSidenav" that I define as a function since the service is provided by a factory. I call $provide.value in order to replace the original service and then I create the "fake" promise return for the "close()" method (you can see that I redefined that method in the test within the second describe).

http://stackoverflow.com/q/29990081
tagged with: javascript
has comment: http://stackoverflow.com/comment/48099505
tagged with: visualization
tagged with: sunburst-diagram
favorite count: 0
tagged with: d3.js
has comment: http://stackoverflow.com/comment/48100582
tagged with: css
has title: Remove padding between arcs in d3 Sunburst
score: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29990667
accepted answer: http://stackoverflow.com/a/29990667
downvote count: 0
has body: I am trying to develop a sunburst diagram using d3.js but want to remove the padding between the arcs. I don't want to merge them into one item because I need to be able to drill down into them, instead I want to have invisible seperators from their sibling arcs. I modified an image of the original one Mike developed, you can find this below. On the right half of the diagram I have gotten rid of the padding as I want to program it to do, on the left half you can still see the padding I am talking about. I have copied the code from Mike Bostocks but cant find anything regarding the padding. Is there a way to do this by increasing the size of the arc a fixed amount? Thanks
possible better answer: http://stackoverflow.com/a/55979810
type: Question
upvote count: 2
answer count: 2
has answer: http://stackoverflow.com/a/55979810

http://stackoverflow.com/a/29985400
score: 0
has body: I don't claim that this is a good solution, but can be used if adeneo's solution is failed in your situation like in my case. This code is checking whether the traversing limit is containing that limit line itself or not, by using find() method: jQuery('html').on("click", function (ev) { var elemparentid = jQuery(ev.target).closest("[id]").attr("id"); var thisparents = jQuery(ev.target).parents() .map(function () { // check if traversing limit is a children of current element or not, by using find() method if (jQuery(this).find("#" + elemparentid).length &lt; 1) { return this.tagName; } }).get() .join(", "); alert(thisparents); }); FIDDLE
type: Answer
answers question: http://stackoverflow.com/q/29977831

http://stackoverflow.com/q/29888411
accepted answer: http://stackoverflow.com/a/29888481
downvote count: 0
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/47900538
answer count: 4
tagged with: angularjs
upvote count: 2
has answer: http://stackoverflow.com/a/29888518
has answer: http://stackoverflow.com/a/29888481
score: 2
type: AnsweredQuestion
has body: var app = angular.module('app',['ui.bootstrap']); app.controller("ListCtrl", function ($scope, $http) { $scope.submit = function () { $scope.loading = true; $scope.error = false; $http.get('http://www.omdbapi.com/?s=' + $scope.search + '&amp;r=json') .then(function (res) { var titles = []; angular.forEach(res.data.Search, function(item){ $http.get('http://www.omdbapi.com/?t=' + item.Title + '&amp;y=&amp;plot=full&amp;r=json').then(function(res){ if (res.data.Poster === "N/A") { res.data.Poster = "http://placehold.it/350x450/FF6F59/FFFFFF&amp;text=Image+not+Available!!"; } titles.push(res.data); }); }); $scope.movie = titles; $scope.results = true; $scope.error = false; $scope.loading = false; if (titles.length==0) { // not working $scope.results = false; $scope.error = true; } }) I have been tried several things like : Object.getOwnPropertyNames(titles).length === 0) obj == null None of them seems to work...
possible better answer: http://stackoverflow.com/a/29888500
has comment: http://stackoverflow.com/comment/47900644
has answer: http://stackoverflow.com/a/29888500
type: Question
has answer: http://stackoverflow.com/a/29889801
has title: How can I check whether array of objects is empty or not?

http://stackoverflow.com/a/29937951
has comment: http://stackoverflow.com/comment/48220510
has comment: http://stackoverflow.com/comment/48001160
has comment: http://stackoverflow.com/comment/48000738
score: 0
has body: The code below happen when you are changing the value in your quantity and it will run an ajax call to check if the quantity is greater than your stock. Product Name: Select <?php while ($line = mysqli_fetch_array($query, MYSQL_ASSOC)) { ?> <option value="<?php echo $line['prod_name'];?>"> <?php echo $line['prod_name'];?> <?php } ?> Quantity: |
has comment: http://stackoverflow.com/comment/48424260
has comment: http://stackoverflow.com/comment/48201486
has comment: http://stackoverflow.com/comment/48000338
answers question: http://stackoverflow.com/q/29937593
has comment: http://stackoverflow.com/comment/48035820
type: Answer
has comment: http://stackoverflow.com/comment/48176654
has comment: http://stackoverflow.com/comment/48000570
has comment: http://stackoverflow.com/comment/48246879
has comment: http://stackoverflow.com/comment/48012027
has comment: http://stackoverflow.com/comment/48308347

http://stackoverflow.com/comment/47977959
has text: @tstevens: if you saved, it will not disappear. Fiddle is incredibly useful to anyone trying to help you, highly recommended to always include it in your question.
comment on: http://stackoverflow.com/q/29927888
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/a/30618661
score: 0
type: AcceptedAnswer
type: Answer
has body: I did it.I edit the code with the solution. And I load that store in a selectfield in a view. In the app.js you load the store: Ext.application({ name:'demoapp', views:['Login','MainMenu'], controllers:['Login'], stores:['CCAA'], models:['CCAA'], launch:function(){ Ext.Viewport.add([ {xtype:'loginview'}, {xtype:'mainmenuview'} ]); Ext.getStore('storeCCAA').load(); } }); And in the view you declare the selectfield: items:[{ xtype:'selectfield', itemId:'CCAAcombo', label:'Comunidad Autonoma', store:'storeCCAA', displayField:'nombre', valueField:'id', }]
answers question: http://stackoverflow.com/q/29918829
accepted answer of: http://stackoverflow.com/q/29918829

http://stackoverflow.com/comment/48266871
comment on: http://stackoverflow.com/q/29861506
type: QuestionComment
has text: @GauravSaini , It's a bug in the Google chrome. You can see the bug issue thread here.. https://code.google.com/p/chromium/issues/detail?id=477866 , Its sad to see that it's still unresolved.
type: Comment
score: 1

http://stackoverflow.com/comment/47957876
has text: Thank you very much for your quick answer ! I tried so many possibilities that I let several code mistakes (shame on me!). Now I corrected them, but have still the mentionned error. I really don't understand why. I wanted to try [this tutorial](https://www.dashingd3js.com/using-json-to-simplify-code), but using a json file.
comment on: http://stackoverflow.com/a/29918178
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/47826942
type: QuestionComment
type: Comment
score: 1
comment on: http://stackoverflow.com/q/29850410
has text: Big no no! you should make ajax requests to your controllers, not single php files

http://stackoverflow.com/q/29916224
tagged with: java
has answer: http://stackoverflow.com/a/29916471
answer count: 1
tagged with: javascript
score: 0
has title: Store serializable data in char or string variable in Java
has body: Serializable a = randomForest.getClassificationByMaxProb(attributes); System.out.println("Assigned class: " + a); I am getting the result: Assigned class: 1 I want to store that class which is 1 into any char or int variable.
type: Question
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29916471

http://stackoverflow.com/a/29885231
downvote count: 0
answers question: http://stackoverflow.com/q/29850174
type: Answer
upvote count: 2
has comment: http://stackoverflow.com/comment/47905223
score: 2
has body: Pass an object literal to pushState() on page load. This way you can always go back to your first created pushState. Add to DOM ready var obj = { html: '', coursecode: '' }; try { window.history.pushState({ html: $("#content").html(), coursecode: $("#coursecode").val() }, 'just content or variable', window.location.href); } catch (e) { console.log(e); } In your eventhandler to push state: var onClicksearchbuttonHandler = function(event) { if ($("#coursecode").val().length &gt; 0) { searchDB({ course:$("#course").val() }); obj.html = $("#content").html(); obj.coursecode = $("#coursecode").val(); window.history.pushState(obj, "", "/main?&amp;course="+$("#course").val()); } }; When going back to your original pushstate: $(window).on('popstate', function (ev) { var originalState = ev.originalEvent.state || obj.html; if (!originalState) { // no history // do something return; } else { // do something } });

http://stackoverflow.com/comment/48010165
type: AnswerComment
type: Comment
has text: This is what i expected but instead using pseudo elements can you please implement with the background images coz i have to use the same scenario for different images with different shape so if this is a common to all I really thank full to you.
comment on: http://stackoverflow.com/a/29944377
score: 0

http://stackoverflow.com/comment/48075886
has text: I answered a similar question earlier today, hope this is helpful: http://stackoverflow.com/a/29977006/4556448
score: 0
comment on: http://stackoverflow.com/q/29977892
type: Comment
type: QuestionComment

image
tags question: http://stackoverflow.com/q/29968518
tags question: http://stackoverflow.com/q/29878568
tags question: http://stackoverflow.com/q/29897875
tags question: http://stackoverflow.com/q/29861127
tags question: http://stackoverflow.com/q/29953271
tags question: http://stackoverflow.com/q/30001223
tags question: http://stackoverflow.com/q/29846833
tags question: http://stackoverflow.com/q/29909512
tags question: http://stackoverflow.com/q/29901948
tags question: http://stackoverflow.com/q/29939635
tags question: http://stackoverflow.com/q/29963418
tags question: http://stackoverflow.com/q/29996934
tags question: http://stackoverflow.com/q/29864089
tags question: http://stackoverflow.com/q/29925538
tags question: http://stackoverflow.com/q/29983685
tags question: http://stackoverflow.com/q/29979451
tags question: http://stackoverflow.com/q/29910073
tags question: http://stackoverflow.com/q/29857029
tags question: http://stackoverflow.com/q/29912838
tags question: http://stackoverflow.com/q/29901111
tags question: http://stackoverflow.com/q/29989777
tags question: http://stackoverflow.com/q/29911050
tags question: http://stackoverflow.com/q/29969239
tags question: http://stackoverflow.com/q/29991834
tags question: http://stackoverflow.com/q/29944558
tags question: http://stackoverflow.com/q/29933209
tags question: http://stackoverflow.com/q/29992428
tags question: http://stackoverflow.com/q/29848678
tag name: image
tags question: http://stackoverflow.com/q/29987109
tags question: http://stackoverflow.com/q/29864557
type: Tag
tags question: http://stackoverflow.com/q/29867085

http://stackoverflow.com/comment/47899570
has text: what is `after_submission`? it should be some function defined to handle this hook, can you share link of the post?
score: 0
comment on: http://stackoverflow.com/q/29879582
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/48005716
score: 0
comment on: http://stackoverflow.com/q/29941286
type: Comment
type: QuestionComment
has text: @DavidThomas I have cleaned up the demo. HTML is way too long man!!

http://stackoverflow.com/comment/48117308
score: 0
comment on: http://stackoverflow.com/q/29998768
type: Comment
type: QuestionComment
has text: There are [*many questions about this already*](http://stackoverflow.com/search?q=%5Bjavascript%5Dtypeahead+list). Do some research, find an approach that suits then come back when you need further help.

http://stackoverflow.com/comment/47838744
score: 0
has text: The problem is I'm supporting an old platform that passes lots of page specific settings/variables to the JS through the init method of the module. You might argue I could make a get request and fetch these, but that will involve a lot of refactoring on some of the pages. I don't want to lazily load modules because technically they are already available due to the bundles I am loading on the page. I just can't figure how to "require" them.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29855289

http://stackoverflow.com/q/29882004
has answer: http://stackoverflow.com/a/29903714
has comment: http://stackoverflow.com/comment/47906651
score: 3
tagged with: traceur
has comment: http://stackoverflow.com/comment/47898019
upvote count: 3
tagged with: gulp-traceur
has title: Using ES6 modules with traceur in single build file
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/47922494
has answer: http://stackoverflow.com/a/29899858
tagged with: ecmascript-6
answer count: 2
downvote count: 0
tagged with: gulp
has body: I just have a simple question cant get in any place, heve been googling for it all morning. There is no much info about traceur and when there is is not so clear, at least to me. How should be implemented the ES6 modules when im transpiling with traceur a single output file and using it in the browser with traceur-runtime? import and export keeps getting Unexpected token. I am using gulp-traceur and tried already all the modules options //'commonjs' //'amd', 'commonjs', 'instantiate', 'inline', 'register'. One doubt I have is that I keep finding answers about commonjs, but my idea of using ES6 modules is to have differents sources and then from the main import them and have all this result compiled in one single file (what i mean is that I dont need async loading of the modules in the browser) Here is the gulp task gulp.task('scripts', function() { del.sync(['bin/js/main.min.js']); del.sync(['bin/js/main.min.js.map']); gulp.src(["./src/app/init.js", "./src/app/elements/circle.js", "./src/app/app.js"]) .pipe(sourcemaps.init()) .pipe(traceur({modules : 'inline', sourceMaps: 'inline', experimental: "true"})) //'commonjs' //'amd', 'commonjs', 'instantiate', 'inline', 'register' .on('error', errorParser) .pipe(jshint()) .pipe(jshint.reporter('jshint-stylish')) .pipe(uglify({mangle: true})).on('error', errorParser) .pipe(concat('main.min.js')) .pipe(sourcemaps.write('.')) .pipe(gulp.dest('bin/js')) .pipe(livereload({ auto: true })); }); The unexpected token comes from app when importing import Circle from './elements/circle'; or import * as Circle from './elements/circle.js'; (Tried several ways) Also from circle.js when exporting export default Circle; or export Circle; (also tried several ways)
favorite count: 0
has comment: http://stackoverflow.com/comment/47914872
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47888146
linked to: http://stackoverflow.com/q/29886950
has comment: http://stackoverflow.com/comment/47916680

http://stackoverflow.com/q/29976485
has comment: http://stackoverflow.com/comment/48074522
type: AnsweredQuestion
has title: Tabs do not load the content in their tab-panes
accepted answer: http://stackoverflow.com/a/29977044
tagged with: jquery
favorite count: 0
type: Question
tagged with: twitter-bootstrap
tagged with: css
score: 0
upvote count: 1
answer count: 1
downvote count: 1
has answer: http://stackoverflow.com/a/29977044
has body: I'm trying to make a bootstrap site with nav-tabs navigation. I cant seem to figured out why my tabs do not load the content in its tab-pane. I can get it to work in a tutorial but on on my project. Any help would be appreciated. I just wanted the tabbed content to appear when i click its link. Currently its staying on the first tab and it doesn't move. thank you! Home Profile Messages Settings Your Home tab content here Your Profile tab content here Your Messages tab content here Your Settings tab content here Heading Lorem ipsum dolor sit amet, consectetur adipisici eli. Click me
tagged with: javascript

http://stackoverflow.com/q/29863179
has comment: http://stackoverflow.com/comment/47902525
accepted answer: http://stackoverflow.com/a/31459310
upvote count: 1
answer count: 1
tagged with: javascript
favorite count: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/31459310
tagged with: prerender
has comment: http://stackoverflow.com/comment/47886271
type: AnsweredQuestion
downvote count: 0
has body: I want to create prerendered pages for search engines. I am using MEAN stack (Mongo,Express,Angular,Node). I decided to create my own prerender server. I have deployed it to Heroku with following commands: $ git clone https://github.com/prerender/prerender.git $ heroku create $ git push heroku master And now I have my own prerender server, that work if you add /https://www.google.com or /http://stackoverflow.com. But it doesn't work with my angular app, that is also deployed on heroku. I can write http://mysites.com/?_escaped_fragment_=thinkpad/t-400 And get bunch of {{not rendered angular}} I have &lt;meta name="fragment" content="!"&gt; in my index.html. I have app.use(require('prerender-node').set('prerenderServiceUrl', 'prerender-server-url')); in my express.js. How can I make it work?
has title: Private prerender server wont render angularjs scripts?
type: Question
tagged with: heroku
tagged with: phantomjs
score: 1

http://stackoverflow.com/a/29853360
has body: First, here's the documentation on the Javascript Date object and its prototype. So, how can you determine if a particular day (date2) is one day after another (date1)? Well, add one day to date1 and see if the dates match: var date1_tomorrow = new Date(date1.getFullYear(), date1.getMonth(), date1.getDate() + 1); if (date1_tomorrow.getFullYear() == date2.getFullYear() && date1_tomorrow.getMonth() == date2.getMonth() && date1_tomorrow.getDate() == date2.getDate()) { return "tomorrow"; // date2 is one day after date1. } If you want to determine if date2 is two days after date1, you can use the same logic as above but add 2 days instead of 1: var date1_overmorrow = new Date(date1.getFullYear(), date1.getMonth(), date1.getDate() + 2); if (date1_overmorrow.getFullYear() == date2.getFullYear() && date1_overmorrow.getMonth() == date2.getMonth() && date1_overmorrow.getDate() == date2.getDate()) { return "the day after tomorrow"; // date2 is two days after date1. } If the dates are not 1 or 2 days apart, the final bit would be to just return the date in your desired format: return date2.toLocaleString(); // Firefox 29+, Chrome 24+, IE 11+ // OR return date2.getFullYear() + '/' + (date2.getMonth() + 1) + '/' + date2.getDate() + ' ' + date2.getHours() + ':' + date2.getMinutes() + ':' + date2.getSeconds(); // Et al. Test function incrementDate(date, n) { return new Date(date.getFullYear(), date.getMonth(), date.getDate() + n); } function compareDates(date1, date2) { return date1.getFullYear() == date2.getFullYear() && date1.getMonth() == date2.getMonth() && date1.getDate() == date2.getDate(); } function formatDate(date) { var year = date.getFullYear(); var month = date.getMonth() + 1; var day = date.getDate(); return year + '-' + (month < 10 ? '0' : '') + month + '-' + (day < 10 ? '0' : '') + day; } $(function() { var $output = $('#output'); var comparisons = [ {'start': new Date(2016, 6 - 1, 1), 'inc': 1, 'target': new Date(2016, 6 - 1, 2)}, {'start': new Date(2016, 6 - 1, 30)…
score: 6
upvote count: 7
downvote count: 1
has comment: http://stackoverflow.com/comment/63431399
has comment: http://stackoverflow.com/comment/59905071
has comment: http://stackoverflow.com/comment/63432393
has comment: http://stackoverflow.com/comment/63431476
has comment: http://stackoverflow.com/comment/92811567
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/92804933
accepted answer of: http://stackoverflow.com/q/29852408
answers question: http://stackoverflow.com/q/29852408
has comment: http://stackoverflow.com/comment/63465993
has comment: http://stackoverflow.com/comment/59891882
type: Answer

http://stackoverflow.com/q/29885055
type: UnansweredQuestion
has title: Function within constructor throwing error undefined at accessing public constructor variable
has body: I've been cleaning up a lot of animation code and I've run into a bunch of similar but different problems. This time I have a constructor within a constructor function - but thats not the problem, at least on the face of it. The problem is that within that nested constructor function, there's a normal function this.draw, which should refer to this.ctx. But this isn't happening. I thought at first maybe its because ctx somehow wasn't getting declared at load-time before it was being referred to, but it didn't fix it when I put this.ctx = ""; just to give it a placeholder. Whats up here? This is the prototype call for the nested constructor function, with the .draw function trying to reference its this.ctx: DrawDeerbra.prototype.Circle = function(){ this.ctx = ""; if(this.constructor.count1 &gt;= this.constructor.count2){ this.ctx = this.constructor.ctx2; this.count = 2; ++this.constructor.count2; } else { this.ctx = this.constructor.ctx1; this.count = 1; ++this.constructor.count1; } this.draw = function(){ var ctx = this.ctx; ctx.fillStyle = this.color; ctx.shadowColor = this.color; ctx.shadowBlur = (this.size*2) * Math.abs(Math.sin(this.shadowFrame)); ctx.beginPath(); ctx.arc(this.pos.x, this.pos.y, this.size, 0, Math.PI*2); ctx.fill(); ctx.closePath(); } } This is where the .draw from the nested Circle constructor is called -- DrawDeerbra.prototype.anim = function(){ window.requestAnimationFrame(anim); this.update(); } DrawDeerbra.prototype.update = function(){ ++this.frame; for(var i = 0; i &lt; this.circles.length; ++i){ var circ = this.circles[i]; circ.update(); circ.draw(); if(circ.pos.x - circ.size &gt; w || circ.pos.y - circ.size &gt; h || circ.pos.x + circ.size &lt; 0 || circ.pos.y + circ.size &lt; 0){ if(circ.count === 1) --count1; else --count2; this.circles[i] = new Circle; } } } Before this there is a function that populates the circle array with the nested Circle constructor, and then calls .anim and .update
has comment: http://stackoverflow.com/comment/47919888
type: Question
has comment: http://stackoverflow.com/comment/47916946
has comment: http://stackoverflow.com/comment/47931596
has comment: http://stackoverflow.com/comment/47898729
score: 0
tagged with: refactoring
has comment: http://stackoverflow.com/comment/47894166
answer count: 0
tagged with: javascript

http://stackoverflow.com/comment/48173345
comment on: http://stackoverflow.com/a/29973742
score: 0
type: AnswerComment
has text: The problem with this is that when you create bBook, you are not creating a new class, but a new instance, automatically. Would it be posible to create a TechBook class that returns Object.create(new Book(), {pages: {value:50} }); on instance creation?
type: Comment

http://stackoverflow.com/comment/47834424
score: 0
has text: @RachelAnn457 I think mismatch in angular version and angular route
comment on: http://stackoverflow.com/q/29851636
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29857337
accepted answer: http://stackoverflow.com/a/29858781
downvote count: 2
has comment: http://stackoverflow.com/comment/47840854
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47840588
has comment: http://stackoverflow.com/comment/47840544
has answer: http://stackoverflow.com/a/29858781
linked to: http://stackoverflow.com/q/203198
upvote count: 0
has comment: http://stackoverflow.com/comment/47840616
answer count: 1
tagged with: javascript
tagged with: jquery
has body: I added a class of "vid-active" to divs. Only one div can have it at a time. I now try to do this: $('.kol-vid-select').click(function(){ var clicked = $(this); $('.kol-vid-select').removeClass('vid-active'); clicked.addClass('vid-active'); if($('.vid-active').hasClass('overview')){ $('#myvid').attr('src', 'http://player.vimeo.com/video/108161058?api=1&amp;player_id=player1'); counter=0; //alert('overview'); } if($('.vid-active').hasClass('analysis')){ $('#myvid').attr('src', 'https://player.vimeo.com/video/125471793?api=1&amp;player_id=player1'); counter=0; //alert('analysis'); } if($('.vid-active').hasClass('compelling')){ $('#myvid').attr('src', 'https://player.vimeo.com/video/125478290?api=1&amp;player_id=player1'); counter=0; //alert('compelling'); } if($('.vid-active').hasClass('practical')){ $('#myvid').attr('src', 'https://player.vimeo.com/video/125483119?api=1&amp;player_id=player1'); counter=0; //alert('practical'); } if($('.vid-active').hasClass('proven')){ $('#myvid').attr('src', 'https://player.vimeo.com/video/125483160?api=1&amp;player_id=player1'); counter=0; //alert('proven'); } }); //------------------------------------------------------ var counter = 0; $(function() { //alert('in here'); var player = $('iframe'); var playerOrigin = '*'; var status = $('.status'); // Listen for messages from the player if (window.addEventListener) { window.addEventListener('message', onMessageReceived, false); } else { window.attachEvent('onmessage', onMessageReceived, false); } // Handle messages received from the player function onMessageReceived(event) { //alert('lept going'); // Handle messages from the vimeo player only if (!(/^https?:\/\/player.vimeo.com/).test(event.origin)) { return false; } if (playerOrigin === '*') { playerOrigin = event.origin; } var data = JSON.parse(event.data); switch (data.event) { case 'ready': onReady(); break; case 'playProgress': onPlayProgress(data.data); break; } } // Helper function for sending a message to the player function …
has comment: http://stackoverflow.com/comment/47840679
favorite count: 0
has title: HasClass not detecting on elements that used Addclass
has comment: http://stackoverflow.com/comment/47840560
score: -2
has comment: http://stackoverflow.com/comment/47843915
tagged with: css

http://stackoverflow.com/comment/48088261
type: Comment
type: QuestionComment
score: 1
has text: You can avoid the closure variable.
comment on: http://stackoverflow.com/q/29984478

http://stackoverflow.com/comment/47839936
score: 0
type: AnswerComment
has text: When I enter my debugger, there are often times when a variable I'd like to see from the outside scope is simply inaccessible. It only happens for variables that never left their function level. So, that lends credence to this answer.
comment on: http://stackoverflow.com/a/29857000
type: Comment

http://stackoverflow.com/a/29932428
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/29932393
has body: I didn't read properly chrome.runtime.onMessage.addListener( function(request, sender, sendResponse) { // sendResponse({"message": "hi"}); //works getTotals(sendResponse); return true; } } Solved the problem: According to the documentation This function becomes invalid when the event listener returns, unless you return true from the event listener to indicate you wish to send a response asynchronously (this will keep the message channel open to the other end until sendResponse is called). Hope this helps someone else in the future.
downvote count: 0
type: Answer

http://stackoverflow.com/a/29925583
type: Answer
score: 1
has body: This will do it for you: $('input').blur(function(e){ $(this).val($(this).val().trim()); }) See this fiddle. Add spaces before and after your input and hit tab...
upvote count: 1
answers question: http://stackoverflow.com/q/29925527
has comment: http://stackoverflow.com/comment/48230203
downvote count: 0

http://stackoverflow.com/a/29864835
type: Answer
upvote count: 1
has body: Make 2 tables: table_name: questions Fields question_id - int(11) PK question_text - text question_created_datetime - datetime table_name: answer Fields answer_id - int(11) PK question_id - int(11) FK answer_text - text answer_added_datetime - datetime
score: 1
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29864741
answers question: http://stackoverflow.com/q/29864741
has comment: http://stackoverflow.com/comment/47855101

http://stackoverflow.com/q/29960404
tagged with: jquery-clone
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29960488
has comment: http://stackoverflow.com/comment/48041379
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29960629
has title: How does this closure work when using JQuery clone() and selecting descendant element
type: Question
accepted answer: http://stackoverflow.com/a/29960488
answer count: 2
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/29960629
has body: In the below code when the user clicks the "click me" div a new list item is "cloned" and it works the way I would expect. JSfiddle_1 HTML Click me oink JavaScript $(".button").on("click",function(){ var result = $('.template li').clone(); //______Descendant selector $("ul").append(result); }); However, in the version of the code below I modified the code to not have a descendant selector. In this version when you click the "click me" div the number of elements is compounded on each click which tells me a closure is happening, but what I don't understand is why this doesn't happen when adding a descendant selector. Any clarification is appreciated. Thank you JSfiddle_2 HTML Click me oink JavaScript $(".button").on("click",function(){ var result = $('li').clone(); //______No descendant selector $("ul").append(result); });
score: 0

http://stackoverflow.com/a/29910467
upvote count: 8
has comment: http://stackoverflow.com/comment/47944635
type: Answer
has body: In your code you just need to change the code like below, svg.append("svg:line") .attr("class", "today") .attr("x1", x(d3.time.format("%x").parseDate(today))) .attr("y1", height) .attr("x2", x(d3.time.format("%x").parseDate(today))) .attr("y2", 0); to svg.append("svg:line") .attr("class", "today") .attr("x1", x(theDate)) .attr("y1", height) .attr("x2", x(theDate)) .attr("y2", 0); d3.time.format("%x") this will return a function which takes date object as argument and it returns date string in %x format. But you are calling parseDate function which is not available/defined. Refer this Hope you got it, if not ask me for more.
has comment: http://stackoverflow.com/comment/47950691
accepted answer of: http://stackoverflow.com/q/29910194
has comment: http://stackoverflow.com/comment/47944306
downvote count: 0
answers question: http://stackoverflow.com/q/29910194
type: AcceptedAnswer
score: 8

http://stackoverflow.com/comment/48049932
type: Comment
type: QuestionComment
score: 0
has text: You need to calculate how many lines your text is going to occupy and split it into party accordingly, which you can then render in different divs. I suggest doing that by first putting the entire text into an invisible div and dividing the div's height by the text line height to get the number of lines. Then you know the amount of pages you need to draw. And then you need to start searching for where the lines actually end. I suggest doing that by inserting a span with dimensions 0x0 and reading its position relative to the outer div.
comment on: http://stackoverflow.com/q/29963402

http://stackoverflow.com/comment/47855570
has text: @SparshKhandelwal that is in the case if there are multiple ng-app attributes... here you are using auto initialization and manual initialization which is causing the multiple initialization error
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29865226
score: 1

http://stackoverflow.com/a/45121431
has comment: http://stackoverflow.com/comment/113655302
downvote count: 0
has comment: http://stackoverflow.com/comment/82045470
has body: Here's a solution that flattens in place. function flatten(arr) { var i = 0; if (!Array.isArray(arr)) { /* return non-array inputs immediately to avoid errors */ return arr; } while (i &lt; arr.length) { if (Array.isArray(arr[i])) { arr.splice(i, 1, ...arr[i]); } else { i++; } } return arr; } This solution iterates through the array, flattening each element one level of nesting at a time until it cannot be flattened any more.
score: 3
upvote count: 3
answers question: http://stackoverflow.com/q/29991016
has comment: http://stackoverflow.com/comment/100429499
type: Answer
has comment: http://stackoverflow.com/comment/81984056

http://stackoverflow.com/comment/48106994
has text: I tried with this : http://blog.modulus.io/node.js-tutorial-how-to-use-request-module It worked but this is not optimized code, for many functions I need to write many times. while this would optimize. Please let me know how to do this
type: AnswerComment
comment on: http://stackoverflow.com/a/29988115
score: 0
type: Comment

http://stackoverflow.com/q/29876733
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29877324
has title: CSS3 onclick animation
tagged with: css
accepted answer: http://stackoverflow.com/a/29877212
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/29877324
has comment: http://stackoverflow.com/comment/47877864
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/47877762
score: 0
has answer: http://stackoverflow.com/a/29877212
answer count: 2
has comment: http://stackoverflow.com/comment/47877813
has body: Trying to learn the basics of CSS3 animation and onclick events but I'm stuck. I want to use button id="3" to start the animation, the red square as you as can see here: https://jsfiddle.net/4swmegpn/ And button id="4" to stop/reset the animation of the red square. I just don't know where to start. I've started with adding onclick to: &lt;button id="button1" onClick=""&gt; &gt; &lt;/button&gt; But after that I can't come up with what to do. Something to call and activate "keyframes example" from the css-file, but not sure how to.

http://stackoverflow.com/a/29988348
accepted answer of: http://stackoverflow.com/q/29970669
answers question: http://stackoverflow.com/q/29970669
upvote count: 1
type: AcceptedAnswer
has body: Hear In odoo 8.0 You can add the two different way to add the JavaScript file in your template view 1. Add in as the TAG specify :: 2. Add the inside the .(dot) specify :: in the template has the id Attribute :> Unique identify each record inherit_id Attribute :> Inherited template id which is specify in two different way I.use the direct id if for the same module (template_id) II.use with the inherited module template id (module_name.template_id) And Also name and group all other attributes which are use in template the based on the XPATH Tag with position attribute You can add your JavaScript file on different position like before,after,inside,replace I hope this should helpful for you .. :)
type: Answer
downvote count: 0
score: 1

http://stackoverflow.com/comment/48179663
has text: This worked perfectly. Is there a way to also set the readFile to not return data until the reader is done or is that done by the onload trigger?
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29992460
type: AnswerComment

http://stackoverflow.com/comment/48108801
comment on: http://stackoverflow.com/a/29994458
score: 0
type: AnswerComment
has text: @Xalloumokkelos That is portion asked about at comments above. _"The first is to sort it by data-order value ascending, and the other through an array where it will be in this sorting 3-1-2"_ ? Not entirely clear, here. elements appended to document in order 1-2-3 ?, `elArray` in order 3-1-2 ?
type: Comment

http://stackoverflow.com/comment/47843943
comment on: http://stackoverflow.com/q/29858840
score: 0
type: Comment
type: QuestionComment
has text: Yes this is possible. You have to send a message from the iFrame, when parent receives the message, then you do something.

scope
tags question: http://stackoverflow.com/q/29871496
tags question: http://stackoverflow.com/q/29847133
tags question: http://stackoverflow.com/q/29977149
tags question: http://stackoverflow.com/q/29998219
tags question: http://stackoverflow.com/q/29921701
tags question: http://stackoverflow.com/q/29917233
tag name: scope
tags question: http://stackoverflow.com/q/29985304
type: Tag
tags question: http://stackoverflow.com/q/29893496
tags question: http://stackoverflow.com/q/29883489
tags question: http://stackoverflow.com/q/29983585

http://stackoverflow.com/a/29991411
accepted answer of: http://stackoverflow.com/q/29990316
upvote count: 2
type: Answer
score: 2
has body: The answer provided by James Wilkins is correct. There is only one instance of BaseColumn being created and it's shared by all instances of Columns through Column.prototype However, it's worth noting that your way of establishing inheritance is incorrect. There's no need to instantiate a parent just to set up inheritance, and you need to call the parent's constructor from your constructor. See my posts at http://js-bits.blogspot.com/2010/08/javascript-inheritance-done-right.html and http://js-bits.blogspot.com/2014/10/understanding-prototypical-inheritance.html for further details The following example works fine. var BaseColumn = function() { this.model = {}; this.model.name = ""; this.name = ""; }; var Column = function(name) { // Call the parent's constructor, a new model object will be created // instead of using a shared one from the prototype BaseColumn.apply(this); this.model.name = name; this.name = name; }; Column.prototype = Object.create(BaseColumn.prototype); var col1 = new Column("Column1"); var col2 = new Column("Column2"); console.log(col1.name); //Returns "Column1" console.log(col2.name); //Returns "Column2" console.log(col1.model.name); //Returns "Column1" console.log(col2.model.name); //Returns "Column2"
answers question: http://stackoverflow.com/q/29990316
has comment: http://stackoverflow.com/comment/48215138
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/48047350
type: AnswerComment
has text: yes sur i tried everythig that appear logic and some illogic also :D
comment on: http://stackoverflow.com/a/29963258
type: Comment
score: 0

http://stackoverflow.com/comment/47970482
has text: Thank you I wish there was something like `import x from 'module' use someoptions;` kinda of syntax
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29924193
score: 11

http://stackoverflow.com/q/29884055
has title: Create Dynamic Body using cocos 2d js and Chipmunk
score: 1
tagged with: cocos2d-js
type: Question
tagged with: game-physics
tagged with: javascript
has answer: http://stackoverflow.com/a/29896568
accepted answer: http://stackoverflow.com/a/29896568
has body: I am fairly new to cocos 2d and chipmunk. So far i have managed to create a static object and add collision handler to it. But i want to create a dynamic. this.space = space; this.sprite = new cc.PhysicsSprite("#rock.png"); var body = new cp.StaticBody(); body.setPos(pos); this.sprite.setBody(body); this.shape = new cp.BoxShape(body, this.sprite.getContentSize().width, this.sprite.getContentSize().height); this.shape.setCollisionType(SpriteTag.rock); this.space.addStaticShape(this.shape); spriteSheet.addChild(this.sprite); But i want to create a dynamic body similarly which moves for example by: cp.v(310, 0), cp.v(0, 0) This is very basic I know but I would grateful if someone would help me with this. Also if you have good documentation in of cocos 2d and chipmunk in JS. do share it. Thanks
upvote count: 1
answer count: 1
tagged with: cocos2d-x
favorite count: 0
type: AnsweredQuestion
tagged with: chipmunk
downvote count: 0

http://stackoverflow.com/a/29995071
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/48122439
type: Answer
has comment: http://stackoverflow.com/comment/48110917
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29994984
score: 1
answers question: http://stackoverflow.com/q/29994984
has comment: http://stackoverflow.com/comment/48111444
has comment: http://stackoverflow.com/comment/48120092
has comment: http://stackoverflow.com/comment/48117341
has comment: http://stackoverflow.com/comment/48110065
has comment: http://stackoverflow.com/comment/48110722
has comment: http://stackoverflow.com/comment/48110211
has body: It seems to me that you have to change your code a little. You should always test that you call $.jgrid.getCellIndex with DOM of &lt;td&gt; element and not with some other children of it. The code fragment of typical usage of $.jgrid.getCellIndex should be the following: var $td = $(e.target).closest("tr.jqgrow&gt;td"); if ($td.length &gt; 0) { var iCol = $.jgrid.getCellIndex($td); ... }
has comment: http://stackoverflow.com/comment/48122706

concurrency
tag name: concurrency
tags question: http://stackoverflow.com/q/29867356
type: Tag

http://stackoverflow.com/comment/47916753
comment on: http://stackoverflow.com/a/29896932
type: Comment
has text: I need the event to be fired when a key is pressed not on clicks, but thanks for suggesting
score: 0
type: AnswerComment

http://stackoverflow.com/q/29880224
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47885091
has comment: http://stackoverflow.com/comment/47886802
has answer: http://stackoverflow.com/a/29888714
has comment: http://stackoverflow.com/comment/47885045
has comment: http://stackoverflow.com/comment/47901054
has comment: http://stackoverflow.com/comment/47885232
has body: I want to get the parameter from a input form which is set on my index.html: GET: &nbsp On my servlet I want to get this parameter by request.getparameter("name2") protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { System.out.println("Get"); System.out.println(request.getParameter("name2")); if(!request.getParameter("name2").equals("")) { numer = request.getParameter("name2"); serviceConnection(request, response); } } but when I am starting my application the system.out.println is just printing the null variable. On my ajaxvalidator javascript file I wrote this: function validate2() { var idField = document.getElementById("name2"); var data = "name2=" + encodeURIComponent(idField.value); if (typeof XMLHttpRequest != "undefined") { req = new XMLHttpRequest(); } else if (window.ActiveXObject) { req = new ActiveXObject("Microsoft.XMLHTTP"); } var url = "Validator" req.open("GET", url, true); req.onreadystatechange = inserter2 req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); req.send(data); } function inserter2() { if (req.readyState == 4) { if (req.status == 200) { var msg1 = req.responseText if (msg1 == "") { document.getElementById("msg").innerHTML = " Wadliwa nazwa "; document.getElementById("org").value = ''; } else { document.getElementById("org").value = msg1; } } } How to solve this problem?
has title: Getting parameter from a doGet in Servlet using Ajax
linked to: http://stackoverflow.com/q/2349633
downvote count: 1
has comment: http://stackoverflow.com/comment/47885301
type: Question
linked to: http://stackoverflow.com/q/2793150
upvote count: 5
tagged with: java
tagged with: javascript
score: 4
tagged with: servlets
has comment: http://stackoverflow.com/comment/47884963
linked to: http://stackoverflow.com/q/4112686
has comment: http://stackoverflow.com/comment/47884909
answer count: 1
has comment: http://stackoverflow.com/comment/47885258
has comment: http://stackoverflow.com/comment/47884947
favorite count: 0
tagged with: ajax

http://stackoverflow.com/q/29915666
answer count: 0
upvote count: 3
type: Question
tagged with: angularjs-directive
score: 3
has title: Angular UI typeahead model changed
tagged with: javascript
downvote count: 0
tagged with: angular-ui
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/48358704
has comment: http://stackoverflow.com/comment/48358732
has body: I have a strange situation with ui typeahead. For some reason when results come the ng-model is changed to first result of results. That is problem to me because I have on-enter event in which I need to use value from input. Here is HTML: &lt;input type="search" dropdown-toggle class="form-control input--search" pw-enter="searchEnter()" placeholder="Search" typeahead="result.text for result in getSearchResult($viewValue)" ng-model="search.query" typeahead-template-url="views/search-custom.html" typeahead-wait-ms="300" typeahead-focus-first="false" &gt; Code: $scope.getSearchResult = function (query) { return SearchService.getResults(query); }; $scope.searchEnter = function(){ $location.path('/advance-search').search({query : $scope.search.query}); }; As you can see it is search implementation and on-enter I need to go to advance search with value that is searched ($scope.search.query) but for some reason that value is changed to first result in results as I mentioned. How can I fix this or is there any workaround?

http://stackoverflow.com/q/29907619
has comment: http://stackoverflow.com/comment/47938818
has comment: http://stackoverflow.com/comment/47938578
has comment: http://stackoverflow.com/comment/47938337
score: 0
has comment: http://stackoverflow.com/comment/47938145
linked to: http://stackoverflow.com/q/13840429
has comment: http://stackoverflow.com/comment/47940432
upvote count: 1
answer count: 1
downvote count: 1
duplicate of: http://stackoverflow.com/q/13840429
has comment: http://stackoverflow.com/comment/47940702
tagged with: javascript
type: UnansweredQuestion
tagged with: forms
has comment: http://stackoverflow.com/comment/47939874
has body: I've been searching around for an answer to my question. Many other people have asked the same question but did not get an answer to their question. The question is this. I have the following code. function follow_button(){ global $wpdb, $bp; $loguser = $bp-&gt;loggedin_user-&gt;id; $disuser = $bp-&gt;displayed_user-&gt;id; if($loguser == $disuser){ } else { $results = $wpdb-&gt;get_results("SELECT * FROM followers WHERE user = $loguser AND profile = $disuser"); if(empty($results)){ echo '&lt;form id="followsubmit" action="" method="post"&gt; &lt;input type="hidden" name="follow_button" value="follow"&gt; &lt;input type="submit" name="submit" value="follow"&gt;&lt;/form&gt;'; } else { echo '&lt;form id="followsubmit" action="" method="post"&gt; &lt;input type="hidden" name="unfollow_button" value="unfollow"&gt; &lt;input type="submit" name="submit" value="unfollow"&gt;&lt;/form&gt;'; } } if( isset( $_POST['follow'] ) &amp;&amp; strlen( $_POST['follow'] )) {follow_function();} if( isset( $_POST['unfollow'] ) &amp;&amp; strlen( $_POST['unfollow'} )) {unfollow_function();} } } The above code works fine. But I ran into some problems when I started adding more forms to the same page such as this one listed above. My problem that im having is, if I were to click the Follow (or unfollow) button, all the other forms will also submit. I realize where my problem was. if( isset( $_POST['justsomeform'] ) &amp;&amp; strlen( $_POST['justsomeform'} )) {justsomeotherfunction();} note: all my other forms have set value such as the one listed above. Because they are all set, and they all have a value, they would call the php function even though I did not click on them. After researching, onclick I tried to put the function inside the form onclick action.. eg.. &lt;form action="" method="post"&gt; &lt;input type="hidden" name="cheese" value="yellocheese"&gt; &lt;input type="submit" name="submit" onclick="' . doafunction() . '" value="I like Cheese"&gt;&lt;/form&gt; But that didn't wo…
has comment: http://stackoverflow.com/comment/47938857
has comment: http://stackoverflow.com/comment/47937848
has answer: http://stackoverflow.com/a/29909467
tagged with: jquery
favorite count: 0
has title: html form on click do php function
type: Question
has comment: http://stackoverflow.com/comment/47940932
tagged with: http://stackoverflow.com/tag/html
tagged with: php

http://stackoverflow.com/q/29975014
type: Question
tagged with: asp.net-mvc
tagged with: javascript
tagged with: jquery
linked to: http://stackoverflow.com/q/7556400
answer count: 2
upvote count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/29975100
has comment: http://stackoverflow.com/comment/48069908
has comment: http://stackoverflow.com/comment/48071048
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29975155
has comment: http://stackoverflow.com/comment/48070990
tagged with: asp.net-mvc-4
downvote count: 0
has body: If I use @section scripts in partial view. page is not rendering script. But If remove @section scripts js rendering to the page. What is the difference? Can't I use directly &lt;Script&gt; in partialviews? not good practice? @section scripts { &lt;script type="text/javascript"&gt; $("#SideMenu &gt; li").each(function () { //Find the inner element with active class $(this).find('.active').removeClass('active'); }); &lt;/script&gt; }
score: 1
has title: JQuery/JS in MVC PartialViews?

http://stackoverflow.com/comment/47993189
has text: Please post your code.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29935705

http://stackoverflow.com/comment/48443762
has text: Sorry, I can not help you. I have no iThings.
type: QuestionComment
comment on: http://stackoverflow.com/q/29894994
score: 0
type: Comment

http://stackoverflow.com/q/29935827
has body: I am doing a POC for isomorphic JavaScript application to render HTML from the server side. The POC is working with simple HTML, but I want to make an API call and get the JSON response and send to the render function. I tried various ways but it is not working. What am I missing? I am very new to React.js. loadCategoriesFromServer: function() { var self = this; // get walking directions from central park to the empire state building var http = require("http"); url = "api url here"; var request = http.get(url, function (response) { // data is streamed in chunks from the server // so we have to handle the "data" event var buffer = "", data, route; response.on("data", function (chunk) { buffer += chunk; }); response.on("end", function (err) { data = JSON.parse(buffer); //console.log(data.d); //console.log(data.d.Items); self.setState({ categories: data.d.Items }); }); }); }, // load from server end getInitialState: function() { return { categories: [] }; }, componentWillMount: function() { console.log("calling load categories") this.loadCategoriesFromServer(); }, render: function () { //console.log("data"); //console.log(this.state.categories); var postNodes = this.state.categories.map(function (cat) { console.log(cat); }); return ( //i want to paint the data here.. ) } });
has answer: http://stackoverflow.com/a/30724854
tagged with: isomorphic-javascript
has answer: http://stackoverflow.com/a/29938692
answer count: 3
has comment: http://stackoverflow.com/comment/47995422
upvote count: 23
has answer: http://stackoverflow.com/a/29942901
type: UnansweredQuestion
has title: Making RESTful API call from React.js
tagged with: reactjs
has comment: http://stackoverflow.com/comment/47994597
has comment: http://stackoverflow.com/comment/47995585
downvote count: 0
tagged with: javascript
score: 23
favorite count: 0
type: Question

http://stackoverflow.com/a/29880322
score: 1
has body: 1) in your code, the casing isn't correct masterTooltip is cased differently in the HTML and JS (assuming you did a copy paste). 2) What version of FireFox are you using? When I attempt to reproduce the error in this fiddle: http://jsfiddle.net/Lxwq3jwq/3. $('.masterTooltip').hover(function () { // Hover over code var title = $(this).attr('title'); $(this).data('tipText', title).removeAttr('title'); $('&lt;p class="tooltip"&gt;&lt;/p&gt;') .text(title) .appendTo('body') .fadeIn('slow'); }, function () { // Hover out code $(this).attr('title', $(this).data('tipText')); $('.tooltip').remove(); }).mousemove(function (e) { var mousex = e.pageX + 20; //Get X coordinates var mousey = e.pageY + 10; //Get Y coordinates $('.tooltip') .css({ top: mousey, left: mousex }) }); I find that everything seems to be working but I'm using the latest firefox. I'm going to assume that this is a CSS3 issue, since I can't seem to find issues with the js or HTML, other than the casing issue. I'm going to assume the pink background color with white text is just for demonstration, otherwise please increase the contrast. 3) When reproducing an issue for this code, please use a fiddle so its easier for people to reproduce this issue, so you can be helped easier in the future.
upvote count: 1
type: Answer
answers question: http://stackoverflow.com/q/29879802
downvote count: 0

http://stackoverflow.com/q/29931050
answer count: 2
tagged with: geckofx
downvote count: 0
score: 1
favorite count: 0
tagged with: winforms
linked to: http://stackoverflow.com/q/17803409
accepted answer: http://stackoverflow.com/a/29936802
type: AnsweredQuestion
upvote count: 1
type: Question
tagged with: c#
has title: Disable JavaScript Alerts GeckoFX C#
possible better answer: http://stackoverflow.com/a/29932722
has answer: http://stackoverflow.com/a/29936802
has body: I'm trying to disable JavaScript alert in GeckoFX-33 + xulrunner 33 ( winforms c# ) but I can't find a solution. I check the example codes, source code but I just can't find something that blocks the alert out. I searched in about:config as well without success. Anybody knows where I could find a reference at last ?
tagged with: javascript
has answer: http://stackoverflow.com/a/29932722

http://stackoverflow.com/q/29929788
type: Question
has body: I have a file upload functionality in my application which can not upload JSON files which are more than 10MB in size. If user uploads a file >= 10 MB , My app should split it into smaller JSON files each less than 10MB. Also, the Proper JSON objects needs to be maintained in the new low-sized files. Is there a way to do this in Javascript or jQuery?
has comment: http://stackoverflow.com/comment/47982238
tagged with: filesplitting
downvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47981843
has answer: http://stackoverflow.com/a/29930208
has title: Split A large JSON into Smaller parts in Javascript/jQuery
answer count: 1
favorite count: 0
upvote count: 2
type: UnansweredQuestion
score: 2
has comment: http://stackoverflow.com/comment/47981876
tagged with: http://stackoverflow.com/tag/json

http://stackoverflow.com/comment/48000403
type: QuestionComment
comment on: http://stackoverflow.com/q/29939635
score: 4
has text: In _Base64_, `4` chars represents `3` bytes and `=`s on the end let you know how many bytes short the final _String_ (so you don't carry `0`s)
type: Comment

http://stackoverflow.com/a/29887412
answers question: http://stackoverflow.com/q/29887352
upvote count: 2
has body: The mistake is : Just change in your code from var timerID = setInterval("CountdownTimer()",1000); to var timerID = setInterval(CountdownTimer,1000);
type: Answer
has comment: http://stackoverflow.com/comment/47900692
has comment: http://stackoverflow.com/comment/47899141
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/47898649

http://stackoverflow.com/q/29998272
tagged with: javascript
tagged with: polymorphism
tagged with: inheritance
has answer: http://stackoverflow.com/a/29998379
favorite count: 0
has body: Right, so I know Java fairly well but I never studied extensively into JavaScript. I was chatting with an acquaintance who knows JavaScript, but who has not studied into Java. He was telling me about the advantages of JavaScript over Java in terms of how it functions but not its uses. Specifically, he was telling me about "prototyping" and what he explained seems to be the concepts of polymorphism and inheritance, but classless. Is this true? I told this person that it seems this way, and he told me that prototyping is nothing at all like inheritance or polymorphism, and he told me to research it. Google isn't helping me out much in terms of comparing the two languages so I'm here in hopes of finding someone who knows both and can shed some light here.
has title: Is there anything similar to JavaScript's "prototype" in Java?
has comment: http://stackoverflow.com/comment/48116028
accepted answer: http://stackoverflow.com/a/29998330
upvote count: 2
has comment: http://stackoverflow.com/comment/48116036
score: 2
type: AnsweredQuestion
tagged with: java
tagged with: prototype
has answer: http://stackoverflow.com/a/29998330
type: Question
answer count: 2
downvote count: 0
possible better answer: http://stackoverflow.com/a/29998379

http://stackoverflow.com/a/29935019
answers question: http://stackoverflow.com/q/29934688
score: 0
accepted answer of: http://stackoverflow.com/q/29934688
has body: Since you mentioned in the comments you want this: continuouspantiltmove=-100,-50&amp;other=values Then this will do it: function button_axisleft() { if (alr &gt; 100) { alr = 100; } if (alr &lt; -100) { alr = -100; } alr = alr - 1; pt = alr + "," + aud; $.get('http://192.168.1.59/axis-cgi/com/ptz.cgi?continuouspantiltmove=' + pt, { camera: 1, imagerotation: 0, }, function (msg) { console.log('OK'); }); } You had extra single quotes (') around the numbers in your pt variable. And, according to your comment, you don't want those, so I removed them. It also seems that jQuery automatically URL-encodes some characters, such as the comma, and that's why your query string was looking weird. By including the query parameter directly in your URL string, we can skip jQuery's auto-encoding. However, you should also check this out: Can I use commas in a URL?
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47992264
type: Answer
has comment: http://stackoverflow.com/comment/47992121

http://stackoverflow.com/comment/47841541
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29857759
has text: No that doesnt fix the problem, it still is only default font, but bold
score: 0

http://stackoverflow.com/comment/48128197
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29995812
has text: Thanks a Lot! .it worked well as i intended ..that was really helpful! :)
type: AnswerComment

http://stackoverflow.com/comment/47899914
comment on: http://stackoverflow.com/q/29874536
has text: Yes I will give the user, a option to map their column to my columns of predefined template. Now my problem is , after mapping how will i dynamically change the grid headers column.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/48114958
type: Comment
score: 5
comment on: http://stackoverflow.com/q/29997705
has text: CORS is there for a reason. So unless you have access to the target server to change the CORS policy, you will not be able to circumvent it.
type: QuestionComment

http://stackoverflow.com/comment/47861578
type: QuestionComment
comment on: http://stackoverflow.com/q/29867967
has text: Use native javascript. It's easy to implement it. Just set an attribute with a counter . Use a condition to check whether the counter is set or not ..
type: Comment
score: 0

http://stackoverflow.com/comment/48052732
has text: Note that the [`click` event on many browsers](http://stackoverflow.com/questions/9972280/onclick-on-option-tag-not-working-on-ie-and-chrome) will fail to work on ` ` tags. Better to do it on the ` `.
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29966537

http://stackoverflow.com/q/29958072
type: Question
tagged with: javascript
tagged with: jquery
upvote count: 3
answer count: 2
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/29958080
favorite count: 0
has answer: http://stackoverflow.com/a/29958080
possible better answer: http://stackoverflow.com/a/29958104
type: AnsweredQuestion
score: 3
has answer: http://stackoverflow.com/a/29958104
downvote count: 0
has title: Copy Title Attribute Value and Insert as InnerHTML
has body: I have Auto-Generated Code in our CMS based Website like this I want to copy that href title or Image alt value and insert as below How can i do that in using javascript or Jquery. This code is in Gallery page. so this is repeating for every images

http://stackoverflow.com/comment/48076874
has text: Thanks! Choosing this one, because it also solves my problem in development code. The `filter` was for some reason removing all my tag objects.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29978323
type: Comment

http://stackoverflow.com/comment/47899877
score: 0
type: Comment
type: QuestionComment
has text: Why all the hubb bubb here? The first comment from @FelixKling seemed to answer the question. In fact the OP linked to the Mozilla docs for for...of and if you followed the link about iterable objects it answered the question.
comment on: http://stackoverflow.com/q/29886552

custom-type
tag name: custom-type
tags question: http://stackoverflow.com/q/29997155
type: Tag

http://stackoverflow.com/comment/47941625
comment on: http://stackoverflow.com/q/29898832
type: Comment
type: QuestionComment
has text: use `$(element).addClass('fc-state-custom-hide')` && use css `.fc-state-custom-hide{ display:none;}`
score: 0

http://stackoverflow.com/comment/47961557
has text: Yes I need to use nodejsin the server side . Check this : https://erikberg.com/api/examples/nodejs I want to get the data as in this example and show them using angular js in my browser
type: Comment
score: 0
comment on: http://stackoverflow.com/a/29918964
type: AnswerComment

http://stackoverflow.com/comment/47997272
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29937414
has text: Welcome to SO. Just as a heads up. Ideally you should provide some sample code... as a help me fix my problem question isn't normally as well received as this one

http://stackoverflow.com/comment/48001336
has text: I have looked at them but it seems that I could not find anything applicable
type: QuestionComment
comment on: http://stackoverflow.com/q/29939999
score: 0
type: Comment

http://stackoverflow.com/a/29924193
has comment: http://stackoverflow.com/comment/75449133
has comment: http://stackoverflow.com/comment/137653521
has comment: http://stackoverflow.com/comment/47970850
has comment: http://stackoverflow.com/comment/97164667
upvote count: 137
has body: There is no way to do this with a single import statement, it does not allow for invocations. So you wouldn't call it directly, but you can basically do just the same what commonjs does with default exports: // module.js export default function(options) { return { // actual module } } // main.js import m from 'module'; var x = m(someoptions); Alternatively, if you use a module loader that supports monadic promises, you might be able to do something like System.import('module').ap(someoptions).then(function(x) { … }); With the new import operator it might become const promise = import('module').then(m =&gt; m.default(someoptions)); or const x = (await import('module')).default(someoptions) however you probably don't want a dynamic import but a static one.
answers question: http://stackoverflow.com/q/29923879
score: 137
has comment: http://stackoverflow.com/comment/49927461
has comment: http://stackoverflow.com/comment/97162169
downvote count: 0
has comment: http://stackoverflow.com/comment/75439060
has comment: http://stackoverflow.com/comment/66645272
type: Answer
has comment: http://stackoverflow.com/comment/47970482
has comment: http://stackoverflow.com/comment/47970754
has comment: http://stackoverflow.com/comment/47971832

http://stackoverflow.com/comment/47864163
has text: do you want to increase it by time or depending on page? is it single page app or are those pages requested separately?
score: 1
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29869458

http://stackoverflow.com/comment/48046004
score: 0
type: AnswerComment
has text: so any suggestion plz I am tied to remove these characters
type: Comment
comment on: http://stackoverflow.com/a/29962684

http://stackoverflow.com/q/29931072
has answer: http://stackoverflow.com/a/29931255
tagged with: http://stackoverflow.com/tag/html
score: 2
possible better answer: http://stackoverflow.com/a/29931255
upvote count: 2
has answer: http://stackoverflow.com/a/29931261
type: AnsweredQuestion
tagged with: slidetoggle
has title: Slidetoggle 2 adjacent divs
type: Question
answer count: 2
accepted answer: http://stackoverflow.com/a/29931261
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
has body: Blabla1 Amministrazione some link some link Didattica some link Blabla2 Amministrazione some link Didattica some link some link Blabla3 Amministrazione Didattica Blabla4 Amministrazione Didattica some link I'd like to have .amministrazione, .didattica and all the links on display:none by default. When user clicks on .unique1 or .unique2 or .unique3 or .unique4 (only) the next .amministrazione AND .didattica slidetoggle down. Here's what I have so far.. but it's not toggling the correct elements: jQuery(function () { jQuery('.unique1, .unique2, .unique3, .unique4').click(function () { var index = $(this).index(), newTarget = jQuery('.amministrazione, .didattica').eq(index).slideDown(); jQuery('.amministrazione, .didattica').not(newTarget).slideUp(); }); }); http://jsfiddle.net/2rgqpzpt/

http://stackoverflow.com/comment/47916716
comment on: http://stackoverflow.com/a/29890347
score: 0
type: AnswerComment
type: Comment
has text: Hey @Radonirina, thank you so much for your patience and help, finally it works as I wanted! have a nice day!

http://stackoverflow.com/q/30001979
has comment: http://stackoverflow.com/comment/48124234
has body: I have this code on my Create view. &lt;div class="col-lg-6"&gt; &lt;!--Ingredients--&gt; @Html.LabelFor(model =&gt; model.Ingredients, htmlAttributes: new { @class = "control-label col-md-2" })&lt;br /&gt; &lt;textarea class="form-control" id="ingredients" rows="20" onsubmit="PopulateIngredients()"&gt;&lt;/textarea&gt; &lt;/div&gt; &lt;script&gt; function PopulateIngredients() { var ingredientArray = document.getElementById('ingredients').val().split('/n'); if (ingredientArray.length !=0) { for (i = 0; i &lt; ingredientArray.length; i++) { @(Model.Ingredients).Add(ingredientArray[i]); } } } &lt;/script&gt; When the page is loading I get an error in the script saying "Object reference not set to an instance of an object." at this line; @(Model.Ingredients).Add(ingredientArray[i]); Two problems exist. One is that I should be seeing the model.Ingredients IEnumerable object. Two is that his script shouldn't run until the submit button is clicked. What am I doing wrong? I have to use a text area for input so I have to split it and add it to the ingredient list before it is posted back to the controller where it is handled as a list of ingredient objects. I did not include the classes for brevity.
linked to: http://stackoverflow.com/q/17989683
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/779091
tagged with: razor
type: Question
has title: Why Does my Javascript Function Run on Load
tagged with: asp.net-mvc
has answer: http://stackoverflow.com/a/30002875
has comment: http://stackoverflow.com/comment/48123918
has comment: http://stackoverflow.com/comment/48122548
answer count: 2
has comment: http://stackoverflow.com/comment/48122598
has answer: http://stackoverflow.com/a/30002055
tagged with: javascript
linked to: http://stackoverflow.com/q/5614941
score: 0
has comment: http://stackoverflow.com/comment/48124140
has comment: http://stackoverflow.com/comment/48124360
has comment: http://stackoverflow.com/comment/48122611

http://stackoverflow.com/comment/47832365
has text: add the 'ma.js' code for the controller..
comment on: http://stackoverflow.com/q/29853237
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29898042
answers question: http://stackoverflow.com/q/29897810
has body: There are two other ways of doing this: using bind, using a closure Using bind: function myFunction(requestObj, myArray) { for(var i=0;i&lt;myArray.length;i++) { makeAjaxCall(requestObj, function(idx,data) { //idx will be correct value }.bind(null,i)); } } Using a closure: function myFunction(requestObj, myArray) { for(var i=0;i&lt;myArray.length;i++) { (function(idx){ makeAjaxCall(requestObj, function(data) { //idx will be correct value }); })(i); } } There is also third method, use another function to create your callback function myFunction(requestObj, myArray) { function makeCB(idx){ return function(){ //do stuff here } } for(var i=0;i&lt;myArray.length;i++) { makeAjaxCall(requestObj, makeCB(i)); } }
score: 0
type: Answer

http://stackoverflow.com/a/29920759
upvote count: 1
has comment: http://stackoverflow.com/comment/47962880
answers question: http://stackoverflow.com/q/29920591
downvote count: 0
score: 1
type: Answer
has body: It does not update correctly because you are counting the elements before it is removed. The animation is asynchronous. clickedItem.animate({ //this is asynchronous opacity: 0.0 }, 500, 'swing', function(){ //this is called after updateCounter() was called clickedItem.remove(); updateCounter(); //count after it is removed });

http://stackoverflow.com/q/29962617
score: 4
has comment: http://stackoverflow.com/comment/48048105
has title: Why I am getting � at the start of ajax response?
upvote count: 4
answer count: 2
has comment: http://stackoverflow.com/comment/48050873
downvote count: 0
linked to: http://stackoverflow.com/q/3255993
has body: Here is my JavaScript code: $('#tags').select2({ tags: true, tokenSeparators: [','], createSearchChoice: function (term) { return { id: $.trim(term), text: $.trim(term) + ' (new tag)' }; }, ajax: { url: '&lt;?php echo site_url('home_page/get_tags');?&gt;', dataType: 'json', data: function(term, page) { return { q: term }; }, results: function(data, page) { alert(data); return { results: data }; } }, My controller: public function get_tags() { $data= $this-&gt;common_model-&gt;get_tags_list(); $d = json_encode($data); echo $d; } The AJAX response I am getting: ����������[{"tag_id":"1","tag_list":"#follow"},{"tag_id":"2","tag_list":"#all_shots"},{"tag_id":"3","tag_list":"#instago"},{"tag_id":"4","tag_list":"#style"},{"tag_id":"5","tag_list":"#TFLers"},{"tag_id":"6","tag_list":"#follow"},{"tag_id":"7","tag_list":"#all_shots"},{"tag_id":"8","tag_list":"#instago"},{"tag_id":"9","tag_list":"#style"},{"tag_id":"10","tag_list":"#TFLers"},{"tag_id":"11","tag_list":"#igers"},{"tag_id":"12","tag_list":"#girl"},{"tag_id":"13","tag_list":"#colorful"},{"tag_id":"14","tag_list":"#nature"},{"tag_id":"15","tag_list":"#tree"},{"tag_id":"16","tag_list":"#green"},{"tag_id":"17","tag_list":"#skylovers"},{"tag_id":"18","tag_list":"shoes"},{"tag_id":"19","tag_list":"scaper"}] I want to remove these characters and get the response only which is sending from controller like below: [{"tag_id":"1","tag_list":"#follow"},{"tag_id":"2","tag_list":"#all_shots"},{"tag_id":"3","tag_list":"#instago"},{"tag_id":"4","tag_list":"#style"},{"tag_id":"5","tag_list":"#TFLers"},{"tag_id":"6","tag_list":"#follow"},{"tag_id":"7","tag_list":"#all_shots"},{"tag_id":"8","tag_list":"#instago"},{"tag_id":"9","tag_list":"#style"},{"tag_id":"10","tag_list":"#TFLers"},{"tag_id":"11","tag_list":"#igers"},{"tag_id":"12","tag_list":"#girl"},{"tag_id":"13","tag_list":"#colorful"},{"tag_id":"14","tag_list":"#nature"},{"tag_id":"15","tag_list":"#tree"},{"tag_id":"16","tag_list":"#green"},{"tag_id":"17","tag_list":"#skylove…
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/48047017
has comment: http://stackoverflow.com/comment/48045977
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29962684
tagged with: php
has comment: http://stackoverflow.com/comment/48045891
has comment: http://stackoverflow.com/comment/48046007
tagged with: http://stackoverflow.com/tag/json
tagged with: codeigniter
has comment: http://stackoverflow.com/comment/48045782
type: Question
has comment: http://stackoverflow.com/comment/48045864
has answer: http://stackoverflow.com/a/29963026
has comment: http://stackoverflow.com/comment/48045929
tagged with: javascript

http://stackoverflow.com/a/29907335
type: Answer
accepted answer of: http://stackoverflow.com/q/29883917
answers question: http://stackoverflow.com/q/29883917
type: AcceptedAnswer
has body: From further research it appears this is just not doable. So the best way to do this may be to provide an order array alongside my category array. If I add the additional code of: $parentCatOrder = array_keys($catsArray); in my proc_cats.php script I have a concise way of generating an index reference for my original array on the fly each time. This produces an array similar to: $parentCatOrder = {'categoryF', 'categoryA', 'categoryC'}; which has an index that I can refer to that keeps its order. So $parentCatOrder[2] will always produce 'categoryC' unless I've changed the array myself. I then return both arrays to javascript using the following: $return_data['catsarray'] = $catsArray; $return_data['parentcatsorder'] = $parentCatOrder; // Encode it back into a JSON object before sending echo json_encode($return_data); In javascript I can reference returnedCatsArray.catsarray[returnedCatsArray.parentcatsorder[1]][3] if I'm working with an index of 1-3 and guarantee this will produce the same result for every user unless the array has been changed by the user.
score: 0

http://stackoverflow.com/q/29945216
has title: Why does gulp-useref does not seem to work with a comment in the replacement section?
downvote count: 1
type: Question
upvote count: 36
tagged with: javascript
tagged with: gulp-useref
score: 35
has answer: http://stackoverflow.com/a/45510722
has comment: http://stackoverflow.com/comment/75215856
has body: I am trying to build a gulp pipeline – I want to inject some CSS into my index.html (this works fine) and then grab all the other links from source index.html and replace them in the outputted version. I noticed that the useref call is mangling the output if the templated section to replace includes an HTML comment (see example below for the line COMMENT). It’s easiest to demonstrate with code: index.html (source file) &lt;!-- build:css styles/app.css--&gt; &lt;!--COMMENT--&gt; &lt;link rel="stylesheet" href="/.tmp/styles.css"&gt; &lt;!-- endbuild --&gt; gulpfile.js task gulp.task('optimizeReplace', function () { var assets = $.useref.assets({ searchPath: './' }); return gulp .src('./src/client/index.html') .pipe(assets) .pipe(assets.restore()) .pipe($.useref()) //THIS IS THE PROBLEM LINE; IF INJECT IS NOT RUN FIRST IT IS MANGLED .pipe(gulp.dest('./wwwroot/')); }); Output (index.html) &lt;/style&gt; &lt;link rel="stylesheet" href="styles/lib.css"&gt; &lt;link rel="stylesheet" href="styles/app.css--&gt;" &lt;!--COMMENT&gt; &lt;/head&gt; &lt;body&gt; &lt;div&gt; The problem is easier to see in HTML, but the COMMENT HTML comment looses the end half of its tag, so everything after it thinks it is a comment. The reason I want to put a comment inside the replacement section is that the comment is actually a gulp-inject statement which injects some other references before I do the useref. I simplified it down to a simple HTML comment causing the problem. This is the line that causes the problem: .pipe($.useref()) FYI I am following John Papa’s course on Pluralsight where he uses this exact mechanism to inject some CSS and then replace them – (the inject:css HTML comment delimiters are mangled after a useref): &lt;!-- build:css styles/app.css--&gt; &lt;!-- inject:css --&gt; &lt;link rel="stylesheet" href="/.tmp/styles.css"&gt; &lt;!-- endinject --&gt; &lt;!-- endbuild --&gt; How can I get the useref() to replace the template with the correct links but leave the HTML comment…
tagged with: gulp
has answer: http://stackoverflow.com/a/33311225
answer count: 4
favorite count: 0
has answer: http://stackoverflow.com/a/40978027
has answer: http://stackoverflow.com/a/38626164
type: UnansweredQuestion

http://stackoverflow.com/q/29891655
tagged with: knockout.js
answer count: 1
has comment: http://stackoverflow.com/comment/47909642
has body: I have a form that contains this input field: &lt;input type="number" name="price" data-bind="price"&gt; And this knockout validation definition: ... price = ko.observable().extend({required: true, number: true}) ... The problem is that when I enter a non numeric value the browser actually sets the value of a type="number" field to an empty string (internally) so the model receives an empty string. Due to this the knockout validation mechanism always triggers the 'required' validation even though the user sees a value in the field. It would be better to trigger the 'please enter a number' message instead of the 'this field is required' message. I could of course use a type="text" but that triggers the wrong keyboard on mobile devices. Any ideas how to solve this? This is of course related to this issue: HTML5 input type=number value is empty in Webkit if has spaces or non-numeric characters?, but using a type="tel" is not an option for me unfortunately.
tagged with: javascript
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/42736659
linked to: http://stackoverflow.com/q/18852244
tagged with: knockout-validation
score: 3
downvote count: 0
favorite count: 0
type: Question
has comment: http://stackoverflow.com/comment/72594461
linked to: http://stackoverflow.com/q/18677323
has title: Knockout.js validation fails with a type="number" input field
has comment: http://stackoverflow.com/comment/47930981
upvote count: 3
has answer: http://stackoverflow.com/a/29899997

http://stackoverflow.com/comment/47989460
comment on: http://stackoverflow.com/q/29933578
has text: I see in the first email repeat you are filtering with `brand:brand.name`, which is valid since your email objects have a "brand" attribute. In your second, you are using `collection:collection.name`, but "collection" is not on the email object. I don't know if all of your email objects are like that, but if so that could be the problem
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/47877581
type: Comment
comment on: http://stackoverflow.com/a/29876662
type: AnswerComment
score: 0
has text: can you explain what the issue and solution is in the answer ?

http://stackoverflow.com/comment/47832493
type: AnswerComment
has text: @user186 Just another note, if this answer answered your question you can mark it as "accepted", the green arrow on the left.
comment on: http://stackoverflow.com/a/29852917
type: Comment
score: 0

http://stackoverflow.com/comment/47907955
has text: it still show me only first row // Array ( [0] => 9 [id] => 9 [1] => anis [username] => anis [2] => test [email] => test [3] => test [password] => test )
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29892221

http://stackoverflow.com/comment/48123506
has text: @jcubic I want to get the property, not to set. @ Nikos for alert(css(document.getElementById("expand0"))); in console log I get this error :Uncaught ReferenceError: css is not defined
type: QuestionComment
type: Comment
score: 0
comment on: http://stackoverflow.com/q/30002239

http://stackoverflow.com/q/29881339
score: -3
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29881496
has body: I wanna load a single XML tag with the name 'QWERTY' into a 'p' tag in HTML with JavaScript, how can I do this?
downvote count: 3
type: Question
upvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/29881496
tagged with: http://stackoverflow.com/tag/html
answer count: 1
tagged with: load
favorite count: 0
tagged with: http://stackoverflow.com/tag/xml
has comment: http://stackoverflow.com/comment/47887031
has title: How can I load a single tag in a XML file into a paragraph tag in HTML?

dom-events
tags question: http://stackoverflow.com/q/29932538
tags question: http://stackoverflow.com/q/29926625
tags question: http://stackoverflow.com/q/29999407
tags question: http://stackoverflow.com/q/29958236
tags question: http://stackoverflow.com/q/29981236
tags question: http://stackoverflow.com/q/29866502
tags question: http://stackoverflow.com/q/29898254
tags question: http://stackoverflow.com/q/30000714
tags question: http://stackoverflow.com/q/29915196
tags question: http://stackoverflow.com/q/29966204
tags question: http://stackoverflow.com/q/29948130
tags question: http://stackoverflow.com/q/29928897
tags question: http://stackoverflow.com/q/29975414
tags question: http://stackoverflow.com/q/29986931
tags question: http://stackoverflow.com/q/29874165
tags question: http://stackoverflow.com/q/29966619
tags question: http://stackoverflow.com/q/30002231
type: Tag
tags question: http://stackoverflow.com/q/29980987
tags question: http://stackoverflow.com/q/29928203
tags question: http://stackoverflow.com/q/29990329
tags question: http://stackoverflow.com/q/29970926
tags question: http://stackoverflow.com/q/29992485
tag name: dom-events
tags question: http://stackoverflow.com/q/29864623
tags question: http://stackoverflow.com/q/29872098

http://stackoverflow.com/comment/48059643
type: Comment
comment on: http://stackoverflow.com/a/29969755
score: 0
type: AnswerComment
has text: Of course not. Your solution is completely valid for this situation. Just saying that is not a solution for every situation, which I think it would be a better solution. Anyway, yours is valid.

http://stackoverflow.com/comment/48030169
comment on: http://stackoverflow.com/a/29947533
score: 1
type: AnswerComment
type: Comment
has text: I just set up a plunker. It does seem to work http://plnkr.co/edit/1O0XFkz5oH4UKRQt0jV1 . ng-repeat does not have a deep watch because it only needs to know when there are new elements, but the {{item.extra}} in the template does i guess.

http://stackoverflow.com/a/29906276
downvote count: 0
has comment: http://stackoverflow.com/comment/47936095
has comment: http://stackoverflow.com/comment/67508926
type: Answer
has body: That is not related to Angular. You could do something like this: var result = array1.filter(function(item1) { for (var i in array2) { if (item1.id === array2[i].id) { return false; } }; return true; }); Or with ES6 syntax: var result = array1.filter(i1 =&gt; !array2.some(i2 =&gt; i1.id === i2.id));
upvote count: 12
answers question: http://stackoverflow.com/q/29906150
accepted answer of: http://stackoverflow.com/q/29906150
score: 12
type: AcceptedAnswer

http://stackoverflow.com/q/29865271
has comment: http://stackoverflow.com/comment/47855730
answer count: 3
has comment: http://stackoverflow.com/comment/47855767
has answer: http://stackoverflow.com/a/29865323
tagged with: public
has comment: http://stackoverflow.com/comment/47855797
type: UnansweredQuestion
has body: I'm having trouble getting my head around calling an internal function from inside another. I need to be able to call funcA on page load passing it an element and some dimensions which then applies some styles to the passes elem. funcB then uses said parameters to size the element correctly: var funcA = function(elem, width, height) { //performs layout restyle function funcB() { //performs sizing } funcB(); } However, the issue is I need to recall funcB from within a debounced resize function like so. function debounce(func, wait, immediate) { var timeout; return function() { var context = this, args = arguments; var later = function() { timeout = null; if (!immediate) func.apply(context, args); }; var callNow = immediate &amp;&amp; !timeout; clearTimeout(timeout); timeout = setTimeout(later, wait); if (callNow) func.apply(context, args); }; }; var resizeFn = debounce(function() { funcB(); }, 10); $(window).on('resize', resizeFn); What's the best practice for making funcB available? I'd been considering returning it and then caching it to variable: var funcA = function(elem, width, height) { //performs layout restyle function funcB() { //performs sizing } funcB(); return funcB } var scopedFuncB = funcA; scopedFuncB(); But is there a better way?
tagged with: structure
has answer: http://stackoverflow.com/a/29865368
has answer: http://stackoverflow.com/a/29865405
type: Question
has comment: http://stackoverflow.com/comment/47855607
has comment: http://stackoverflow.com/comment/47855673
has title: Calling private function from inside another function
tagged with: javascript
tagged with: jquery
tagged with: private
score: 0

http://stackoverflow.com/comment/47905749
comment on: http://stackoverflow.com/q/29891037
score: 0
type: Comment
type: QuestionComment
has text: @Manwal it loops through every paragraph. I just want a simple one that shows first few words of the first paragraph and then on click it shows all paragraphs. I just want an idea on how to do it. I tried removing the each loop and tried to get it with .html() and then cut it but it doesn't work.

http://stackoverflow.com/comment/47932807
type: AnswerComment
comment on: http://stackoverflow.com/a/29895363
type: Comment
has text: No,I only handle when the user puts /index , /about , .contact, could you please show me how I should handle this?
score: 0

http://stackoverflow.com/a/29876005
answers question: http://stackoverflow.com/q/29875865
has body: The .fitBounds method resets the viewport and thus your zoom level is not taken in account. Here is a minimal working example: https://jsfiddle.net/pdnsown1/1/. If you comment the line containing the call to .fitBounds and change the zoom level, you will see that it is actually applied. However, if you leave that line uncommented, the zoom level will not be taken in account. (See https://developers.google.com/maps/documentation/javascript/reference#Map) EDIT: To limit the map position to given bounds, you have to listen to the drag event and reset the position within the bounds whenever the user drags outside of them (see https://stackoverflow.com/a/9103195/3452708). I updated the fiddle to show you how: https://jsfiddle.net/pdnsown1/2/.
type: Answer
score: 21
upvote count: 21
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29875865
downvote count: 0

http://stackoverflow.com/comment/48046519
type: Comment
has text: By the way, I suppose you are using the third-party library for switch button, so, the class attribute might be `"switchbutton"`.
comment on: http://stackoverflow.com/q/29963088
score: 0
type: QuestionComment

http://stackoverflow.com/comment/48108264
has text: But in the previous code, if i remove the json_decode, it returns the json correctly so the problem isn't the scope. The problem is the json_decode function somehow...
comment on: http://stackoverflow.com/q/29992447
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47826830
has text: @robertklep I felt dump. thanks !
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29846199

http://stackoverflow.com/q/29877690
has comment: http://stackoverflow.com/comment/47879516
tagged with: javascript
has answer: http://stackoverflow.com/a/29877701
score: 0
answer count: 2
tagged with: jquery
has title: HTML onclick and href
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29877754
accepted answer: http://stackoverflow.com/a/29877754
possible better answer: http://stackoverflow.com/a/29877701
type: AnsweredQuestion
has body: I have a link like this. &lt;a href="board.php?id={$id}" onclick="javascript:parent.$.fancybox.open({href : 'board.php?id={$id}', type: 'ajax'});"&gt; If the JavaScript is disabled, the browser can use the href value to load the page. But, if the JavaScript is enabled, the onclick and the href will work together. How can I prevent this? I want the href not to work when the JavaScript is enabled.
type: Question

http://stackoverflow.com/a/29973501
answers question: http://stackoverflow.com/q/29972949
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/48067120
upvote count: 14
accepted answer of: http://stackoverflow.com/q/29972949
has comment: http://stackoverflow.com/comment/89114964
has comment: http://stackoverflow.com/comment/48066852
has comment: http://stackoverflow.com/comment/48067768
has body: Yes it is certainly possible to do such a thing. Firstly use the html2canvas api to take a picture of the user's screen: html2canvas(document.body).then(function(canvas) { }); Secondly use the following function to convert the returned canvas image into a base64 encoded URL (defaults to png): canvas.toDataURL(); Specification For canvas.toDataURL Now construct a request to send your base64 encoded url to an image uploading server (I'm using Imgur as an example). html2canvas(document.body).then(function(canvas) { var dataURL = canvas.toDataURL(); $.ajax({ url: 'https://api.imgur.com/3/image', type: 'post', headers: { Authorization: 'yourauthcode' }, data: { image: dataURL }, dataType: 'json', success: function(response) { if(response.success) { // Post the imgur url to your server. $.post("yourlinkuploadserver", response.data.link); } } }); }); After the image has been uploaded you can POST the URL of the uploaded image to your web server. Specification for $.post Specification for $.ajax
has comment: http://stackoverflow.com/comment/48067819
type: Answer
score: 14
downvote count: 0
has comment: http://stackoverflow.com/comment/48067302

http://stackoverflow.com/comment/48028258
type: Comment
comment on: http://stackoverflow.com/q/29953758
type: QuestionComment
has text: Any cons arguments about using an external library like [momentJS](http://momentjs.com) ? Hugh time saver about such manipulation.
score: 0

http://stackoverflow.com/comment/48162993
comment on: http://stackoverflow.com/q/29887107
score: 0
type: Comment
has text: In order to POST, you would need a server-side handler. I suggest you leave the book (which is probably out of date) and read through the [PhoneCat Tutorial App](https://docs.angularjs.org/tutorial) or the [angular-seed project](https://github.com/angular/angular-seed)
type: QuestionComment

http://stackoverflow.com/q/29855271
tagged with: highcharts
answer count: 1
tagged with: javascript
has title: Highcharts: overlapped columns in exported chart
score: 0
tagged with: http://stackoverflow.com/tag/png
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29860927
type: Question
has body: The live chart looks fine, however, when exported to PNG, JPEG or PDF, the columns overlap. The code: http://jsfiddle.net/strawberry/1s27pjed/ exporting:{ chartOptions:{ legend:{ enabled:true, style: {fontFamily: "Arial"} }, } }, In addition, is there an option to change the font and size of the legend text in the export? I was able to change the title and axis fonts, but not the legend.
tagged with: export
accepted answer: http://stackoverflow.com/a/29860927

http://stackoverflow.com/comment/47885907
type: QuestionComment
comment on: http://stackoverflow.com/q/29878522
has text: Using php on my server wouldn't be a problem, I'm just looking for a way to implement this
score: 0
type: Comment

http://stackoverflow.com/comment/48071331
score: 0
has text: First off, get rid of the ` ` wrapping the ` `. that's a no-no. Put the ID on the ` ` instead. And `$('.order-table')` is fetching the table for you, not the rows within. If you need the rows, `$('.order-table tr')` will return them
comment on: http://stackoverflow.com/q/29975753
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29953389
accepted answer of: http://stackoverflow.com/q/29953281
has comment: http://stackoverflow.com/comment/48027646
has comment: http://stackoverflow.com/comment/48027600
has comment: http://stackoverflow.com/comment/48027637
has comment: http://stackoverflow.com/comment/48027812
has comment: http://stackoverflow.com/comment/48028538
has comment: http://stackoverflow.com/comment/48028122
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/48027679
upvote count: 3
has comment: http://stackoverflow.com/comment/48027667
downvote count: 1
type: Answer
has comment: http://stackoverflow.com/comment/48027717
has body: There's a few problems in your code. First, change scr to src in your script tag: &lt;script src="js/script.js"&gt;&lt;/script&gt; Second, you probably just want to use $(function) instead of the event you're using now. Third, it's best to put reusable functions outside anonymous functions (such as your event handler). Here's the code changed to do what you want: $(function () { $('#submitAdd').on('tap', addWalk); }); // I moved this function outside the other function. function addWalk() { alert(1); }
answers question: http://stackoverflow.com/q/29953281
score: 2

http://stackoverflow.com/a/30112350
has comment: http://stackoverflow.com/comment/69801512
has comment: http://stackoverflow.com/comment/72002688
answers question: http://stackoverflow.com/q/29939697
has comment: http://stackoverflow.com/comment/128975047
score: 285
has body: Unfortunately npm build is already an internal command, as described in the docs: This is the plumbing command called by npm link and npm install. It should generally not be called directly. Because that command already exists, it always shadows over your "build": "node build.js". The fully-qualified way to run your own script is with run-script or its alias run: $ npm run build npm start and others are the short-hand way, but is only an option when an existing npm command doesn't shadow it, like npm build does. For posterity (as others have mentioned) npm build is used by npm to build native C/C++ Node addons using node-gyp.
upvote count: 285
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/74699536
has comment: http://stackoverflow.com/comment/73062093
type: Answer
accepted answer of: http://stackoverflow.com/q/29939697
has comment: http://stackoverflow.com/comment/63466221

http://stackoverflow.com/comment/58453736
comment on: http://stackoverflow.com/a/29912925
has text: how to write Arabic clause (Right to left) like "مرحبا"
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/32687462
has body: maybe you can try my method fellowing Implements IPostBackEventHandler ScriptManager.RegisterStartupScript(this, this.GetType(), "confirm", "if(confirm('check my tickets！'))" + this.ClientScript.GetPostBackEventReference(this, "true") + "; else " + this.ClientScript.GetPostBackEventReference(this, "false"), true); public void RaisePostBackEvent(string eventArgument) { string res; switch (eventArgument) { case "true": res = "check！"; break; case "false": res = "uncheck。"; break; default: throw new NotSupportedException(); } ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "alert('" + res + "');", true); }
answers question: http://stackoverflow.com/q/29900098
type: Answer
score: 0

http://stackoverflow.com/comment/47914209
comment on: http://stackoverflow.com/a/29895400
type: Comment
has text: So. Do it! Pull the data, if there's interesting information for the user - use `browserAction.setBadgeText` or change the icon to indicate that you have information to show, and store that information in `chrome.storage`. In the popup, pull the data from `chrome.storage` when it opens.
score: 0
type: AnswerComment

http://stackoverflow.com/a/29927959
score: 7
accepted answer of: http://stackoverflow.com/q/29927911
answers question: http://stackoverflow.com/q/29927911
has body: Your double quotes are not closed properly: $(wrapper).append('&lt;input type="text", id="waypt"' + x + ' class="... Would result in the following HTML: &lt;input type="text", id="waypt" 0 class="... &lt;input type="text", id="waypt" 1 class="... The obvious solution is to fix the quotes (and get rid of commas): $(wrapper).append('&lt;input type="text" id="waypt' + x + '" class="... However, I would recommend something like: var $div = $("&lt;div&gt;"); $("&lt;input&gt;", { "type": "text", "id": "waypt" + x, "class": "form-control added-input", "placeholder": "Next" }).appendTo($div); $("&lt;a&gt;&lt;/a&gt;", { "href": "#", "class": "remove_field" }).text("Remove").appendTo($div); $div.appendTo(wrapper);
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47977793
upvote count: 7
type: Answer
downvote count: 0

http://stackoverflow.com/q/29879301
has comment: http://stackoverflow.com/comment/47882944
has comment: http://stackoverflow.com/comment/48008025
type: Question
has body: I'm using the jpanelmenu plugin, but this goes for the first four of the jquery side menus on this list. www.jqueryscript.net/tags.php?/side%20menu/ The scripts work fine in the body of the page. When I move the markup of this autocomplete search to the side menu like this Home About Contact Login Register Main1 Sub Sub Sub Sub ... it stops functioning. The input box shows up, but the autocomplete results don't. I'm using drupal, with a bootstrap subtheme, and I think this may be playing a role. I have to replace $( with jQuery( in every script because of some conflict that I don't understand. I'm loading the scripts in this order: <!-- <?php print $scripts; ?> -->
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47882991
score: 0
has title: Javascript works in body but not in jquery side menus w/ no console errors
tagged with: jpanelmenu
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47883071
tagged with: drupal
answer count: 0

highcharts
tags question: http://stackoverflow.com/q/29925656
tags question: http://stackoverflow.com/q/29878522
tags question: http://stackoverflow.com/q/29922964
tags question: http://stackoverflow.com/q/29939741
tags question: http://stackoverflow.com/q/29962602
tags question: http://stackoverflow.com/q/29977355
tags question: http://stackoverflow.com/q/29929201
tags question: http://stackoverflow.com/q/29959074
tags question: http://stackoverflow.com/q/29890174
tags question: http://stackoverflow.com/q/29934198
tags question: http://stackoverflow.com/q/29906901
tags question: http://stackoverflow.com/q/29961206
tags question: http://stackoverflow.com/q/29918054
tags question: http://stackoverflow.com/q/29897279
tags question: http://stackoverflow.com/q/29854321
tags question: http://stackoverflow.com/q/29947062
tags question: http://stackoverflow.com/q/29948363
tags question: http://stackoverflow.com/q/29856075
tags question: http://stackoverflow.com/q/29873806
tags question: http://stackoverflow.com/q/29939299
tags question: http://stackoverflow.com/q/29985907
tags question: http://stackoverflow.com/q/29850977
tags question: http://stackoverflow.com/q/29848656
tags question: http://stackoverflow.com/q/29930602
tags question: http://stackoverflow.com/q/29894994
tags question: http://stackoverflow.com/q/29969830
tags question: http://stackoverflow.com/q/29938393
tags question: http://stackoverflow.com/q/29954054
tags question: http://stackoverflow.com/q/29977537
tags question: http://stackoverflow.com/q/29873492
tags question: http://stackoverflow.com/q/29971242
tags question: http://stackoverflow.com/q/29950793
tags question: http://stackoverflow.com/q/29910798
tags question: http://stackoverflow.com/q/29890102
tags question: http://stackoverflow.com/q/29856708
tags question: http://stackoverflow.com/q/29918322
type: Tag
tags question: http://stackoverflow.com/q/29855271
tags question: http://stackoverflow.com/q/29996402
tag name: highcharts

http://stackoverflow.com/q/29878310
downvote count: 0
score: 1
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/29878381
has comment: http://stackoverflow.com/comment/47880653
has body: I want to put value on element that is JSON value, but when i read this value i want to parse the json and make the value an object if this is a JSON format, if not return the string, this is what i am trying to do but it is not working. HTML: Item Two JS: function getValue() { var ele = document.querySelector('ul'), value = ele.firstElementChild.getAttribute('value'); try { value = JSON.parse(value); } catch (e) { alert('invalid json'); } return value; } so for example if the value is in JSON format i want the function to return the value as an object that i could write value.name and get 34 in this case, but if the value is simple string like "itemOne" so i expect the function to return the string "itemOne".
type: Question
tagged with: javascript
possible better answer: http://stackoverflow.com/a/29878424
has comment: http://stackoverflow.com/comment/47880731
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47880670
favorite count: 0
has answer: http://stackoverflow.com/a/29878383
accepted answer: http://stackoverflow.com/a/29878383
has title: Html insert json value to an element and convert this to an object
has answer: http://stackoverflow.com/a/29878459
answer count: 4
has answer: http://stackoverflow.com/a/29878424
type: AnsweredQuestion

http://stackoverflow.com/a/29942576
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/29942231
score: 4
has body: ECMA 262 specifies that the function is implementation dependent and takes no arguments. Produces a String value that represents this Number value formatted according to the conventions of the host environment’s current locale. This function is implementation-dependent, and it is permissible, but not encouraged, for it to return the same thing as toString. NOTE The first parameter to this function is likely to be used in a future version of this standard; it is recommended that implementations do not use this parameter position for anything else. It is also in ECMA internationalization API specification (which for Number.prototype.toLocaleString supersedes ECMA 262 but accepts 2 arguments) This definition supersedes the definition provided in ES5, 15.7.4.3. When the toLocaleString method is called with optional arguments locales and options, the following steps are taken: Let x be this Number value (as defined in ES5, 15.7.4). If locales is not provided, then let locales be undefined. If options is not provided, then let options be undefined. Let numberFormat be the result of creating a new object as if by the expression new Intl.NumberFormat(locales, options) where Intl.NumberFormat is the standard built-in constructor defined in 11.1.3. Return the result of calling the FormatNumber abstract operation (defined in 11.3.2) with arguments numberFormat and x. The value of the length property of the toLocaleString method is 0. Besides, mdn specifies that Safari has no support for it. As for a viable solution see this answer on SO
upvote count: 4

http://stackoverflow.com/a/29980523
has comment: http://stackoverflow.com/comment/48087277
accepted answer of: http://stackoverflow.com/q/29969398
answers question: http://stackoverflow.com/q/29969398
has body: The problem is caused by the version of angular that you are using. In the example you provided the version is angular 1.2.20 whereas you are using 1.2.0-rc.2 Upgrade your version angular and you should find the code works.
type: AcceptedAnswer
score: 0
type: Answer

http://stackoverflow.com/comment/47882382
type: AnswerComment
comment on: http://stackoverflow.com/a/29879156
score: 0
type: Comment
has text: Also YO is a string. It needs to be in quotes. And he's not calling val() when checking for YO

http://stackoverflow.com/comment/47919148
score: 1
has text: I think it is impossible. Javascript runs in browser (client) and to handle files stored in server, you'll need a server side script.
comment on: http://stackoverflow.com/q/29898158
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47933462
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29905140
has text: If I do onclick="return uploadEx();" then I can't select the submit button. I can "click" it but it doesn't do anything.

http://stackoverflow.com/comment/48052480
score: 0
type: Comment
type: QuestionComment
has text: Here: https://jsfiddle.net/Lvz1paf5/ So this would be it without translateY.
comment on: http://stackoverflow.com/q/29966208

http://stackoverflow.com/comment/47941028
has text: It is cleaner to add your whole service `MainShared` on $rootScope and in your HTML you use `ng-show="MainShared.searchBar"`. It makes more sense and is reusable if you add other things in MainShared.
score: 1
comment on: http://stackoverflow.com/a/29909045
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/48084102
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29982308
has text: I'd recommend asking a new question if you were planning on changing it.

http://stackoverflow.com/comment/47934946
type: QuestionComment
comment on: http://stackoverflow.com/q/29905918
score: 0
has text: Yeah, just tried it, and it loads the page from scratch, rerunning `$(document).ready();` functions. So is it safe to rely on then? Either it will load it all perfectly or else reload it from scratch?
type: Comment

http://stackoverflow.com/comment/47821879
has text: Revised on the source . Please look again
comment on: http://stackoverflow.com/a/29847604
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/29867519
tagged with: object
tagged with: javascript
has body: I'm using this function to write all the values inside object. It prints out values inside object like print_r({"total":4,"offset":0}); But how can it be tweaked to print values if there is another object, like this: print_r({"total":4,"offset":0,"memberData":{"firstName":"joe","lastName":"smith"}});
has answer: http://stackoverflow.com/a/29867558
answer count: 1
has title: How to print out all the values inside object?
accepted answer: http://stackoverflow.com/a/29867558
type: AnsweredQuestion
score: 0
has comment: http://stackoverflow.com/comment/47859893
type: Question

http://stackoverflow.com/q/29998179
possible better answer: http://stackoverflow.com/a/29998374
tagged with: url-routing
has answer: http://stackoverflow.com/a/29998374
has answer: http://stackoverflow.com/a/29998394
type: AnsweredQuestion
type: Question
tagged with: frameworks
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29998394
score: 0
answer count: 2
has body: I am writing some Javascript and I need to add a routing system, otherwise it would be tricky to manage as the list grows. The Angular routing is good, but I don't want to add it as a dependency. What are the options? if(window.location.pathname==='/') { var $btn = $('&lt;a /&gt;').html('btn').click(function() { $questionList.html(findAnswers()); }); $tabs.prepend($btn); } if(window.location.pathname==='/posts') { // some code will run when only on post page }
tagged with: jquery
has title: Express-like routing for client-side Javascript

http://stackoverflow.com/comment/47872491
comment on: http://stackoverflow.com/q/29869400
has text: No no..I don't want a filter..i need a way to bypass one with above specified functionality
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/a/31644949
answers question: http://stackoverflow.com/q/29885220
downvote count: 1
upvote count: 4
has body: The answer is No. It's not possible to use For..Of with Object literals. I agree with Overv that For..Of is only for iterables. I had exactly the same question because I use Objects to iterate over keys and values with for..in. But I just realized that that's what ES6 MAPS and SETS are for. let test = new Map(); test.set('first', "one"); test.set('second', "two"); for(var item of test) { console.log(item); // "one" "two" } Hence it achieves the goal of not having to use for..In (validating with hasOwnProperty) and not having to use Object.keys(). Additionally, your keys aren't limited to strings. You can use numbers, objects, or other literals.
score: 3
type: Answer

http://stackoverflow.com/comment/48079164
type: Comment
comment on: http://stackoverflow.com/a/29979734
has text: I too was guessing that people think it initializes the property similar to what you mentioned `this.foo = undefined` and iterable when using `Object.keys()`, but that's not specified anywhere in the spec. *shrug*
score: 0
type: AnswerComment

http://stackoverflow.com/comment/47901867
type: Comment
type: QuestionComment
has text: Check your query, echo $result; exit;
score: 0
comment on: http://stackoverflow.com/q/29889094

http://stackoverflow.com/comment/48084486
comment on: http://stackoverflow.com/q/29982565
type: Comment
type: QuestionComment
score: 1
has text: Firstly you must understand whats the difference between client side and server side programming.

http://stackoverflow.com/comment/47852263
comment on: http://stackoverflow.com/a/29863396
score: 0
type: AnswerComment
type: Comment
has text: Thanks pankajpakar, and how do you think this should work to updateMember: ? "$scope.updateMember = function() { SimpleFactory.updateMember($scope.member.index, $scope.member.detail) $location.path('/members') }"

http://stackoverflow.com/a/29990198
has comment: http://stackoverflow.com/comment/48099775
downvote count: 0
has comment: http://stackoverflow.com/comment/48099903
type: Answer
has body: EDIT: I updated my answer to use addEventListener() instead of assigning function to ancient onclick element property. For explanation: please see (and upvote!) accepted answer by @Mike 'Pomax' Kamermans, who was the first user in this question who posted answer using this approach. jsfiddle: http://jsfiddle.net/qo33n4q0/3/ Code is pretty analogical to jQuery version posted above: var inputOne = document.getElementById('one'); var inputTwo = document.getElementById('two'); var swapButton = document.getElementById('swap'); swapButton.addEventListener('click', function (e) { e.preventDefault(); // optional - unless our button is a link/submit input var fromVal = inputOne.value; var toVal = inputTwo.value; inputOne.value = toVal; inputTwo.value = fromVal; }); I'm not sure about your motivation for switching to vanilla JS, but most of the time it's easier to just use jQuery. Unless you care about performance. Nice, entertaining (but actually serious and enlightening, in a way) read about this whole issue (frameworks vs. vanilla): Vanilla JS framework
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/29990050
has comment: http://stackoverflow.com/comment/48100235
has comment: http://stackoverflow.com/comment/48100171

http://stackoverflow.com/q/29885030
tagged with: dart
answer count: 1
has body: I try to get the id's from List of Maps in Dart. In JavaScript it would be something like this: var list = [{id:3, name:'third'}, {id:4, name:'fourth'}]; var result = list.map(function(x){return x.id;}); This should give the result [3, 4] Is there a simple way of doing this in Dart? So far I was able to do this (in Dart): var list = [{'id':3, 'name':'third'},{'id':4, 'name':'fourth'}]; var result = list.map((x) =&gt; x['id']); The result is a "MappedListIterable" (not sure what that is) and you cannot use result[0] like you can with a normal List. How can I make a list of this?
favorite count: 0
upvote count: 9
has title: Dart equivalent of Array.prototype.map()?
type: AnsweredQuestion
downvote count: 0
type: Question
score: 9
has answer: http://stackoverflow.com/a/29885533
accepted answer: http://stackoverflow.com/a/29885533
tagged with: arrays
tagged with: javascript

http://stackoverflow.com/comment/48017302
type: Comment
has text: Check retrun false typo. Also you dont need the semicolon there.
score: 1
comment on: http://stackoverflow.com/q/29948130
type: QuestionComment

http://stackoverflow.com/q/29872387
favorite count: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/33529381
accepted answer: http://stackoverflow.com/a/33529381
has comment: http://stackoverflow.com/comment/47881151
has comment: http://stackoverflow.com/comment/47888046
score: 6
upvote count: 6
type: AnsweredQuestion
has title: Get JSON Result from popup window. Angular.JS
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/47870657
type: Question
has comment: http://stackoverflow.com/comment/47869872
has body: I've got a pop-up window that calls a RESTful backend to do Oauth authentication, but when the result is returned, it displays the JSON in the popup window rather than closing the popup window and storing the JSON in a model. How do I fix this? this.socialLogin = function(provider) { var url = urlBase + '/' + provider, width = 1000, height = 650, top = (window.outerHeight - height) / 2, left = (window.outerWidth - width) / 2, socialPopup = null; $window.open(url, 'Social Login', 'width=' + width + ',height=' + height + ',scrollbars=0,top=' + top + ',left=' + left); };
has comment: http://stackoverflow.com/comment/53128853
downvote count: 0
has comment: http://stackoverflow.com/comment/52042716
tagged with: javascript
has comment: http://stackoverflow.com/comment/47870018
answer count: 1

http://stackoverflow.com/comment/100714188
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29933975
has text: Unless the OP's already using jQuery, this seems like a lot of libraries for a simple function
type: AnswerComment

http://stackoverflow.com/a/30983805
score: 0
type: Answer
answers question: http://stackoverflow.com/q/29878525
has body: ¿Are you sure your ajax request is being called? Some old, annoying, deprecated, not fully-functional browsers (yes, IE, I'm talking about you) would store ajax request in cache and return the first result in every subsequent request. As you have not marked your request as POST, it's possible partners/getInactiveDays is really only being called once. Add method: 'POST' to your request, or append a random string (even POST request were sometimes stored in IE8) to your url as an unusued parameter (e.g. url:'partnets/getInactiveDays?randomizer='+new Date().getTime()) to prevent cache storing if they are not being excecuted.

http://stackoverflow.com/q/29924385
tagged with: unit-testing
type: Question
downvote count: 0
tagged with: javascript
has title: unit testing promises in Angular controller with a watcher
score: 2
favorite count: 0
tagged with: angularjs
upvote count: 2
type: UnansweredQuestion
answer count: 0
has body: I have a controller that 1. waits for a promise to be resolved 2. sets a watcher both promise and watcher handlers modify a property defined on the scope of the controller. a pseudo test would look something like this: it('should expect correct values set on the scope', function () { myPromise.resolve(); // modifies someVar in promise handler $scope.$digest(); // for the promise handler being applied; modifies someVar in $watch handler though expect(someVar).toEqual(someValue); }) the problem is $digest() in the spec forces the watcher being fired and this leads to a possible conflict as it modifies someVar's value, which is the subject of the promise test. I want to isolate the promise handler test, ideally without triggering $digest and the watcher. any ideas?

http://stackoverflow.com/comment/48024357
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/29951171
has text: I think the if-statement checking the button value is unnecessary, and as pointed out you can remove the extra `$(function(){});` and should add some semi-colons, but none of that causes it to not work. It appears to work fine in this [jsfiddle](http://jsfiddle.net/sLL6vruz/).
type: Comment

http://stackoverflow.com/q/29865834
has body: I have dynamically created a table with elements followed by a search and reset button. In general tabbing works through input fields and select fields in the table. Tabbing skips over checkbox which is not bothering me. However, after the table comes two buttons, search and reset. Adding these buttons dynamically will get skipped over when tabbing. $('#' + div_id).append('&lt;input type="button" class = "button" value="Search" onclick="'+this.table_name+'.submitSearch()"&gt;'); $('#' + div_id).append('&lt;input type="button" class = "button" value="Reset" onclick="'+ this.table_name +'.resetSearch()"&gt;'); I have tried adding the following code: $(":input:not(:hidden)").each(function (i) { console.log(this.id); $(this).attr('tabindex', i + 1); }); Which is not helping. Php generated html code works as expected. Thanks for your help!!!
accepted answer: http://stackoverflow.com/a/29866126
has comment: http://stackoverflow.com/comment/47857006
upvote count: 1
has comment: http://stackoverflow.com/comment/47856605
tagged with: tabindex
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47856677
type: Question
has answer: http://stackoverflow.com/a/29866126
answer count: 1
downvote count: 0
tagged with: javascript
score: 1
has comment: http://stackoverflow.com/comment/47856711
tagged with: jquery
favorite count: 0
has title: dynamically created input button is being skipped by tabbing ... how to set tabindex
tagged with: http://stackoverflow.com/tag/html
tagged with: php

http://stackoverflow.com/q/29921350
answer count: 2
tagged with: rotation
possible better answer: http://stackoverflow.com/a/29922632
downvote count: 0
tagged with: javascript
has title: On click Javascript transform
tagged with: click
tagged with: css
favorite count: 0
has comment: http://stackoverflow.com/comment/47964314
has body: I am trying to achieve a flip card effect on the click of a button but I can not quite figure out the Javascript. I actually know nothing about Javascript so I have attempted to find similar solutions and alter them to my needs but with no results. Below is the CSS for how it is now as a :hover style. You can view it here : http://dangoodeofficial.co.uk/290-2 CSS: .flip3D { float: left; display: block; position: relative; width: auto; height: 675px; } .flip3D .front { position: absolute; -o-transform: perspective(600px)RotateY( 0deg ); -moz-transform: perspective(600px)RotateY( 0deg ); -ms-transform: perspective(600px)RotateY( 0deg ); -webkit-transform: perspective(600px)RotateY( 0deg ); transform: perspective(600px)RotateY( 0deg ); -o-transform-backface-visibility: hidden; -moz-transform-backface-visibility: hidden; -ms-transform-backface-visibility: hidden; -webkit-transform-backface-visibility: hidden; backface-visibility: hidden; transition: -o-transform .5s linear 0s; transition: -moz-transform .5s linear 0s; transition: -ms-transform .5s linear 0s; transition: -webkit-transform .5s linear 0s; transition: transform .5s linear 0s; width: 100%; } .flip3D .back { position: absolute; -o-transform: perspective(600px)RotateY( 180deg ); -moz-transform: perspective(600px)RotateY( 180deg ); -ms-transform: perspective(600px)RotateY( 180deg ); -webkit-transform: perspective(600px)RotateY( 180deg ); transform: perspective(600px)RotateY( 180deg ); -o-transform-backface-visibility: hidden; -moz-transform-backface-visibility: hidden; -ms-transform-backface-visibility: hidden; -webkit-transform-backface-visibility: hidden; backface-visibility: hidden; transition: -o-transform .5s linear 0s; transition: -moz-transform .5s linear 0s; transition: -ms-transform .5s linear 0s; transition: -webkit-transform .5s linear 0s; transition: transform .5s linear 0s; width: 100%; } .flip3D:hover &gt; .front { -o-transform: perspective(600px)RotateY( -180deg ); -moz-transform: perspective(600…
has answer: http://stackoverflow.com/a/29922632
upvote count: 1
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/29921541
accepted answer: http://stackoverflow.com/a/29921541
type: Question

http://stackoverflow.com/q/29889829
has title: how to show JS alert on open of each tab of the slider?
has answer: http://stackoverflow.com/a/29890347
downvote count: 0
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29890056
favorite count: 0
has answer: http://stackoverflow.com/a/29890001
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47903447
has body: I'm using the liquidslider script on my webpage and I created the slider on my page, the html code looks like this: Slide 1 // Content goes here Slide 2 // Content goes here Slide 3 // Content goes here There's also my current javascript: $('#slider-1').liquidSlider({ autoHeight:false, slideEaseFunction:'animate.css', slideEaseDuration:1000, heightEaseDuration:1000, animateIn:"fadeIn", animateOut:"fadeOut", callback: function() { var self = this; $('.slider-1-panel').each(function() { $(this).removeClass('animated ' + self.options.animateIn); }); $('.slider-1-panel').each(function() { alert("you opened panel"); }); } }); and currently the message "you opened panel" is shown 4 times each time the user clicks the panel tab, that's because of those lines: $('.slider-1-panel').each(function() { alert("you opened panel"); }); How can I change it so that the message is displayed only once for each panel? Later on I want to add animations in css to each panel so that they're invoked when the user selects the panel and I thought the good start would be to know when the user selects any panel. as you suggested, I created a jsfiddle, I added resources, but I can't make it up and running properly, I don't know what I'm doing wrong there.. But the css code is visible there, hopefuly that's helpful enough EDIT: I've decided to add a little bit more details. I managed to create an option that changes all the tabs while the user clicks any tab: $('#slider-1').liquidSlider({ autoHeight:false, slideEaseFunction:'animate.css', slideEaseDuration:1000, heightEaseDuration:1000, animateIn:"fadeIn", animateOut:"fadeOut", callback: function() { var self = this; $('.slider-1-panel').each(function() { $(this).removeClass('animated ' + self.options.animateIn); }); $('#slider-1-nav-ul a').each(function() { $(this).css('background', '#'+Math.floor(Math.random()*16777215).toString(16)); $(this).css('color', '#'+Math.floor(Math.random()*16777215).toString(16)); }) } }); but now I need to change t…
tagged with: css
accepted answer: http://stackoverflow.com/a/29890347
answer count: 4
score: 2
possible better answer: http://stackoverflow.com/a/29890001
upvote count: 2
has comment: http://stackoverflow.com/comment/47903271
type: Question
has answer: http://stackoverflow.com/a/29890041
type: AnsweredQuestion

http://stackoverflow.com/comment/47903718
comment on: http://stackoverflow.com/q/29877438
score: 0
has text: @Bergi Could you please elaborate? If that is the case how come its working for 'body'?
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/48048080
type: Comment
has text: That page doesn't seem to be it. The modals don't follow the gallery (it's actually after the parent of the gallery) and they don't have the CSS set. Also with this gallery layout you would definitely need that wrapper div.
comment on: http://stackoverflow.com/a/29948827
type: AnswerComment
score: 0

http://stackoverflow.com/q/29928165
favorite count: 0
has answer: http://stackoverflow.com/a/29928553
has body: Scenario Extracting URLs from multiple CSS url() functional notation. Given the following css value from project bootstrap: src: url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), url('../fonts/glyphicons-halflings-regular.woff2') format('woff2'), url('../fonts/glyphicons-halflings-regular.woff') format('woff'), url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'), url('../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg'); I need an array of URL strings like ["../fonts/glyphicons-halflings-regular.eot?#iefix", "../fonts/glyphicons-halflings-regular.woff2", ...]. Solution Right now I use a while loop and regex matcher to extract URL strings from the parsed declaration via a CSS parser: var decValue = "url(foo), url(bar)"; // no data URI var regexp = new RegExp(/url\(([^\(|^\)|^\"|^\']+)\)/g), matches = [], match; while (match = regexp.exec(decValue), match !== null) { if (match[1].indexOf("data:") === -1) { matches.push(match[1]); } } // should print ["foo", "bar"] console.log(matches); Question Is there a way to do this without using a while loop but keeping group matching?
tagged with: regex
has answer: http://stackoverflow.com/a/29928617
accepted answer: http://stackoverflow.com/a/29928617
type: AnsweredQuestion
score: 1
has title: Performing group extraction without while loop condition in javascript?
type: Question
possible better answer: http://stackoverflow.com/a/29928553
linked to: http://stackoverflow.com/q/2168855
tagged with: javascript
upvote count: 2
answer count: 2
downvote count: 1

http://stackoverflow.com/comment/47995151
score: 0
comment on: http://stackoverflow.com/q/29912286
type: QuestionComment
type: Comment
has text: ya i used like that @Tap , i figure out the problem. i have to change my sever stetting. The problem is with the server setting not with the **coding**

http://stackoverflow.com/a/29921244
has body: .timeUlSub is not a sibling, rather a child element of .timeli. You should refactor your code to: $(".timeli").click(function(){ $(this).find(".timeUlSub").slideToggle("slow", function(){}); }); And an even better implementation would be to delegate the click: $(document).on("click", ".timeli", function(){ $(this).find(".timeUlSub").slideToggle("slow", function(){}); });
score: 0
type: Answer
answers question: http://stackoverflow.com/q/29921002

http://stackoverflow.com/comment/48019895
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29949417
has text: I was struggling to creating the circle using `%` value. But you used really creative solution used of `view port` units. Using `rem` and `em` will not work in this case.
score: 0

http://stackoverflow.com/a/29994557
upvote count: 2
type: Answer
score: 2
has body: If you are open to using bootstrap, I recommend using ui.bootstrap.modal from the bootstrap angular directives for all your modal popup needs. It's an easy way to handle everything related with modal windows. The actual content of the modal window may be in a separate template, or displayed using a custom directive which can be passed with the options to $modal.open().
answers question: http://stackoverflow.com/q/29994297
downvote count: 0

http://stackoverflow.com/tag/svg
tags question: http://stackoverflow.com/q/29889507
tags question: http://stackoverflow.com/q/29915904
tags question: http://stackoverflow.com/q/29910895
tags question: http://stackoverflow.com/q/29903478
tags question: http://stackoverflow.com/q/29973399
tags question: http://stackoverflow.com/q/29875534
tags question: http://stackoverflow.com/q/29968549
tags question: http://stackoverflow.com/q/29868453
tags question: http://stackoverflow.com/q/29892184
tags question: http://stackoverflow.com/q/29925637
tags question: http://stackoverflow.com/q/29907685
tags question: http://stackoverflow.com/q/29999805
tags question: http://stackoverflow.com/q/29871730
tags question: http://stackoverflow.com/q/29909128
tags question: http://stackoverflow.com/q/29900146
tags question: http://stackoverflow.com/q/29915297
tags question: http://stackoverflow.com/q/29992346
tags question: http://stackoverflow.com/q/29980323
tags question: http://stackoverflow.com/q/29911926
tag name: svg
tags question: http://stackoverflow.com/q/29869603
tags question: http://stackoverflow.com/q/29939076
tags question: http://stackoverflow.com/q/29856075
tags question: http://stackoverflow.com/q/29850521
tags question: http://stackoverflow.com/q/29956789
tags question: http://stackoverflow.com/q/29856581
tags question: http://stackoverflow.com/q/29954475
tags question: http://stackoverflow.com/q/29999002
tags question: http://stackoverflow.com/q/29954936
tags question: http://stackoverflow.com/q/29936842
tags question: http://stackoverflow.com/q/30002398
tags question: http://stackoverflow.com/q/29917500
tags question: http://stackoverflow.com/q/29909403
tags question: http://stackoverflow.com/q/29901628
tags question: http://stackoverflow.com/q/29921052
tags question: http://stackoverflow.com/q/29965643
tags question: http://stackoverflow.com/q/29934245
tags question: http://stackoverflow.com/q/29893190
tags question: http://stackoverflow.com/q/29975138
tags question: http://stackoverflow.com/q/29992428
tags question: http://stackoverflow.com/q/29989147
tags question: http://stackoverflow.com/q/29897355
tags question: http://stackoverflow.com/q/29943363
tags question: http://stackoverflow.com/q/29920851
tags question: http://stackoverflow.com/q/29901898
tags question: http://stackoverflow.com/q/29888050
tags question: http://stackoverflow.com/q/29855452
tags question: http://stackoverflow.com/q/29952268
type: Tag

http://stackoverflow.com/comment/48070527
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29969385
has text: Essentially that's what I ended up doing, I found this site and the code worked great: http://blog.bogojoker.com/2008/06/javascript-sort-an-array-of-objects/ thanks for the reply!
score: 0

http://stackoverflow.com/a/29924089
accepted answer of: http://stackoverflow.com/q/29924013
has comment: http://stackoverflow.com/comment/47970040
answers question: http://stackoverflow.com/q/29924013
has body: One problem is never use click handler on a &lt;select&gt; , it will fire several times during the selection ... to open the select and then when user makes a choice. Always use change. It is not clear at all what your $.get is supposed to do since there is no callback shown for it
has comment: http://stackoverflow.com/comment/47970116
score: 0
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/q/29851939
downvote count: 0
score: 7
type: Question
has title: Use PDF.js offline
tagged with: javascript
tagged with: pdf.js
upvote count: 7
tagged with: http://stackoverflow.com/tag/pdf
has comment: http://stackoverflow.com/comment/47912356
answer count: 1
has answer: http://stackoverflow.com/a/31247079
accepted answer: http://stackoverflow.com/a/31247079
favorite count: 0
has body: Is it possible to use PDF.js without having the website online? I'm trying to do a simple offline website that reads pdf using pdf.js but it won't work without being online. Anyone could help?
type: AnsweredQuestion

http://stackoverflow.com/a/29864570
type: Answer
has comment: http://stackoverflow.com/comment/47854873
has body: You have many mistakes, Mistake 1: You are trying to disable the button before the DOM loads the button on the webpage, this will throw error. document.getElementById("mySubmit").disabled = true; This must be kept inside a function which is called onload. Mistake 2: var userNames = document.getElementById("userNameCheck"); Above line doesn't pass the value to the variable, Complete Working Solution : Copy-Paste this: &lt;script type="text/javascript"&gt; function onLoad() { document.getElementById("mySubmit").disabled = true; } function checkUserName() { var userNames = document.getElementById("userNameCheck").value; if(userNames === 'andrius'){ document.getElementById("mySubmit").disabled = false; } } &lt;/script&gt;
has comment: http://stackoverflow.com/comment/47854512
answers question: http://stackoverflow.com/q/29864387
score: 0
has comment: http://stackoverflow.com/comment/47855008

file
type: Tag
tags question: http://stackoverflow.com/q/29953238
tags question: http://stackoverflow.com/q/29989796
tag name: file
tags question: http://stackoverflow.com/q/29908241
tags question: http://stackoverflow.com/q/29996008
tags question: http://stackoverflow.com/q/29892174
tags question: http://stackoverflow.com/q/29934596
tags question: http://stackoverflow.com/q/29955586
tags question: http://stackoverflow.com/q/29864557
tags question: http://stackoverflow.com/q/29890242

http://stackoverflow.com/comment/47934155
type: AnswerComment
score: 0
has text: That fixed it thanks ! Took me hours and still couldn't solve it, that easy huh?
type: Comment
comment on: http://stackoverflow.com/a/29905070

http://stackoverflow.com/q/29927789
score: 0
has comment: http://stackoverflow.com/comment/47977725
type: UnansweredQuestion
has body: How to convert the following using js regex replace or something: var text = "line1&lt;br&gt;line2&lt;br&gt;line3&lt;br&gt;line4&lt;br&gt;" ...js regex... so that text becomes: text = "line1&lt;br&gt;line2&lt;br&gt;line3&lt;br&gt;"; of course the number of br varies, and each line length varies too
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/29928122
has comment: http://stackoverflow.com/comment/47977524
tagged with: javascript
has title: javascript remove last occurrence on a given string
has answer: http://stackoverflow.com/a/29927999

http://stackoverflow.com/comment/48032569
type: Comment
has text: So, in what kind of code do you in real life then run `typeof x == 'number'` without adding on `not isNaN(x)`? if there is any chance of `x` being `NaN` ?
type: AnswerComment
comment on: http://stackoverflow.com/a/29955858
score: 0

http://stackoverflow.com/q/29945035
tagged with: this
has answer: http://stackoverflow.com/a/29945426
has comment: http://stackoverflow.com/comment/48010941
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29945379
tagged with: node.js
has body: I have some code that I'm currently invoking everywhere like this. screenshot.snap(this, $('.navbar-inner .container')); In the above code, the this object being passed in is from mocha.js. It contains information like the current test name, the file it's in, etc. I use that information to name the screenshot. I want to remove the need to pass in the this reference everywhere, but no matter how I try to reach up to it inside of the snap function, I am unable to find the information I need. var testContext = exports.snap.caller; //.prototype? .this? I have inspected exports.snap.caller.toString(), and it is the function called in the mocha test suite. I did this through a debugging repl, and on further inspection see that the only information I can get is the properties of a function instance, which contains nothing from the calling function's this. Is there a way to do this, or am I stuck passing in the this argument every time I call my screenshot.snap function?
type: Question
has title: Grab `this` from caller function object
has comment: http://stackoverflow.com/comment/48011109
tagged with: javascript
score: 0
answer count: 2

http://stackoverflow.com/a/29856694
type: Answer
answers question: http://stackoverflow.com/q/29855374
score: 0
has body: When dealing with ajax calls, you need wait until each of them has finished the execution. Follow this pattern: var jobs = [11, 12, 14, 15]; function doTheJob() { if (jobs.length === 0) { alert('All jobs are done now.'); complete(); return; } var job_Id = jobs.pop(); $.ajax({ url: "/DoTheJob", complete: function () { doTheJob(); } }); };

http://stackoverflow.com/a/30079284
has body: Looks like you're using too many tags on your code. When you use @constructor, you shouldn't need @name or @type, since those are covered by using constructor. So, you've got two options, I think. Use @constructor and remove the redundant (conflicting) tags: /** * Something that acts like a class * @constructor space.someclass * @memberOf space * @param {any} y blah blah * @return {Object} The constructed object */ Or, if you don't want to use the @constructor tag, add the appropriate hinting yourself: /** * Something that acts like a class * @name space.someclass * @memberOf space * @kind class * @param {any} y blah blah * @return {Object} The constructed object */ In both cases, @type is redundant since you're documenting a class; the type would technically be the full name of your function (i.e., @type {space.someclass}).
answers question: http://stackoverflow.com/q/29906638
type: Answer
score: 0

http://stackoverflow.com/comment/47843419
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29858421
has text: Just want the animation to run once @gilly3 as soon as the user scrolls down 200 pixels so they see the numbers being animated
score: 0

http://stackoverflow.com/a/29917360
score: 1
has comment: http://stackoverflow.com/comment/47956149
has comment: http://stackoverflow.com/comment/47956196
upvote count: 1
answers question: http://stackoverflow.com/q/29916980
has comment: http://stackoverflow.com/comment/47955956
type: Answer
has body: You need .next() and not index(). .toggleClass() accepts just a single class name without a .. Also, toggling the class on which you are using any kind of selector is not recommended. $('.details-more').click(function(e){ e.preventDefault(); $(this).next('.overlay-wrapper').find('div').toggleClass('details'); //Instead of find('div') you could use a specific class selector - //find('.targetHidden') provided this class remains static throughout the html. }); Updated Fiddle
downvote count: 0

http://stackoverflow.com/comment/48046877
has text: @AxelAmthor so what sense do you have to solve this? Please do it then.
type: Comment
comment on: http://stackoverflow.com/a/29962684
score: 0
type: AnswerComment

http://stackoverflow.com/q/29898105
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29898753
accepted answer: http://stackoverflow.com/a/29898753
tagged with: twitter-bootstrap
type: Question
has comment: http://stackoverflow.com/comment/47919222
has title: Sticky navbar has glitchy behavior
has comment: http://stackoverflow.com/comment/47919029
tagged with: javascript
score: 4
upvote count: 4
answer count: 2
has body: So I've tried to custom make a navbar that is set right below a border around a page. I've made an illustration to help explain: On the page, I have a border (blue) around the whole page, then the navbar (red) which scrolls with the page until it hits the top of the navbar and sticks until the user scrolls back up. My problem is that it seems like something is shoving my navbar and its contents to the right once the js kicks (when the user scrolls past the top border) making an obvious jerk movement. Here is my html: Title <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %> <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %> <%= csrf_meta_tags %> <%= yield :scss %> <div class="container-main <%= layout %>"> <%= yield %> <%= yield :js %> Would anyone know how to fix this? I'm not sure if its a bootstrap thing that needs to be overridden or what...I've tried to set the navbar's margin-left to equate the movement but it ends up messing up the bootstrap columns I have set up...any advice appreciated! Here is my CSS: .main-nav { text-align: center; margin-top: 50px; background: transparent; height: 50px; z-index: 150; margin-bottom: -50px; } .main-nav-scrolled { position: fixed; width: 100%; top: 0; // margin-left: -35px; not working } .main-nav, .container { position: relative; } .container { background: transparent; padding: 100px } .layout-with-border { background: #eaeae8; //fixed for all product pages border: 35px solid #dad4c9; //theme color light } .layout-without-order { } Here is my JS: var mn = $(".main-nav"); mns = "main-nav-scrolled"; var BorderWidth = 35; $(window).scroll(function() { if( $(this).scrollTop() > BorderWidth ) { mn.addClass(mns); } else { mn.removeClass(mns); } }); Sorry, it's a little confusing how to post so many parts since I'm so new. I created a helper for the border layout: module ApplicationHelper def layout if params[:controller] == 'products' && params[:action] == 'show' 'lay…
has comment: http://stackoverflow.com/comment/47919823
downvote count: 0
tagged with: jquery
possible better answer: http://stackoverflow.com/a/29898275
favorite count: 0
has comment: http://stackoverflow.com/comment/47919317
has comment: http://stackoverflow.com/comment/47919172
has comment: http://stackoverflow.com/comment/47919859
tagged with: css
has answer: http://stackoverflow.com/a/29898275
has comment: http://stackoverflow.com/comment/47919155

http://stackoverflow.com/a/29883220
upvote count: 3
has body: You could use /proc/net/arp file and parse it like this : var fs = require('fs'); fs.readFile('/proc/net/arp', function(err, data) { if (!!err) return done(err, null); var output = []; var devices = data.toString().split('\n'); devices.splice(0,1); for (i = 0; i &lt; devices.length; i++) { var cols = devices[i].replace(/ [ ]*/g, ' ').split(' '); if ((cols.length &gt; 3) &amp;&amp; (cols[0].length !== 0) &amp;&amp; (cols[3].length !== 0) &amp;&amp; cols[3] !== '00:00:00:00:00:00') { output.push({ ip: cols[0], mac: cols[3] }); } } console.log(output); }); You can also try node-libnmap. Local peers can be by : require('libnmap').nmap('discover', function(err, report){ if (err) throw err console.log(report) })
score: 3
answers question: http://stackoverflow.com/q/29883126
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/76420461

http://stackoverflow.com/a/29896203
answers question: http://stackoverflow.com/q/29893389
downvote count: 0
has body: You can link straight to SSRS, which in turn can be told to spit out the report as PDF (it will be handled like any direct link to a PDF). The URL looks like this: &lt;SSRS_host&gt;/ReportServer?&lt;reportname&gt;&amp;rs%3aCommand=Render&amp;rs:Format=pdf&amp;&lt;report_params&gt; The focus being the &amp;rs:Format=pdf. &lt;report_params&gt; should be Param1=Value1&amp;Param2=Value2 and is used to fill the (obviously) report parameters. Be careful about permissions: If you link from Javascript, every user who can see the link must also be given permissions on SSRS (otherwise: 403 Forbidden) If you link from SDK (i.e. a plugin or an external assembly) then you can impersonate a "service user" (this is how we do this: a web service living alongside CRM which handles requests for PDFs) [AFAIK This is not applicable to CRM Online since you cannot get to SQL/SSRS directly]
score: 1
upvote count: 1
type: Answer

http://stackoverflow.com/comment/48088498
type: Comment
type: QuestionComment
has text: @dfsq yes apologies and we have a winner, that worked just fine. thanks man
score: 0
comment on: http://stackoverflow.com/q/29984446

http://stackoverflow.com/comment/47848240
type: AnswerComment
comment on: http://stackoverflow.com/a/29860359
type: Comment
has text: I think I know why. ID for date2 is assigned to the other main date element instead. Thanks alot!
score: 0

http://stackoverflow.com/a/29971086
type: Answer
has body: Use document.getElementsByName("navn").value[0] instead of document.famular.navn.value to get the value of an input field by its name. function validerform125() { if (document.getElementsByName("navn")[0].value == "") { alert("NEEEJ!!!"); return false; } } Navn Email You add [0] to document.getElementsByName("navn") because getElementsByName returns a NodeList object which represents a collection of elements with the specified name (In your case: "Navn"). By adding [0] you are basically returning the first element found.
answers question: http://stackoverflow.com/q/29970740
score: 0

http://stackoverflow.com/q/29986203
downvote count: 0
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/48093062
has comment: http://stackoverflow.com/comment/48092341
has body: I'm attempting to pull some URLs from an array and write them to the page as &lt;a&gt; HTML elements. As you can see in the jsfiddle below, for some reason the href is being set as [object text] and the URLs are being added as the link text, which means they don't work. How can I make it such that the href is the URL from my array and the link text is either the URL as well, or something like 'click here'? Code var title = document.createTextNode(titles[i]), author = document.createTextNode(authors[i]), url = document.createTextNode(urls[i]), titleX = document.createElement('h1'), authorX = document.createElement('h2'), urlX = document.createElement('a'); urlX.setAttribute('href', url); jsfiddle
has answer: http://stackoverflow.com/a/29986860
upvote count: 3
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/48091546
has comment: http://stackoverflow.com/comment/48091627
has answer: http://stackoverflow.com/a/29988286
type: Question
score: 3
has title: Formatting URLs from array as links
answer count: 2

http://stackoverflow.com/comment/47869394
comment on: http://stackoverflow.com/q/29872098
score: 0
type: Comment
type: QuestionComment
has text: http://stackoverflow.com/questions/1367700/whats-the-difference-between-keydown-and-keypress-in-net explains it well.

http://stackoverflow.com/a/30311773
answers question: http://stackoverflow.com/q/29943112
has comment: http://stackoverflow.com/comment/48845060
has comment: http://stackoverflow.com/comment/48799994
has comment: http://stackoverflow.com/comment/48845248
has comment: http://stackoverflow.com/comment/48845049
has comment: http://stackoverflow.com/comment/48844951
has body: Have you tried maybe making 2 map containers, then load the other one and fade in while fading out the other an toggle back and forth when changing them.
type: Answer
has comment: http://stackoverflow.com/comment/48844906
score: 2
upvote count: 3
downvote count: 1

http://stackoverflow.com/a/29887580
answers question: http://stackoverflow.com/q/29887216
type: Answer
has comment: http://stackoverflow.com/comment/47899691
has comment: http://stackoverflow.com/comment/47899328
score: 2
downvote count: 0
has body: Joe, you should actually be capturing the mouse position every time you click... ...but you're actually also starting a new game (without stopping the old one), every time you click, too. First problem: starting game engine several times to draw on the same instance of the canvas Solution: In your start function, you need to remove the mousedown event listener, after you've triggered it. function start () { // ... other setup function startMain (event) { canvas.removeEventListener("click", startMain); main(event); } canvas.addEventListener("click", startMain); } Now it will only listen for the first click, before starting, and will only start once. Second Problem: mouse doesn't update as expected Solution: two issues here... ...first, you are passing event into main on first call... ...after that, you're passing main into requestAnimationFrame. requestAnimationFrame won't call it with an event, it will call it with the number of microseconds (or ms or some other unit as a fractional precision of ms) since the page was loaded. So the first time you got main({ type: "mousedown", ... });. The next time you get main(4378.002358007); So lets refactor the startMain we had above, so that main never ever collects an event, just a time. function startMain ( ) { canvas.removeEventListener("click", startMain); requestAnimationFrame(main); } The next problem is that even if you were getting just events, you're only ever capturing a click event (which as we mentioned earlier, fires a new copy of the game logic). Your solution is to separate the code which catches mouse events from the code which reads mouse position. var mouseInput = { x: 0, y: 0 }; document.addEventListener("mousemove", function (event) { mouseInput.x = event.clientX; mouseInput.y = event.clientY; }); function getMousePos (rect, input) { return { x : input.x - rect.left, y : input.y - rect.top }; } // currently in updateImages (should not be there, but... a different story) var pos = getMousePos(canvas.getBound…
has comment: http://stackoverflow.com/comment/47900111
has comment: http://stackoverflow.com/comment/47899757
upvote count: 2

http://stackoverflow.com/a/29975169
has comment: http://stackoverflow.com/comment/48070969
answers question: http://stackoverflow.com/q/29975110
has comment: http://stackoverflow.com/comment/48070884
score: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/48071922
has body: It looks like your getPage function returns a jQuery Deferred object or promise. If that's the case, you should use .then rather than .done: function success(data) { console.log(data) } function error(jqxhr) { console.error('oh no!', jqhxr) } collection.getPage(0).then(success, error) $.Deferred.done accepts a single function argument. It will be called on success only. .then accepts a success callback and error callback.
type: Answer
accepted answer of: http://stackoverflow.com/q/29975110

http://stackoverflow.com/comment/48053711
type: AnswerComment
type: Comment
has text: A little correction here pls. the second ng repeat should be ng-repeat="orderDetail in order.orderDetails" where each order would have an array of order details called orderDetails
comment on: http://stackoverflow.com/a/29966883
score: 0

http://stackoverflow.com/q/29860444
has answer: http://stackoverflow.com/a/29860481
linked to: http://stackoverflow.com/q/14332972
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
has title: Jquery onchange does not trigger
accepted answer: http://stackoverflow.com/a/29860481
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/29860649
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/29860486
has body: $('#selectclassid').trigger("change"); $('#selectclassid').on('change', function() { }); I have this format for my onchange manual trigger of on change but the problem is it is not firing. I am wondering because this is the format I see in tutorials. Could there be anything wrong in the format of on change. I am hoping that it will fire on change when the page is loaded. By the way this select option is in a div that is hidden on load.But will show on button click if this event is related to the problem. Any idea is appreciated
possible better answer: http://stackoverflow.com/a/29860649
tagged with: jquery

http://stackoverflow.com/a/29983172
has comment: http://stackoverflow.com/comment/48086982
answers question: http://stackoverflow.com/q/29982756
upvote count: 1
type: Answer
has body: canvas.toDataURL('image/png') to turn the canvas into a base64 string which then you set the href of the download button and use the download attribute to do the file download. Note that the download attribute is not supported in all browsers so the file will just open in a new tab with _blank as a fallback. HTML save JavaScript var saveButton = document.getElementById('save'); save.onclick = function(e) { var dataUrl = canvas.toDataURL('image/png'); save.href = dataUrl; }; http://jsfiddle.net/moogs/6z2fx7xc/2/
downvote count: 0
score: 1

http://stackoverflow.com/comment/47896443
comment on: http://stackoverflow.com/a/29886084
type: AnswerComment
has text: Right, so I changed the directory phones to phones_json, and now I'm getting 'Not found' in the browser on going to http://localhost:8000/app/phones
score: 0
type: Comment

http://stackoverflow.com/comment/47927089
comment on: http://stackoverflow.com/a/29900640
score: 0
type: AnswerComment
has text: the "1" or 1 did not make a difference.. my hiddenfield value is still ""
type: Comment

http://stackoverflow.com/comment/48108358
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29994428
has text: Sorry for my bad english :S
type: AnswerComment

http://stackoverflow.com/q/29852000
has body: I'm developing a game using Node.js ; I have a Bot class containing a position attribute and a fire method. This method acts as follow: Bot.prototype.fire = function () { this.bombs.push(new Bomb(this.position)); }; Obviously, the bomb's position has to differ from the bot's position, so I want this.position to be copied into my new Bomb object. But in this case, the object is passed to the constructor by reference and not by value, so that if I write this.position = position in Bomb's constructor, the game will not work. Now my question is pretty straightforward : is there a simple way (I don't want to define a new function just for that) to pass the position object by value instead of by reference? Or am I forced to write something like this in Bomb's constructor : this.position = { x: position.x, y: position.y, angle: position.angle }; Thanks in advance for your help :)
type: AnsweredQuestion
score: 1
accepted answer: http://stackoverflow.com/a/29852185
type: Question
downvote count: 0
has answer: http://stackoverflow.com/a/29852188
tagged with: javascript
favorite count: 0
answer count: 3
has title: Javascript, pass-by-value an object to a constructor
has comment: http://stackoverflow.com/comment/47845940
has answer: http://stackoverflow.com/a/29852185
tagged with: pass-by-value
possible better answer: http://stackoverflow.com/a/29852180
upvote count: 1
has answer: http://stackoverflow.com/a/29852180

http://stackoverflow.com/q/29910191
tagged with: casperjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/48082359
has title: Grunt CasperJS not passing querystring parameters on click
answer count: 0
type: Question
has body: I have a CasperJS test something like below: casper.test.begin('Testing Querystrings', function suite(test) { casper.start() .thenOpen('http://www.example.com', function () { // }) .then(function () { this.click('.target a'); // links to http://www.example.com/page.html?q=test }) .then(function () { this.echo(this.getCurrentUrl()); // should output http://www.example.com/page.html?q=test }) .run(function () { test.done(); }); }); When I run this using the command line: casperjs test test.js Then everything runs fine and getCurrentUrl() shows the URL with the querystring I want to run the tests with Grunt however and have set everything up using grunt-casperjs When I run the the test via Grunt then the test runs OK but the URL is output without the query string. I really need this query string to be included so I can run some actual tests. Any ideas why this would be happening or if there is a fix or work around?
tagged with: javascript
tagged with: gruntjs
score: 0
has comment: http://stackoverflow.com/comment/47951005

http://stackoverflow.com/a/29997768
has comment: http://stackoverflow.com/comment/90836659
upvote count: 18
type: Answer
has body: Try: var ar = [{"value":"14","label":"7"},{"value":"14","label":"7"},{"value":"18","label":"7"}]; for(var i=0; i &lt; ar.length; i++) { if(ar[i].value == "14" &amp;&amp; ar[i].label == "7") { ar.splice(i,1); } } demo
score: 16
has comment: http://stackoverflow.com/comment/48115030
accepted answer of: http://stackoverflow.com/q/29997710
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29997710
downvote count: 2

http://stackoverflow.com/comment/48004904
has text: It looks like you're expecting `Number.BasicPrice` to cast `BasicPrice` to a number; that's not how Javascript does it. See the answers for how to fix that, but I think that's where the confusion is coming from
score: 0
comment on: http://stackoverflow.com/q/29941969
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29861143
answers question: http://stackoverflow.com/q/29861123
score: 2
has body: Try the code: ng-show="transaction.status !== 'DONE'" or ng-hide="transaction.status === 'DONE'"
downvote count: 0
type: Answer
upvote count: 2

http://stackoverflow.com/comment/47936534
score: 0
has text: Is that `owf` event triggering a `$digest` cycle? Try `$scope.$apply()` after setting the value.;
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29906926

http://stackoverflow.com/comment/47916408
type: QuestionComment
comment on: http://stackoverflow.com/q/29896599
has text: @Sourabh it is working on a current page but what I want is when I clicked on a button it should select all the check boxes fro all the pages
score: 0
type: Comment

http://stackoverflow.com/a/29900505
has body: Since you are setting the hidden field value from javascript, you can get it through Request.Form[] in codebehind. Request.Form[txtconfirmmessageValue.UniqueId] codebehind: protected void EndSession(object sender, EventArgs e) { string value = Request.Form[txtconfirmmessageValue.UniqueId]; if (!Utility.ToBool(value)) { return; } }
answers question: http://stackoverflow.com/q/29900098
upvote count: 1
has comment: http://stackoverflow.com/comment/47927078
type: Answer
downvote count: 0
score: 1

http://stackoverflow.com/a/29953120
score: 1
has comment: http://stackoverflow.com/comment/48027439
upvote count: 1
answers question: http://stackoverflow.com/q/29952458
type: Answer
has body: You can still use 2 for-loops and it doesn't look much worse in terms of code or clarity. But on average it will run slower O(n^2) than using map. var i,j; for(i = 0; i &lt; tagsArray.length; i++){ for(j = 0; j &lt; selectedTags.length; j++){ if(tagsArray[i].name === selectedTags[j].name){ tagsArray[i].selected = true; break; } } } JS Fiddle
downvote count: 0
has comment: http://stackoverflow.com/comment/48027144

http://stackoverflow.com/q/29960942
score: 8
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/48042853
downvote count: 0
has comment: http://stackoverflow.com/comment/115340051
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/29961853
has comment: http://stackoverflow.com/comment/48042415
favorite count: 0
has answer: http://stackoverflow.com/a/29961763
has body: I am trying to make a menu like the semantic UI but I only achieved to click the menu button and open the menu and vice versa. I use toggle class to show the sidebar but I dont know if this way is completely right: &lt;div class="menu-button" id="menu-button"&gt;&lt;/div&gt; $('#menu-button').click(function(event) { $('#hide-menu').toggleClass('show-menu'); }); .hide-menu { background-color:#336ca6; position: absolute; top:0; right:0; z-index: 1; width: 300px; height: 100%; -webkit-transform: translate3d(300px,0,0); -moz-transform: translate3d(300px,0,0); -o-transform: translate3d(300px,0,0); -ms-transform: translate3d(300px,0,0); transform: translate3d(300px,0,0); -webkit-transition: all 0.3s linear; -moz-transition: all 0.3s linear; -ms-transition: all 0.3s linear; -o-transition: all 0.3s linear; transition: all 0.3s linear; } .show-menu { -webkit-transform: translate3d(0,0,0); -moz-transform: translate3d(0,0,0); -o-transform: translate3d(0,0,0); -ms-transform: translate3d(0,0,0); transform: translate3d(0,0,0); } I've tried the event propagation but I can't manage to make it play.
has answer: http://stackoverflow.com/a/29961853
linked to: http://stackoverflow.com/q/28669033
upvote count: 8
type: Question
has comment: http://stackoverflow.com/comment/48042385
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/44878760
accepted answer: http://stackoverflow.com/a/29961763
has title: Hide menu sidebar when clicking outside the bar or the button
has answer: http://stackoverflow.com/a/51673512
answer count: 5
has answer: http://stackoverflow.com/a/29961308

http://stackoverflow.com/q/29912959
has title: Does javascript loaded via .load run even after it's "deleted"?
type: Question
has comment: http://stackoverflow.com/comment/47948126
has comment: http://stackoverflow.com/comment/47948096
score: 0
answer count: 1
has body: I don't know any better way of asking this, or search for it, so here it goes: I have a webpage that's basically a menu and a big white DIV in the center. All the subpages are loaded inside that div via .load. This is all fine, but: I want to know if scripts loaded with the page are still going to run after the div's content is changed to another sub-page. To get what I mean, please visit http://carnbox.zapto.org (testing VPS) and log in using the credentials tomi : tomi . Once logged in, go ahead and click on "My Services". All these scripts are inlined in the PHP pages that display the content. I found their lenght to be too small to make them external, and I wished to only load the scripts when viewing the page so the initial loading time of the website is smaller. After clicking on another page, which will replace the contents of the white space with another page, will the setintervals from the previous page still be running? Will the scripts still be loaded in the user's browser or will they also be wiped? Or more importantly, will swithing between the pages multiple times cause any trouble for the users? Is this error related to the way I'm loading scripts, and should I switch to external files and jquery.getscript() ? 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/
has answer: http://stackoverflow.com/a/29913072
type: AnsweredQuestion
tagged with: javascript
has comment: http://stackoverflow.com/comment/47948026
tagged with: jquery
accepted answer: http://stackoverflow.com/a/29913072

http://stackoverflow.com/comment/110495784
has text: Don't know why people downvoted you. This updates @Boopathi's answer to work for the newer Webpack versions, and it works just fine. (though I recommend renaming the `module` variable to `mod`, as `module` is a reserved word)
comment on: http://stackoverflow.com/a/57279355
type: Comment
score: 1
type: AnswerComment

http://stackoverflow.com/q/29943359
downvote count: 0
accepted answer: http://stackoverflow.com/a/29943410
type: Question
has title: How to create a html collection of elements located in separate divs
score: 1
has answer: http://stackoverflow.com/a/29943410
upvote count: 1
answer count: 1
tagged with: javascript
has body: I need to create a html collection containing five input-elements, with type = text. The html: Lorem When I do this, I get a collection with all the input-elements, I only want the ones that has the value = text. innerDivTag = document.getElementsByTagName("input"); And when I do this, I get five separate collections and that is not my aim. for (i = 0; i < outerDiv.length; i++) { innerDivTag = innerBox[i].getElementsByTagName("input"); }
favorite count: 0
type: AnsweredQuestion

http://stackoverflow.com/comment/48119836
type: Comment
type: QuestionComment
has text: @Vohuman i have updated the question please check and do give me any suggestions in which direction i should go
score: 0
comment on: http://stackoverflow.com/q/30000171

http://stackoverflow.com/q/29952338
type: AnsweredQuestion
tagged with: webgl
has answer: http://stackoverflow.com/a/29954422
type: Question
upvote count: 2
accepted answer: http://stackoverflow.com/a/29954422
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
has body: I'm playing around with shaders for the first time and using THREE.RawShaderMaterial on a few meshes. I'm getting some strange artifacts on my very simple shaders: Vertex shader: precision mediump float; precision mediump int; uniform mat4 modelViewMatrix; uniform mat4 projectionMatrix; attribute vec3 position; attribute vec4 color; varying vec3 vPosition; void main() { vPosition = position; gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); } Fragment shader: precision mediump float; precision mediump int; varying vec3 vPosition; void main() { gl_FragColor.r = vPosition.x; gl_FragColor.g = vPosition.y; gl_FragColor.b = 1.0; } which I use on a whole bunch of objects which are created like so: asdfobject = new THREE.Object3D(); scene.add(asdfobject); var geometry = new THREE.SphereGeometry(1, 4, 4); var material = new THREE.RawShaderMaterial({ uniforms: { time: { type: "f", value: 1.0 } }, vertexShader: document.getElementById( 'vertexShader' ).textContent, fragmentShader: document.getElementById( 'fragmentShader' ).textContent, side: THREE.DoubleSide, transparent: true, } ); for(var i = 0; i &lt; 80; i++) { var mesh = new THREE.Mesh(geometry, material); mesh.position.set(Math.random() - 0.5, Math.random() - 0.5, Math.random() - 0.5); mesh.position.multiplyScalar(400); mesh.rotation.set(Math.random() * 2, Math.random() * 2, Math.random() * 2); mesh.scale.x = mesh.scale.y = mesh.scale.z = Math.random() * 50; asdfobject.add(mesh); } The colour on the objects should be completely smooth, but sometimes they look a bit "glitchy" and pixelated like shown in this fiddle: https://jsfiddle.net/weqqv5z5/ This happens especially when resizing the window. I cannot figure out why this happens, I just know that the effect does not happen when transparent in the material is set to false (on line 23 in the fiddle) I haven't been able to test this on any other devices yet, so it may be a graphics card specific problem, too. I am running a 64-bit Arch Linux laptop…
tagged with: three.js
tagged with: opengl-es
score: 2
has title: Three js Shader Material - Pixelated glitching when transparency is set to true

http://stackoverflow.com/q/29942823
has title: Set two values for span jquery
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29942881
has answer: http://stackoverflow.com/a/29943168
has comment: http://stackoverflow.com/comment/48006623
accepted answer: http://stackoverflow.com/a/29943023
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29942891
possible better answer: http://stackoverflow.com/a/29942881
score: -4
upvote count: 1
type: Question
has body: I want to put two values or data into my span. I am putting value into span like this: $('#spanid').text(data[i].phonenumber); the code above will put the phone number to the span now I want to make it in a way that if the data has another number like mobile number i will add it to the text if available. I put it like this: $('#spanid').text(data[i].phonenumber|| data[i].mobilenumber); But only the first value is set even if there is a value for mobile number. Any idea is appreciated
has answer: http://stackoverflow.com/a/29943406
has answer: http://stackoverflow.com/a/29942959
downvote count: 5
tagged with: javascript
has answer: http://stackoverflow.com/a/29942912
has answer: http://stackoverflow.com/a/29943023
answer count: 7
tagged with: jquery
favorite count: 0

http://stackoverflow.com/comment/47883475
score: 0
has text: I think you're probably referencing SignalR before jQuery - jQuery is a dependency of SignalR. This also explains why nothing is being executed on `doc.ready`. Move the reference to the SignalR script and to the Hub proxy into your Layout view after the reference to jQuery
comment on: http://stackoverflow.com/q/29879573
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/47868496
type: QuestionComment
has text: Yeah, sorry about that.. No idea why my objects won't draw though :/
comment on: http://stackoverflow.com/q/29871666
score: 0
type: Comment

http://stackoverflow.com/q/29931867
has title: My Cookies won't save in JavaScript
has comment: http://stackoverflow.com/comment/47986388
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47986457
score: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47986459
answer count: 0
type: UnansweredQuestion
tagged with: php
type: Question
has comment: http://stackoverflow.com/comment/47986547
tagged with: cookies
has body: I've been messing around with this assignment and I'm pretty sure I'm about 90% done. Everything is working properly but for some reason the Cookies just won't save. When I enter information in the input fields and press submit, I get the alert that the code works. I ran it through some validation software and it said everything was validated and working. The HTML page I was given to code and verify the cookie (Not sure if I coded this right) says no cookies are saved. I also used the developer command in FireFox to check saved cookie lists it says there are no saved cookies for this site. Any ideas? Also while I'm here, the alert box pops up as soon as I load the page and when I click submit, how would I change it so it only pops up when I click submit? Here is the Code: http://jsfiddle.net/384x5n4a/4/ function addEvent(object, evName, fnName, cap) { if (object.attachEvent) object.attachEvent("on" + evName, fnName); else if (object.addEventListener) object.addEventListener(evName, fnName, cap); } function writeCookie(cName, cValue, expDate, cPath, cDomain, cSecure) { if (cName && cValue !== "") { var cString = cName + "=" + escape(cValue); if (expDate) cString += ";expires=" + expDate.toGMTString(); if (cPath) cString += ";path=" + cPath; if (cDomain) cString += ";domain=" + cDomain; if (cSecure) cString += ";secure"; document.cookie = cString; } } addEvent(window, "load", initPage, false); function initPage(){ document.getElementById("sbutton").onclick = saveMailingInfo; console.log(document.cookie); function saveMailingInfo() { var expire = new Date(); expire.setFullYear(expire.getFullYear() + 3); var allFields = document.mailingForm.elements; for (var i = 0; i < allFields.length; i++) { if (allFields[i].type == "text") { writeCookie(allFields[i].id, allFields[i].value, expire); } if (allFields[i].nodename == "SELECT") { writeCookie(allFields[i].id, allFields[i].selectedIndex, expire); } if (allFields[i].type == "radio" || allFields[i].type == "checkbox") { write…

http://stackoverflow.com/comment/48024942
has text: @Pratik I want to set `top` and `left` properties without using inline styling
score: 0
comment on: http://stackoverflow.com/q/29951972
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/48001932
type: Comment
comment on: http://stackoverflow.com/q/29940521
has text: Sorry, I have updated it...
score: 0
type: QuestionComment

http://stackoverflow.com/comment/48263722
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29992789
has text: Hey. Thanks for the update, I am doing more or less the same and as I mentioned this is not the problem. I cannot reproduce it in JSFiddle, so I am going to accept your answer even though my problem is not solved yet :( thanks for your efforts.
score: 0

http://stackoverflow.com/q/29863070
has answer: http://stackoverflow.com/a/29863197
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47851542
has comment: http://stackoverflow.com/comment/47851652
accepted answer: http://stackoverflow.com/a/29863197
tagged with: source-maps
upvote count: 7
has comment: http://stackoverflow.com/comment/47851688
type: Question
score: 5
has title: Why we use minified version of Angularjs (Reason to give preference to angular.min.js over angular.js even if we are adding angular.min.js.map)
tagged with: javascript
linked to: http://stackoverflow.com/q/18425841
has comment: http://stackoverflow.com/comment/47851600
duplicate of: http://stackoverflow.com/q/18425841
has comment: http://stackoverflow.com/comment/47851572
has body: I added angular.min.js to my project and faced this issue. http://localhost:8000/AngularProject/angular.min.js.map 404 (Not Found) angular.min.js.map:1 Upon research, I found that adding angular.min.js.map got rid of the "404 (Not Found)" error. I also found the reason for "angular.min.js.map": we add it because "source map files basically turn minified code into its unminified version for debugging". But, isn't the reason for using the minified file saving space and making the application faster? Now if we use angular.min.js we have to add angular.min.js.map also. Wouldn't it be much simpler to just add angular.js rather than adding two files(angular.min.js, angular.min.js.map). What is the meaning of having a minified version of angular.js?
has comment: http://stackoverflow.com/comment/47851777
answer count: 1
tagged with: minify
has comment: http://stackoverflow.com/comment/47852773
favorite count: 0
has comment: http://stackoverflow.com/comment/47851570
tagged with: angularjs
downvote count: 2
has comment: http://stackoverflow.com/comment/47851857
has comment: http://stackoverflow.com/comment/47851418

http://stackoverflow.com/q/29895569
linked to: http://stackoverflow.com/q/12840410
has body: I have a simple jQuery AJAX POST code: $.ajax({ type: "POST", url: AppConstants.URLs.PROXY, data: message, xhrFields: { withCredentials: true }, success: function(data, status, xhr) { console.log("Cookie: " + xhr.getResponseHeader("Set-Cookie")); } }); and I wish to get the cookie and save it using cookies-js. But according to http://www.w3.org/TR/XMLHttpRequest/#the-getallresponseheaders%28%29-method: Return all response headers, excluding headers that are a case-insensitive match for Set-Cookie or Set-Cookie2, as a single string, with each header line separated by a U+000D CR U+000A LF pair, excluding the status line, and with each header name and header value separated by a U+003A COLON U+0020 SPACE pair. Using the Network tool in Chrome, "Set-Cookie" is visible in the Response headers. I also verified that the "Set-Cookie" header appears using curl. What do I have to do to save the cookie in my front end app? Also, my app is running on https only. I'd gladly provide more details upon request.
tagged with: httpresponse
favorite count: 0
score: 11
possible better answer: http://stackoverflow.com/a/37955661
type: AnsweredQuestion
has title: Get and store cookie (from Set-Cookie) from an AJAX POST response
tagged with: cookies
tagged with: http-headers
upvote count: 11
type: Question
answer count: 2
downvote count: 0
accepted answer: http://stackoverflow.com/a/29895984
tagged with: javascript
has answer: http://stackoverflow.com/a/37955661
tagged with: ajax
has answer: http://stackoverflow.com/a/29895984

http://stackoverflow.com/q/29900073
score: 0
answer count: 1
type: UnansweredQuestion
tagged with: leaflet
has answer: http://stackoverflow.com/a/29901020
has title: As restrict visible area of the map?
type: Question
tagged with: google-maps
tagged with: javascript
has body: I can initialize the map in a specified coordinate but I need to restrict the size of the map so you can see and only a small part of it. var map = L.map('map').setView([23.047670, -81.560440], 13); L.tileLayer ('../tiles/{z}/{x}/{y}.jpg', { minZoom: 12, maxZoom: 16 }).addTo(map); var marker = L.marker([0,0], {draggable:true});

http://stackoverflow.com/a/29919437
score: 6
has body: You're replacing the element's contents on each loop. If you want to add to the contents, use += rather than = (as a minimal change): document.getElementById("number").innerHTML+=i+"&lt;/br&gt;"; // here -----------------------------------^ That said, I wouldn't do that, because it's making the browser do a lot of unnecessary work under the covers. Every time you read the value of innerHTML, the browser has to spin through the element and build up a string representing its contents; and every time you write to innerHTML, it has to parse the HTML, wipe out previous elements, and build new ones. Instead, consider building up a string and doing one assignment: function myFunction() { var i, s = ""; for (i=0; i&lt;11; i++) { s += i + "&lt;br&gt;"; } document.getElementById("number").innerHTML = s; } Side note 1: Your code is falling prey to The Horror of Implicit Globals because you're not declaring i. I've fixed that above by declaring it. Side note 2: &lt;/br&gt; is an invalid tag. In HTML, it's &lt;br&gt; (or &lt;br/&gt;; the ending / is entirely optional). In XHTML, it's &lt;br/&gt;.
type: AcceptedAnswer
downvote count: 0
upvote count: 6
type: Answer
accepted answer of: http://stackoverflow.com/q/29919394
answers question: http://stackoverflow.com/q/29919394

http://stackoverflow.com/comment/47849317
has text: @Pavan inside script tag
comment on: http://stackoverflow.com/q/29861728
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/47827615
type: Comment
has text: i didn't quite understand what do you want to be selected, if for example the DB returns 20 results, what is the one that you want to be selected?
comment on: http://stackoverflow.com/a/29850646
type: AnswerComment
score: 0

http://stackoverflow.com/q/29969491
score: 2
upvote count: 2
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29976469
tagged with: javascript
type: Question
has title: braintree - TokenizeCard not working
answer count: 1
downvote count: 0
favorite count: 0
tagged with: braintree
has answer: http://stackoverflow.com/a/29976469
has body: I am trying to update credit card saved in braintree vault with new values via following code:- var data = { cardholderName: $('#cardholder_name').val(), expirationDate: $('#expiration_date').val(), cvv: $('#cvv').val(), billingAddress: { firstName: $('#firstName').val(), lastName: $('#lastName').val(), streetAddress: $('#streetAddress').val(), locality: $('#city').val(), region: $('#state').val(), postalCode: $('#postalCode').val(), countryName: $('input[name="country"]').val(), } }; if($('#number').prop('disabled') == false) { data.number = $('#number').val(); } data.billingAddress['options'] = { updateExisting: true }; var client = new braintree.api.Client({clientToken: "&lt;?=$client_token?&gt;"}); client.tokenizeCard(data, function (err, nonce) { }); The above code works fine when i remove data.billingAddress['options'] = { updateExisting: true }; If I include the above line, i receive error Unable to tokenize card. How can I update existing billing address when I tokenize the credit card via javascript?
tagged with: php

http://stackoverflow.com/comment/48122769
comment on: http://stackoverflow.com/q/30001982
score: 0
type: Comment
type: QuestionComment
has text: Right but look at my ES5 file, it does import the script AND the module name automatically. To do the same with ES6 (to the extent of my knowledge) I would probably have to do: `import angularXx1Name from 'angular-xx1'; import angularXx2Name from 'angular-xx2'; angular.module('myFileName', [angularXx1Name, angularXx2Name]);` which is very cumbersome

http://stackoverflow.com/comment/48070755
type: Comment
comment on: http://stackoverflow.com/q/29974949
type: QuestionComment
has text: `I know that the answer would be all perfect squares` 2 is not a perfect square, so your expected output is wrong.
score: 0

http://stackoverflow.com/comment/48100129
type: AnswerComment
type: Comment
score: 0
has text: Thank you, but this does not work. The values that I receive is from an sensor. I want the data to have time. I will work on this an give you an answer when I have the solution, thank you for your help and time.
comment on: http://stackoverflow.com/a/29927588

http://stackoverflow.com/a/29959228
has body: You can't inject using a variable you define within another controller or service. One thing you could do is create a factory and put your dependencies in the $rootScope. app.factory('root',function($rootScope, $modal, $state){ $rootScope.modal = $modal; $rootScope.state = $state; }); You just put $rootScope in all your controllers and you have access to whatever you like. You would only need to inject 'root' in your main controller (if you have one). It seems like fishy architecture to need this shortcut, but that is how I would do it. No perf hit really - non-primitives are reference types.
answers question: http://stackoverflow.com/q/29959061
type: Answer
has comment: http://stackoverflow.com/comment/48039279
has comment: http://stackoverflow.com/comment/48039036
score: 0

http://stackoverflow.com/comment/47951603
score: 0
type: AnswerComment
type: Comment
has text: Yes, It can start from left also, but then it will not be in the center for larger resolution devices such as Desktop, if you want to check how it looks simply change #cycle-nav {text-align:left}
comment on: http://stackoverflow.com/a/29894170

http://stackoverflow.com/a/29973129
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/29971766
upvote count: 2
type: Answer
score: 2
accepted answer of: http://stackoverflow.com/q/29971766
has comment: http://stackoverflow.com/comment/48066775
has body: Unfortunately, when you change the parent of an element in the visual tree, it must be removed and re-added. Among other problems, consider how styling rules might be applied differently depending on who is whose parent. It's also a pretty expensive thing to do in an animation. Disappointing? Perhaps. But reading through your use case, I think you'll find Angular is very good at handling this sort of animation with just a tiny bit of code. I've included a fiddle for you to play with: http://jsfiddle.net/wjxgcb0k/ It's very easy to create and bind your own layout to the elements on the page. We'll first use ng-repeat to spit out one row per item: &lt;div class="container" ng-app ng-controller="Foo"&gt; &lt;div class="item" ng-repeat="item in items" ng-style="{'top': item.top + 'px'}"&gt;{{item.name}} &lt;/div&gt; &lt;/div&gt; Because we want to handle our own layout, each item in the container will be position: absolute. See how we bind the top to item.top + 'px'? All we need to do is adjust those top values in an animation loop. I'm going to use requestAnimationFrame because it's my go to tool for manual animation, but you can use css transitions or animations if you are more comfortable. I'll initialize the top values in the controller. That's what it's for, holding state: $scope.items.forEach(function(item, idx) { item.h = height; item.top = idx * (height + margin); console.log(item); }); And then I'll set up an animation loop: var tick = function() { $scope.$apply(function() { $scope.items.forEach(function(item, idx) { item.top -= velocity; if (item.top &lt; -(height + margin)) { item.top += $scope.items.length * (height + margin); } }); }); requestAnimationFrame(tick); }; And then kick off the whole thing: requestAnimationFrame(tick); Some neat improvements you can make with this: Consider only animating as many items as will fit on the page, rather than all of the items in the collection. Performance will thank you. Instead of relying on the $apply to propagate…

http://stackoverflow.com/q/29896962
has answer: http://stackoverflow.com/a/29897942
score: 1
favorite count: 0
has answer: http://stackoverflow.com/a/29897596
has title: Split String into Array with RegEx Pattern
answer count: 5
possible better answer: http://stackoverflow.com/a/29897942
upvote count: 1
tagged with: regex
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29899641
has answer: http://stackoverflow.com/a/29897407
type: Question
has body: I have a string that I want to split into an array. The string looks like this: 'O:BED,N:KET,OT,N:JAB,FA,O:RPT,' The string can contain any number of objects eg 'O:BED,N:KET,OT,N:JAB,FA,O:RPT,X:BLA,GTO' I want to split this string on the instance of \w: eg O: So I'll end up with array like this: ['O:BED','N:KET, OT','N:JAB,FA','O:RPT'] I am using the following code: var array = st.split(/^(\w:.+)(?=\w:)/g); However I end up with array like this : ['','O:BED,N:KET,OT,N:JAB,FA,','O:RPT,'] It seems the regex is being greedy, what should I do to fix it? Note I am using angularjs and eventually I want to end up with this : var objs = [ {type:O,code: BED, suf: ''}, {type:N, code: KET, suf: OT}, {type:N, code: JAB, suf: FA}, {type:O, code: RPT, suf: ''} ]
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/29898281
accepted answer: http://stackoverflow.com/a/29897407

http://stackoverflow.com/q/29959655
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/29959727
type: Question
has body: I am new to JS and taking a online class, I cant determine why this function does not return the intended value of 20. JavaScript Quiz Question #1 You can test a condition with an if..else statement or with an if..elseif..else statement True False Your total points are:
accepted answer: http://stackoverflow.com/a/29959727
tagged with: javascript
has comment: http://stackoverflow.com/comment/48039795
answer count: 2
has answer: http://stackoverflow.com/a/29959693
downvote count: 0
favorite count: 0
possible better answer: http://stackoverflow.com/a/29959693
has comment: http://stackoverflow.com/comment/48039840
has title: Javascript function is not returning the value
upvote count: 1

http://stackoverflow.com/q/29969231
favorite count: 0
has title: Hide dots when all divs/slides are visible - Owl carousel 2
type: Question
answer count: 2
score: 5
has comment: http://stackoverflow.com/comment/48058918
has answer: http://stackoverflow.com/a/29971553
has comment: http://stackoverflow.com/comment/48058336
has answer: http://stackoverflow.com/a/32031913
tagged with: owl-carousel
has comment: http://stackoverflow.com/comment/48059251
upvote count: 5
downvote count: 0
has body: everyone! I have dynamicaly generated owl carousel items and i could often have the situation in which all items in the carousel can be visible on the high resolutions. In that case i dont need that one "dot" showing below the carousel. So for e.g. i will have 4 items and all four of them will be visible on the desktop resolution and in that situation i dont need that one slide dot. but i will need the dots for smaller screens because smaller resolutions will display only 1 or 2 items per slide. but there could be situation with more than 4 items in the carousel (4 per slide max on big resolution) and in that case on big resolutions i will need the dots below. Is it possible to set owl carousel2 to hide dots or nav buttons when all divs inside the carousel are visible. i couldn't find that feature in documentation and i have also looked here about this topic but couldn't find the answer. If this feature is not supported already, can anyone help me how to make dot dissapear when all items in the carousell are visible? thx
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/48062889
has comment: http://stackoverflow.com/comment/48058129

http://stackoverflow.com/comment/48240650
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29978674
has text: @Shikkediel you shouldn't have deleted your answer because I found your solution the best and just when I was about to select your reply as sollution you deleted it. I'm sorry for the time you've waited but I couldn't look at the answers before.

http://stackoverflow.com/comment/48072786
type: QuestionComment
comment on: http://stackoverflow.com/q/29975813
has text: @Shivam He's getting the first "pre" tag inside a div with the specified ID.
score: 0
type: Comment

http://stackoverflow.com/a/30030692
upvote count: 2
answers question: http://stackoverflow.com/q/29980073
type: AcceptedAnswer
downvote count: 0
has body: You need to add name attribute for the form elements which values need to be included in the getValues { view:"text", name:"user", label:"Username"}, { view:"text", name:"pass", type:"password", label:"Password"},
has comment: http://stackoverflow.com/comment/48185905
type: Answer
score: 2
accepted answer of: http://stackoverflow.com/q/29980073

http://stackoverflow.com/comment/47959308
type: Comment
type: QuestionComment
score: 2
has text: Always add relevant code at SO.
comment on: http://stackoverflow.com/q/29919091

http://stackoverflow.com/comment/48129851
comment on: http://stackoverflow.com/a/29960375
has text: @user3214546 I don't agree with this statement. None of our applications required time input. Most applications i know only specify date, not time. Another consideration was that the time input in pickadate is kinda clunky.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/47816338
comment on: http://stackoverflow.com/q/29845275
type: Comment
type: QuestionComment
score: 0
has text: You missing comma in your `products` array

http://stackoverflow.com/q/29853229
has body: I have this php script which updates the fields that I want using three variables $field, $value and $id: <?php include_once("DBconnect.php"); $field = $_POST["field"]; $value = $_POST["value"]; $id = $_POST["id"]; if(mysqli_query($link," UPDATE users SET $field='$value' WHERE id='$id' ")) { echo "INFO1"; } else { echo mysqli_errno($link)." ".mysqli_error($link); } ?> And I use this AJAX script to send the three variables: $(document).on("change",".UserEdit_group",function(){ clearTimeout(TimerVar); var UserEditedId = $(this).parents(".tmptr").prev("tr").find(".CPidCell").text().trim(); var UserEditedLog = $(this).parents(".tmptr").find(".UserEditLog"); alert (UserEditedId); UserEditedLog.html(" "); UserEditedLog.css({"overflow":"hidden"}); UserEditedLog.animate({"max-height" : "1000px"},1000); $.ajax({ type: 'POST', url: 'useredit.php', data: { 'field' : 'group', 'value' : $(this).val().trim(), 'id' : UserEditedId }, success : function(result){ clearTimeout(TimerVar); if(result == "INFO1") { UserEditedLog.html(" 'group' field updated successfully! "); TimerVar = setTimeout( function(){clearUserEditLog()} ,4000); } else if(result == "ERROR1") { UserEditedLog.html(" failed attempt to update 'group' field! "); TimerVar = setTimeout( function(){clearUserEditLog()} ,4000); } else { UserEditedLog.html(result); } } }); }); And this is the HTML dinamicaly added with PHP: "; if($row['group'] == "Members") { echo " Members Moderators "; } else if($row['group'] == "Moderators") { echo " Members Moderators "; } echo " The thing is that I use the same PHP script and AJAX script (just with other values) to update other fields and it work perfectly. But when I use it to update the "group" field I get this error: 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 'group='Members' WHERE id='39'' at line 1 I noticed the two single quotes after that 39 but I can't understand why they are there because …
tagged with: php
type: AnsweredQuestion
tagged with: mysql
has title: MySQL Errno 1064
type: Question
answer count: 1
tagged with: javascript
tagged with: ajax
accepted answer: http://stackoverflow.com/a/29853257
score: 0
tagged with: sql
has answer: http://stackoverflow.com/a/29853257

http://stackoverflow.com/comment/47821126
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29847665
has text: _If this method is not overridden in a custom object, toString() returns "[object type]", where type is the object type._ ([ref](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/toString))
score: 9

http://stackoverflow.com/q/29923920
tagged with: mobile
accepted answer: http://stackoverflow.com/a/29926280
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/47971563
score: 0
tagged with: tablet
linked to: http://stackoverflow.com/q/11144370
has comment: http://stackoverflow.com/comment/47970454
has answer: http://stackoverflow.com/a/29926280
type: AnsweredQuestion
has body: I have put together a website and using javascript to run a script that allows you to move between one image and another to see the before and after of an image. The javascript works fine on a desktop but on a mobile and tablet I can't get the same effect to run properly. Do I need to include something to enable to this work on mobile &amp; tablet? This is one of the pages that I am on about where the effect is active. Here You will need to view this on a mobile and tablet to see it not working as it should. Also here is the javascript that I am using if it helps. Let me know if you require anything else. $(document).ready(function(){ var wrapper = $("div.reveal-visible"); wrapper.mousedown(function(e) { $(this).data("sliding", true); var offs = e.pageX - $(this).offset().left $(this).find('div').width(offs); }).mousemove(function(e) { if ($(this).data("sliding")) { var offs = e.pageX - $(this).offset().left $(this).find('div').width(offs); } }); $(document).mouseup(function(e) { wrapper.data("sliding", false); }); });
has comment: http://stackoverflow.com/comment/47970264
has title: Can't get my javascript action to run on tablet & mobile
type: Question

http://stackoverflow.com/comment/64422217
score: 0
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/29922772
has text: I would give you 100 upvotes for this if I could, thank you!

http://stackoverflow.com/q/29934583
has answer: http://stackoverflow.com/a/29934641
has comment: http://stackoverflow.com/comment/47991213
upvote count: 7
accepted answer: http://stackoverflow.com/a/29934626
possible better answer: http://stackoverflow.com/a/29934625
type: Question
has answer: http://stackoverflow.com/a/29934625
tagged with: javascript
has title: Why doesn't the length of the array change when I add a new property?
tagged with: arrays
downvote count: 0
score: 7
has body: var arr = ["Hello", "There", 123, 456, { show: function (value) { alert(value); } }]; arr[4].show(arr[0]); arr["Hello"] = { damn: function () { alert("What's happening yo !"); } } arr.Hello.damn(); alert("Arr length is: " + arr.length);
favorite count: 0
has answer: http://stackoverflow.com/a/29934626
answer count: 4
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29934881

http://stackoverflow.com/a/29974214
has body: try: var frm = $('#form1'); frm.submit(function (ev) { f = $('#form1'); $.ajax({ type: f.attr('method'), url: f.attr('action'), data: f.serialize(), success: function (data) { alert(data); } }); ev.preventDefault(); });
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/48068202
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/29974108

http://stackoverflow.com/a/40516665
score: 1
has body: My issue with the Carousel was not directly related to the image, but rather the content within it that was causing the shifting of the page. To avoid it while being elsewhere on the page, I just used JQuery to detect if I had scrolled past my carousel and to make it pause. I know its a workaround but its effective. $(document).on("scroll",function(){ if($(document).scrollTop()&gt;200){ $('#slider').carousel('pause'); } else{ $('#slider').carousel('cycle'); }});
downvote count: 0
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/29985360

http://stackoverflow.com/a/31229104
answers question: http://stackoverflow.com/q/29946212
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/29946212
type: AcceptedAnswer
upvote count: 1
type: Answer
has body: Usually, you would have different configs (one with the uglify and another without), for production and development, you would minimize only in production, if that's what you want. You probably already know this, but is good to be thorough. What you may not know, is that webpack does the job better and it is recommended to use untouched code and let webpack do its thing. I don't believe that the uglifyJsPlugin is able to target chunks, maybe there is another plugin that could do it, but i am unaware. As a side note, you don't have to worry about double minification, it adds a small effect, considering that it is a production environment and that it doesn't change by the minute.

yammer
type: Tag
tags question: http://stackoverflow.com/q/29916878
tag name: yammer

http://stackoverflow.com/comment/47886791
has text: Look into what `.each` and `.reduce` do in the docs - you need to pass them a promire-returning-function (whatever returns the promises you have in your `sequence`, as for chaining promises you can just do `promise.then(promiseReturningFn)`
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29880715
score: 0

http://stackoverflow.com/comment/48179167
type: AnswerComment
has text: the issue was that I didnt do $scope.user = { username: '', password: '' };
comment on: http://stackoverflow.com/a/29945682
score: 0
type: Comment

http://stackoverflow.com/q/29971384
favorite count: 0
tagged with: angularjs
has comment: http://stackoverflow.com/comment/48063433
has comment: http://stackoverflow.com/comment/48063344
type: UnansweredQuestion
has body: Is there anyway to do this? That is, if I have a snippet such as: $location.path("/splash"); Because I'm changing $location, angular will automatically reload the page (in order to reload all services/controllers). Basically my problem is that I have stale controller/service data being passed around that is messing my app up. Obviously something like this is just causing the page to infinitely reload: $rootScope.$on("$routeChangeSuccess", function(args){ $route.reload(); });
has comment: http://stackoverflow.com/comment/48063091
score: 2
downvote count: 0
has title: Force angular to reload on any route/location change
type: Question
has answer: http://stackoverflow.com/a/29971941
tagged with: javascript
tagged with: routes
upvote count: 2
answer count: 1

http://stackoverflow.com/a/29898282
has body: The bootgrid functionality must be activated using Javascript called on the HTML page. Full page code below: Note my HTML table called "tb1" and the javascript line in the HEAD that calls bootgrid function but passed through a value of "#tb1". @{ var db = Database.OpenConnectionString("server=.\\SQLEXPRESS;database=BlueprintManager;trusted_connection=True", "System.Data.SqlClient"); var selectedData = db.Query("SELECT * FROM tbBPGroups"); var grid = new WebGrid(source: selectedData); } My Site's Title JQuery Bootgrid Group ID Group Name Group Description @foreach(var xrow in selectedData){ @xrow.GroupID @xrow.GroupName @xrow.GroupDesc } Activate Bootgrid Now >>>
answers question: http://stackoverflow.com/q/29892036
score: 0
type: Answer

http://stackoverflow.com/q/29999459
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/48118534
has comment: http://stackoverflow.com/comment/48146490
has body: Enchant.js is not familiarly used, but since it using same OOP style like prototype.js i think i've got a chance to ask it here. this is my main.js: var DIR_LEFT = 0; var DIR_RIGHT = 1; var DIR_UP = 2; var DIR_DOWN = 3; enchant(); window.onload = function () { game = new Core(320, 320); game.preload( 'res/map0.png', 'res/chara0.png' ); game.fps = 30; game.onload = function() { var sceneGame = new SceneGame(); game.pushScene(sceneGame); } game.start(); //main gameplay scene var SceneGame = Class.create(Scene, { initialize: function() { Scene.apply(this); var stage, map, player, label; stage = new Group(); map = tileMap(game.assets['res/map0.png']); player = new Player(); label = new Label("hi!"); player.addEventListener(Event.ENTER_FRAME, this.update); this.player = player; this.map = map; stage.addChild(map); stage.addChild(player); this.Elx = 1; this.label = label; this.addChild(stage); this.addChild(label); var pad = new Pad(); pad.y = 220; this.addChild(pad); }, update: function() { this.Elx = 2; console.log("Elx :" + this.Elx ); console.log(this.player.x); } }); var Player = Class.create(Sprite, { initialize: function() { Sprite.apply(this, [32, 32]); this.image = game.assets['res/chara0.png']; this.x = 2 * 16; this.y = 16; this.dir = DIR_DOWN; this.anim = [ 9, 10, 11, 10, 18, 19, 20, 19, 27, 28, 29, 28, 0, 1, 2, 1]; // Frame setting if (!game.input.up &amp;&amp; !game.input.down &amp;&amp; !game.input.right &amp;&amp; !game.input.left) { this.age = 1; this.frame = this.anim[this.dir * 4 + (this.age % 4)]; } }, update: function (evt) { } }); } initialize is the Enchant.js object constructor method, the code above successfully returning the stage group child ( map and player) images on screen, but when i want to use on update SceneGame's method, the console returned 2 for the this.Elx but returning undefined error for this.player.x . Why this is happening ? any help are appreciated . thank you
tagged with: oop
linked to: http://stackoverflow.com/q/20279484
has comment: http://stackoverflow.com/comment/48119459
type: Question
duplicate of: http://stackoverflow.com/q/20279484
has answer: http://stackoverflow.com/a/30014345
has comment: http://stackoverflow.com/comment/48119103
has comment: http://stackoverflow.com/comment/48147082
tagged with: javascript
has title: Javascript OOP : Help retrieving value from my this.obj.value
score: 0
answer count: 1

http://stackoverflow.com/q/29888348
has comment: http://stackoverflow.com/comment/47900413
has comment: http://stackoverflow.com/comment/47900695
type: UnansweredQuestion
has body: I would like to convert a word file to pdf format on the fly, when a user downloads it from the server. Is there a way to do it using javascript? I am using DNN Sharp.
type: Question
has title: How to convert from Word to PDF format via javascript
has comment: http://stackoverflow.com/comment/47944228
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/29888428
answer count: 1

http://stackoverflow.com/comment/47891087
type: AnswerComment
has text: Found the answer in the link you provided: `localStorage`.
score: 0
comment on: http://stackoverflow.com/a/29883413
type: Comment

http://stackoverflow.com/comment/48058381
score: 1
comment on: http://stackoverflow.com/q/29969328
type: QuestionComment
type: Comment
has text: Did the whole web crash or the web server or the web browser?

http://stackoverflow.com/comment/47994869
has text: which map api are you using ?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29936376

http://stackoverflow.com/q/29874165
tagged with: javascript
tagged with: event-handling
has title: Problems with eventHandler arguments using geous.js lib
tagged with: dom-events
has comment: http://stackoverflow.com/comment/47886499
score: 0
has body: I'm having problems to retrieve the argument passed to my eventHandler. I'm using geous to put a map inside and activeadmin interface. The solution is working on the show page but I didn't get things working on the index page. The idea is to attach the handler to the dragend event on a marker with my model geographic coordinates. What I do: map.locations.add($fields.geousable('getLocation'), { draggable: true, on: { dragend: setFieldsLocation }}); and setFieldsLocation is defined below: function setFieldsLocation (event) { alert(setFieldsLocation.caller); console.log(event); $('.geousable').find("input")[0].value = event.data.lat; $('.geousable').find("input")[1].value = event.data.lng; }; So the first line bind the handler (for dragend) and a method inside the geous lib code attachs it and calls it when the event is fired, here is the snippet: var _onAdd = function (locationMarker, opts) { // not relevant code if (options.on) { for (event in options.on) { eventHandler = function() { var handler = options.on[event], location = locationMarker.location; return function() { handler.call(location); } }(); google.maps.event.addListener(locationMarker.marker, event, eventHandler); } } }; Debugger shows the location correct location variable when the handler is called, but I can't get the location variable inside my "setFieldsLocation" function. I tried a lot of things. I changed the header of the javascript function, I used event, e, arguments and this kind of things: console.log("arguments.callee.caller.name = " + arguments.callee.caller.name); console.log("arguments.callee.caller.toString() = " + arguments.callee.caller.toString()); But no luck. Ideas with an explanation of what is occurring here will be very appreciated.
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47928317
has comment: http://stackoverflow.com/comment/47885916
type: Question
tagged with: google-maps
has comment: http://stackoverflow.com/comment/47874473

http://stackoverflow.com/q/29853382
type: Question
has body: As the title says, sometimes it loads fine, sometimes it doesn't show at all. (Applies to all browsers) When it loads: http://puu.sh/hpkrH/03adef7313.png When it doesn't: http://puu.sh/hpkjT/097c9e3e67.png This code is loaded into the page just after closing the body tag but before closing the html tag. var rankedSolo5 = { GamesPlayed: 0, Wins: 0, Losses: 0, WinPercent: 0, Assists: 0, Kills: 0, MinKills: 0, NeutralMinKills: 0, TurretsKilled: 0, AverageKills: 0,}; $.ajax({ url: 'https://'+summonerRegion+'.api.pvp.net/api/lol/'+summonerRegion+'/v1.4/summoner/by-name/'+summonerName+'?api_key=76555fa3-4e44-4b11-8692-f2cfad2fd30d', dataType: 'json', //If summoner doesn't exist show error error : function(jqXHR, textStatus, errorThrown) { if(jqXHR.status == 404 || errorThrown == 'Not Found'){ $(".statsValue").html(summonerError);}}, //If summoner is found, find Id of summoner success: function(response) { nameToId = response; console.log(nameToId); console.log(nameToId[summonerName].name); $('#summonerProfileName').html(nameToId[summonerName].name); summonerId = nameToId[summonerName].id; $.ajax({ url: 'https://'+summonerRegion+'.api.pvp.net/api/lol/'+summonerRegion+'/v1.3/stats/by-summoner/'+summonerId+'/summary?season=SEASON2015&api_key=76555fa3-4e44-4b11-8692-f2cfad2fd30d', dataType: 'json', //When Id is found, retrieve Stats success: function(response) { if (summonerName != undefined){ jsonData = response; console.log(jsonData); //Ranked Solo 5v5 Stats rankedSolo5["Wins"] = jsonData.playerStatSummaries[5].wins; rankedSolo5["Losses"] = jsonData.playerStatSummaries[5].losses; rankedSolo5["Assists"] = jsonData.playerStatSummaries[5].aggregatedStats.totalAssists; $("#rankedAssistsSolo5 .statsValue").html(rankedSolo5["Assists"]); rankedSolo5["Kills"] = jsonData.playerStatSummaries[5].aggregatedStats.totalChampionKills; $("#rankedKillsSolo5 .statsValue").html(rankedSolo5["Kills"]); rankedSolo5["MinKills"] = jsonData.playerStatSummaries[5].aggregatedStats.totalMinionKills; $…
tagged with: http://stackoverflow.com/tag/html
upvote count: 1
has comment: http://stackoverflow.com/comment/47834648
has comment: http://stackoverflow.com/comment/47834748
type: UnansweredQuestion
has title: Google Chart won't always load up on page load
answer count: 0
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/47835091
tagged with: jquery
score: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/47837109

http://stackoverflow.com/q/29961729
has answer: http://stackoverflow.com/a/29964055
has body: i am trying to use jQuery.data() and save an Object to my HTML-Elements. Everytime i add an list-Element to my unordered List it only saves the last object to the specific li-Element. Every other li-Elements saved data gets thrown away! I've built a little Example. JSBin-Example On the left, i create a List with an Object saved to it. On the right i am trying to show the data related to the Object. Why does it only show the Object related to the last HTML-Element? Working example: JSBin-Example
possible better answer: http://stackoverflow.com/a/29962228
type: AnsweredQuestion
tagged with: data-binding
has answer: http://stackoverflow.com/a/29962228
upvote count: 3
has comment: http://stackoverflow.com/comment/48044016
has comment: http://stackoverflow.com/comment/48045907
accepted answer: http://stackoverflow.com/a/29962110
type: Question
score: 3
tagged with: javascript
has comment: http://stackoverflow.com/comment/48043891
has comment: http://stackoverflow.com/comment/48044522
answer count: 3
linked to: http://stackoverflow.com/q/500504
has comment: http://stackoverflow.com/comment/48044017
downvote count: 0
tagged with: jquery
has title: jQuery.data only saves data from the last Element
favorite count: 0
has answer: http://stackoverflow.com/a/29962110
tagged with: jquery-data
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/48044473

http://stackoverflow.com/a/29851282
upvote count: 2
has body: By default the stroke location of an SVG is in the center. (Thus in your case it's something like half a pixel is outside of the element, half of it is inside. That's probably why you have that wired looking effect.) Even though there unfortunately is no option to change that, there are ways to bypass that, like explained here: Can you control how an SVG&#39;s stroke-width is drawn? It should be possible to achieve these results using SVG Vector Effects, by combining veStrokePath with veIntersect (for 'inside') or with veExclude (for 'outside). However, Vector Effects are still a working draft module with no implementations that I can yet find.
answers question: http://stackoverflow.com/q/29850521
has comment: http://stackoverflow.com/comment/48013120
accepted answer of: http://stackoverflow.com/q/29850521
score: 2
type: AcceptedAnswer
downvote count: 0
type: Answer

http://stackoverflow.com/comment/47990306
has text: looks fine http://jsfiddle.net/arunpjohny/h9apvcww/2/ - in jsfiddle you have used `echo/html` with dataType as `json` that was the problem so the success method is never called... are you sure yours is getting called..
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29933792

http://stackoverflow.com/q/29855014
tagged with: http://stackoverflow.com/tag/json
tagged with: knockout.js
answer count: 1
tagged with: javascript
tagged with: jquery
score: 0
has answer: http://stackoverflow.com/a/29855076
accepted answer: http://stackoverflow.com/a/29855076
type: AnsweredQuestion
has body: hi it's a cordova app that use devexpress framework based on knockout i need to set visible only one item in a list the item should correspond to the param.id or this id_agenzia:ko.observable(params.id), i've tryed with jquery (setting the id "#"+$data.id_agenzia visible if == id_agenzia ) but if i integrate it doesn't work the goal is to do something like this if i put this line it ignores how is the right way to set visible only the div that corresponds to $data.id_agenzia is valid for $data.id_agenzia==id_agenzia ? thank you for help this is the js code with jsfiddle code added self.selected_id_agenzia = ko.observable('two'); self.jsonLista = ko.observableArray([ {id_agenzia:ko.observable('one'), nome:'N1'}, {id_agenzia:ko.observable('two'), nome:'N2'} noDataLabel: noDataLabel, this is the html code with jsfiddle code added
tagged with: cordova
has title: knockout - set visible only one item in a list generated by json
type: Question

http://stackoverflow.com/a/29857718
has body: As others have mentioned, you're getting the results in the order you see because the ajax request doesn't return with it's data and call your success callback until the response is received, but code continues to execute immediately after the $.ajax call. To get the workflow you're probably expecting, you could use promises, or simply pass in a callback: function getCurrentItems(id, onSuccess){ alert("2"); $.ajax({ url: "somePHPurlthatspitsoutajsonencodedArray.php", type: "POST", dataType: "json'", data: {id:id}, success: function(data){ alert("3"); onSuccess(data); } }); alert("4"); } $(document).on('click', '.eventClass', function(e){ alert("1"); var id = "someID"; var results = getCurrentItems(id, function(data){ console.log('data',data); alert("5"); }); });
score: -1
upvote count: 2
has comment: http://stackoverflow.com/comment/47841255
has comment: http://stackoverflow.com/comment/47841365
has comment: http://stackoverflow.com/comment/47841446
answers question: http://stackoverflow.com/q/29857639
downvote count: 3
has comment: http://stackoverflow.com/comment/47841482
has comment: http://stackoverflow.com/comment/47841449
type: Answer
has comment: http://stackoverflow.com/comment/47841326

http://stackoverflow.com/q/29886380
type: UnansweredQuestion
has body: Pretty basic question, not even sure if it's polymer specific since I think i'm just lacking some basic javascript knowledge. Anyways what I am trying to do is write a conditional statement based on the slider values entered in by the user. If the user were to enter an amount less than 5 on the slider then a contact form would pop up else if the sliders value is greater than 5 a list will appear. This is what I have so far HTML &lt;paper-slider id="slider" min="{{quiz.min}}" max="{{quiz.max}}" step="" immediateValue="{{value}}"&gt;&lt;/paper-slider&gt; JS &lt;script&gt; Polymer('topeka-quiz-picker', { eventDelegates: { down: 'answered', }, quizChanged: function() { this.value = this.$.slider.value = this.$.slider.secondaryProgress = this.quiz.min || 0; } }); if(this.value &gt; 5) { /* shows contact form */ } else { /* shows list */ } &lt;/script&gt; Edit* What would I have to put to track the value entered by the user and how would I create an element in the else statement or go to a different card? This is the topeka site I am trying to modify https://polymer-topeka.appspot.com/
has answer: http://stackoverflow.com/a/29892262
has title: How to modify attributes on polymer elements with javascript?
tagged with: material-design
type: Question
tagged with: polymer
tagged with: javascript
score: 0
answer count: 1
tagged with: jquery
tagged with: angularjs

http://stackoverflow.com/a/29994141
downvote count: 0
has comment: http://stackoverflow.com/comment/48108917
has body: You don't return anything from getUserInfo so you shouldn't expect anything from it. You are only returning something in the success callback function. That is is run asynchronously. It doesn't return anything for getUserInfo. If you want to make your ajax call a separate function you can make it return a promise from $.ajax instead of using a success callback. function getUserInfo(mapID){ return $.ajax({ url: user_url, type: "GET", cache: true, dataType: "json", statusCode: { 404: function () { handleError404("Error 404 at getUserInfo();") }, 500: function () { handleError500("Error 500 at getUserInfo();") }, } }); } then in main.js var promise = getUserInfo('2'); promise.done(function(userObj) { console.log(userObj); console.log(userObj.name); });
has comment: http://stackoverflow.com/comment/48107746
type: AcceptedAnswer
score: 4
answers question: http://stackoverflow.com/q/29994123
type: Answer
upvote count: 4
accepted answer of: http://stackoverflow.com/q/29994123
has comment: http://stackoverflow.com/comment/48107741

http://stackoverflow.com/q/29853688
answer count: 2
has title: JavaScript Switch Statement - Condition in Case
downvote count: 0
tagged with: javascript
favorite count: 0
has body: Can I put a conditional operator in my JS switch statement? eg. case n||n: eg. case "string2"||"string1": switch(expression) { case n||n: code block break; case n||n: code block break; default: default code block }
has answer: http://stackoverflow.com/a/29853721
linked to: http://stackoverflow.com/q/13207927
has comment: http://stackoverflow.com/comment/47833239
accepted answer: http://stackoverflow.com/a/29853721
upvote count: 2
has answer: http://stackoverflow.com/a/29853743
score: 2
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/29853743
tagged with: switch-statement
type: Question

http://stackoverflow.com/comment/47850481
type: QuestionComment
comment on: http://stackoverflow.com/q/29862532
has text: Save the selected option in a cookie.
score: 0
type: Comment

http://stackoverflow.com/q/29861762
type: Question
answer count: 2
accepted answer: http://stackoverflow.com/a/29862250
tagged with: angular-routing
downvote count: 0
linked to: http://stackoverflow.com/q/23438918
favorite count: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/30023883
has comment: http://stackoverflow.com/comment/47849261
tagged with: http://stackoverflow.com/tag/html
upvote count: 6
has comment: http://stackoverflow.com/comment/47850035
has title: AngularJS ng-view not showing view
possible better answer: http://stackoverflow.com/a/30023883
has body: I'm developing a web app with AngularJS for the frontend and i'm trying to set the routing and showing the views, so far even ng-include and other stuff work for me but not ng-view I'm developing in visual studio and when i run the app it's using a local server (localhost) here's my directory structure - ASP.NET project ---- Css ---- Scripts -------- App -------- app.js ----------- Home -------------- Controllers ------------------ index-controller.js ---- Views ------- Partials ---------- navbar.html ------- home.html - index.html Here's mi index.html Scolaris <ng-include src="'Views/Partials/navbar.html'"/> Here's my app.js 'use strict'; var app_module = angular.module('app_module', ['ngRoute']); app_module.config(['$routeProvider', function ($routeProvider) { $routeProvider .when('/', { templateUrl: '/Views/home.html', controller: 'indexController' }) .otherwise({ redirectTo: '/' }); }]); /* tried with ../../Views/home.html, ../Views/home.html, etc and nothing */ When i load the site it loads correctly and if i see the requests i can clearly see that it's requesting the home.html with 304 status code, the thing is the div with ng-view is not showing the html inside home.html, what could this be due to?
has answer: http://stackoverflow.com/a/29862250
score: 6
has comment: http://stackoverflow.com/comment/47849744
has comment: http://stackoverflow.com/comment/47849576
tagged with: angularjs-directive
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47849590
has comment: http://stackoverflow.com/comment/47849417
tagged with: javascript

http://stackoverflow.com/a/29963249
has comment: http://stackoverflow.com/comment/48046952
type: Answer
has body: You could try re-routing every asset request to a custom php file which then serves those resources (for example with mod_rewrite or a .htaccess file). You would then be able to log those requests. Beware though, this could lead to a considerable performance hit.
has comment: http://stackoverflow.com/comment/48046871
score: 0
answers question: http://stackoverflow.com/q/29961893

http://stackoverflow.com/comment/117253395
type: Comment
has text: No longer present in Webpack@5.x
score: 1
comment on: http://stackoverflow.com/a/46277717
type: AnswerComment

http://stackoverflow.com/q/29869671
has comment: http://stackoverflow.com/comment/47864435
type: UnansweredQuestion
tagged with: css
has answer: http://stackoverflow.com/a/29869703
type: Question
has answer: http://stackoverflow.com/a/29869705
has comment: http://stackoverflow.com/comment/47864927
has title: How to make CSS "execute" when user is viewing that part of the page?
tagged with: javascript
score: 0
answer count: 3
has body: Similar to how some CSS can be executed by events like using :hover, how could I make the same code execute when the user is simply viewing that part of the page? Example: user scrolls down to footer, and some nice CSS effects execute. I'll add a javascript tag to this thread incase that would be needed. Edit from comment: Some more context...I have a button with a bunch of CSS effects already in place, and was just looking to "activate" them upon viewing.
has comment: http://stackoverflow.com/comment/47864454
has answer: http://stackoverflow.com/a/29869730

http://stackoverflow.com/comment/47826345
type: Comment
type: QuestionComment
has text: Where do you have 'console.log(test)'?
comment on: http://stackoverflow.com/q/29850003
score: 0

http://stackoverflow.com/a/29911978
accepted answer of: http://stackoverflow.com/q/29893720
has body: Angular ng-table dynamic headers doesn&#39;t work inside as the answer there says "Define a template for a header, and set a template-header attribute of ng-table."
answers question: http://stackoverflow.com/q/29893720
score: 2
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 2

http://stackoverflow.com/q/29900241
upvote count: 1
has answer: http://stackoverflow.com/a/29917335
downvote count: 0
tagged with: javascript
has body: I have a page that embeds an iFrame with an external domain. So I can't insert anything into its DOM. The page is run with Node-Webkit (based on Chromium), but since this behavior is the same for any browser, I consider this to be a general JavaScript problem. I want to prevent users from "dropping links" into my page and into the iFrame. For my page, I can embed a small JavaScript snippet that listens to the specific events, e.g. "drop" or "dragend": // prevent dragging &amp; dropping links into this application: function handleDragEvent(e) { e.preventDefault(); e.stopPropagation(); return false; } var dragEvents = ['dragend', 'drop', 'dragenter', 'dragleave', 'dragover']; for (var i = 0; i &lt; dragEvents.length; i++) { window.removeEventListener(dragEvents[i], handleDragEvent); window.addEventListener(dragEvents[i], handleDragEvent); } So far, everything works fine: Links dropped into my page won't be navigated to. Links dragged from inside my page into the iFrame won't navigate, but still can be dragged into an external browser window (which could be prevented with "dragstart", but it's okay for me). But if the user drops a link from an external browser directly into the iframe, it "hijacks" the whole window - not just the iframe. That's what I want to prevent. I set up a small jsfiddle that demonstrates this odd behavior (tested with Firefox and Chrome). Question: How do I prevent the browser from changing the top location, if someone drops a link into the iFrame from an external window?
tagged with: drag-and-drop
has comment: http://stackoverflow.com/comment/69940824
favorite count: 0
type: UnansweredQuestion
tagged with: iframe
has answer: http://stackoverflow.com/a/42669229
tagged with: node-webkit
has title: Prevent iFrame from being busted by dropping a link
tagged with: framebusting
score: 1
type: Question
answer count: 2

http://stackoverflow.com/q/29933093
tagged with: asynchronous
tagged with: node.js
has title: node.js async each function callback failing
has comment: http://stackoverflow.com/comment/47988656
has comment: http://stackoverflow.com/comment/47988502
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29933231
has comment: http://stackoverflow.com/comment/47988493
has body: I'm making a call to my db, and want to use the results to fire off a request to another server, and then handle the responses. I want to do this asynchronously so I am trying to use the async library. var sendRequest = function (store) { console.log(store); } connection.connect(); connection.query('SELECT * from stores', function(err, rows, fields) { if (!err){ async.each(rows, function(row, sendRequest) { var store = {id: row.id, address: row.address}; //console.log(store); &lt;-- this works sendRequest(store); &lt;-- this logs {id: '', address: null} only once }, function(err){ console.log(err); }); } else console.log('Error performing query'); }); connection.end(); If I log the store variable directly, it logs for each instance in the array rows and properly. If I try to do it through the sendRequest callback, it does it only once and improperly.
has comment: http://stackoverflow.com/comment/47988623
type: Question
score: 0
answer count: 1
tagged with: javascript
tagged with: callback
has comment: http://stackoverflow.com/comment/47988590
has answer: http://stackoverflow.com/a/29933231

http://stackoverflow.com/q/29987154
tagged with: jquery
favorite count: 0
linked to: http://stackoverflow.com/q/22254248
tagged with: twitter-bootstrap
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/48095571
tagged with: css
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/29987759
upvote count: 1
has comment: http://stackoverflow.com/comment/48093593
has title: Expand Specific Accordion from URL
type: Question
tagged with: javascript
has body: If I use the adress "www.xxxxxx.com/test.html#chgd", the second accordion should be expanding. I have used the source code from this website 'Bootstrap 3 expand accordion from URL' but it does not work in this context. I do not know what is the problem based on the source code in order to expand the the second accordion based on URL? Child Survival: Boosting Immunity and Managing Diarrhoea ... Child Health, Growth and Development: Preventing Mental Impairment with Iodine and Iron ... Women’s and Newborn Survival and Health: Iron Supplementation and Food Fortification ...
accepted answer: http://stackoverflow.com/a/29987759
answer count: 1
downvote count: 0

http://stackoverflow.com/comment/47938504
has text: The key to binding to collections is to name the controls corretly with indexers. [Refer this article](http://haacked.com/archive/2008/10/23/model-binding-to-a-list.aspx/) for further information. You have not shown you models so impossible to give you an answer. [This answer](http://stackoverflow.com/questions/29837547/set-class-validation-for-dynamic-textbox-in-a-table/29838689#29838689) may also help
score: 0
comment on: http://stackoverflow.com/q/29907982
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29849089
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/29847941
accepted answer of: http://stackoverflow.com/q/29847941
type: Answer
upvote count: 2
score: 2
has body: You need to clear ctx on each textCircle call. Just add ctx.clearRect ( 0 , (top?0:y) , 600, y); in textCircle function. function textCircle(text,x,y,radius,space,top){ ctx.clearRect ( 0 , (top?0:y) , 600, y); space = space || 0; JSFiddle

http://stackoverflow.com/comment/47983144
score: 0
type: AnswerComment
has text: Just to clarify, you create one message listener. You wouldn't create one per action. You use if/switch in the 1 single listener and send different messages to trigger the conditional. You can repeat sendMessage as many times as you like.
type: Comment
comment on: http://stackoverflow.com/a/29930169

http://stackoverflow.com/q/29949366
favorite count: 0
has answer: http://stackoverflow.com/a/29963362
type: UnansweredQuestion
has title: remove class from JQuery dialog
upvote count: 1
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/48019633
tagged with: dialog
has answer: http://stackoverflow.com/a/29949457
tagged with: javascript
has body: using a div... $("#saveDialogSingleFeature").dialog({ width: "auto", height: "auto", minHeight: "none", position: { my: "left"+ leftPosOfMessage + "% top+" + extraHeaderSize, at: "bottom", of: $("header") }, show: { effect: "slideDown" }, hide: true, closeOnEscape: true, buttons:[], dialogClass: "alert", }).parent().appendTo("form:first"); //populate text of label $('#popUpLabel').text(popUpMessage); //remove titleBar $("#saveDialogSingleFeature").siblings('div.ui-dialog-titlebar').remove(); I can remove the titleBar, but I would also like to remove the ui-widget-content class from the dialog. //neither of these work $("#saveDialogSingleFeature").siblings('ui-widget-content').remove(); $('saveDialogSingleFeature').removeClass("ui-widget-content"); any idea as to why
score: 0
answer count: 2
tagged with: removeclass
tagged with: jquery
tagged with: asp.net

http://stackoverflow.com/q/29916581
has comment: http://stackoverflow.com/comment/48105288
tagged with: angularjs
type: Question
has answer: http://stackoverflow.com/a/31474066
score: 4
answer count: 2
has answer: http://stackoverflow.com/a/71482773
has comment: http://stackoverflow.com/comment/50902750
has comment: http://stackoverflow.com/comment/50881416
tagged with: webpack
tagged with: javascript
type: UnansweredQuestion
has body: I've cloned an egghead project using webpack (great tutorial). I've ran into the following error: 0 info it worked if it ends with ok 1 verbose cli [ 'c:\Program Files\nodejs\\node.exe', 1 verbose cli 'c:\Program Files\nodejs\nodemodules\npm\bin\npm-cli.js', 1 verbose cli 'start' ] 2 info using npm@2.5.1 3 info using node@v0.12.0 4 verbose node symlink c:\Program Files\nodejs\node.exe 5 verbose run-script [ 'prestart', 'start', 'poststart' ] 6 info prestart webpack-angular@1.0.0 7 info start webpack-angular@1.0.0 8 verbose unsafe-perm in lifecycle true 9 info webpack-angular@1.0.0 Failed to exec start script 10 verbose stack Error: webpack-angular@1.0.0 start: `node nodemodules/.bin/webpack-dev-server --content-base app 10 verbose stack Exit status 1 10 verbose stack at EventEmitter.&lt;anonymous&gt; (c:\Program Files\nodejs\node_modules\npm\lib\utils\lifecycle.js:213:16) 10 verbose stack at EventEmitter.emit (events.js:110:17) 10 verbose stack at ChildProcess.&lt;anonymous&gt; (c:\Program Files\nodejs\node_modules\npm\lib\utils\spawn.js:14:12) 10 verbose stack at ChildProcess.emit (events.js:110:17) 10 verbose stack at maybeClose (child_process.js:1008:16) 10 verbose stack at Process.ChildProcess._handle.onexit (child_process.js:1080:5) 11 verbose pkgid webpack-angular@1.0.0 12 verbose cwd C:\Users\Yonk\Documents\webPackApp 13 error Windows_NT 6.1.7601 14 error argv "c:\\Program Files\\nodejs\\\\node.exe" "c:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start" 15 error node v0.12.0 16 error npm v2.5.1 17 error code ELIFECYCLE 18 error webpack-angular@1.0.0 start:node nodemodules/.bin/webpack-dev-server --content-base app` 18 error Exit status 1 19 error Failed at the webpack-angular@1.0.0 start script 'node nodemodules/.bin/webpack-dev-server --content-base app'. 19 error This is most likely a problem with the webpack-angular package, 19 error not with npm itself. 19 error Tell the author that this fails on your system: 19 error node node_modules/.b…
upvote count: 4
downvote count: 0
has title: Webpack: error while running "npm start"
favorite count: 0

http://stackoverflow.com/a/29904998
accepted answer of: http://stackoverflow.com/q/29904628
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29904628
type: Answer
has body: You are adding listeners many times. You must add listener once out of loadCat function: image.addEventListener('click', function() { var i = this.getAttribute('data-id'); array[i].count = array[i].count + 1; catcount.innerHTML = array[i].count; }); I added attribute data-id for define which cat was clicked. And also id of cats in object must be started from 0 DEMO
downvote count: 0
score: 2
upvote count: 2

http://stackoverflow.com/comment/47824156
has text: Can you supply an example that demonstrates the problem... here is an example that seems to work fine: http://jsfiddle.net/dwcyvnLj/
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29848579

http://stackoverflow.com/comment/47933435
type: QuestionComment
type: Comment
has text: @MikeSmithDev I catch the request in `htaccess` and then in `php`, read the `w` and `h` parameters and then send the image file.
score: 0
comment on: http://stackoverflow.com/q/29905139

http://stackoverflow.com/comment/70712985
score: 0
type: AnswerComment
type: Comment
has text: @IvanBorisenko any solution yet? :)
comment on: http://stackoverflow.com/a/39821505

http://stackoverflow.com/q/29874970
score: 1
has title: How to add a docID from one NotesDocument to another using Java Script
favorite count: 0
has answer: http://stackoverflow.com/a/29875345
upvote count: 1
answer count: 1
tagged with: java
accepted answer: http://stackoverflow.com/a/29875345
has body: I have a lotus script that add a organization docID to the contactDoc and it work fine but I would like achieve this in java script Sub AddContactID(contact As NotesDocument, organisation As NotesDocument) contact.TmpIDString = organisation.DocID(0) Dim tmp As Variant tmp = |@SetField("ContactOrganisationIDs";@Trim(@Unique(ContactOrganisationIDs:TmpIDString)))| Dim flag As Variant flag = Evaluate(tmp,contact) Dim Item As NotesItem Set Item = contact.GetFirstItem("TmpIDString") If Not (Item Is Nothing) Then Call Item.Remove End If End Sub Reverse Function: Sub RemoveOrganisationIDByID(contactDocId As String, organisation As NotesDocument) Dim Session As New NotesSession Dim CurrDb As NotesDatabase Set CurrDb = Session.CurrentDatabase Dim contact As NotesDocument Set contact = CurrDb.GetDocumentByUNID(contactDocId) If contact Is Nothing Then Exit Sub If organisation Is Nothing Then Exit Sub Dim ContactOrganisationIDs As Variant ContactOrganisationIDs = contact.ContactOrganisationIDs pos = ArrayGetIndex(ContactOrganisationIDs, organisation.DocID(0)) If Not IsNull(pos) Then ContactOrganisationIDs(pos) = "" Call contact.ReplaceItemValue("ContactOrganisationIDs",FullTrim(ContactOrganisationIDs)) Call contact.Save(True, False) End If End Sub
type: AnsweredQuestion
downvote count: 0
tagged with: javascript
tagged with: xpages
type: Question
tagged with: lotus-notes

http://stackoverflow.com/a/29877581
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29877254
answers question: http://stackoverflow.com/q/29877254
type: Answer
has body: You're looking for an object called: {id: 1}, but your notification entries are larger. They contain other fields as well (not just an ID field). You're mixing up standard JavaScript comparison with MongoDB queries. Have a look at MongoDBs $pull operation. Something like: Meteor.users.update({_id: Meteor.userId}, { $pull: { 'profile.notifications': { id: this.id }, }}); (I haven't tested this code, not entirely sure about the id: this.id query..) Loading the data into memory, modifying it there and then writing it back might seem intuitive (I did the same thing at first^^), but operating directly on the database is a) more efficient and b) much more elegant.
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/47879940

http://stackoverflow.com/a/29879313
has body: Change your source line to:
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/47883325
answers question: http://stackoverflow.com/q/29879221
has comment: http://stackoverflow.com/comment/47882838

http://stackoverflow.com/q/29967488
has comment: http://stackoverflow.com/comment/48054826
has comment: http://stackoverflow.com/comment/48058620
favorite count: 0
has comment: http://stackoverflow.com/comment/48084930
has title: Setting fixed height panes based on responsive layouts
type: UnansweredQuestion
tagged with: css
has comment: http://stackoverflow.com/comment/48054870
score: 2
downvote count: 0
has answer: http://stackoverflow.com/a/29967822
has comment: http://stackoverflow.com/comment/48054681
has comment: http://stackoverflow.com/comment/48092213
type: Question
has comment: http://stackoverflow.com/comment/48054805
tagged with: performance
tagged with: javascript
has comment: http://stackoverflow.com/comment/48054807
has body: I have a webapp that follows responsive design and has following layout structure. The left layout appears when window's width &gt; 768px and right layout shows otherwise. Based on preliminary research I think there are no modern pure CSS ways of doing it so I implemented a jQuery code to solve it. $(window).resize(function() { if (window.innerWidth &gt; 768) { fixedHeight = window.innerHeight - $('.search__results').position().top; $('.search__results').addClass('overflow-y-scroll').height(fixedHeight); } else { $('.search__results').removeClass('overflow-y-scroll').height('auto'); } }); And my CSS class is shown .overflow-y-scroll { overflow-y: scroll; } I would like to leave my code up here for review and seek for DRY-er code, some spots I think may be up for improvement. 768px being fixed, should it be called from a global variable where it is the single point for setting the breakpoints? if yes I wonder where it should be placed so SCSS and javscripts can both use it? - should I name $('.search__results') as a variable? or perhaps even make it a more generic helper function? if yes? any tips on how to write it? I am also curious what is usually the best practice when creating such responsive layouts. thanks! ========== Edit 1: (Observation) It doesn't call before user initiate a resize action. Edit 2: (Improvement) Delay can be initiated to prevent calling resize action px by px
has comment: http://stackoverflow.com/comment/48054745
upvote count: 2
answer count: 1
tagged with: jquery

http://stackoverflow.com/q/29973567
type: AnsweredQuestion
tagged with: fibonacci
tagged with: algorithm
has comment: http://stackoverflow.com/comment/48066874
has body: I'm attempting to get better with optimizing algorithms and understanding big-o, etc. I threw together the below function to calculate the n-th Fibonacci number. This works (for a reasonably high input). My question is, how can I improve this function? What are the drawbacks of calculating the Fibonacci sequence this way? function fibo(n) { var i; var resultsArray = []; for (i = 0; i &lt;= n; i++) { if (i === 0) { resultsArray.push(0); } else if (i === 1) { resultsArray.push(1); } else { resultsArray.push(resultsArray[i - 2] + resultsArray[i - 1]); } } return resultsArray[n]; } I believe my big-o for time is O(n), but my big-o for space is O(n^2) due to the array I created. Is this correct?
type: Question
answer count: 2
score: 2
downvote count: 0
accepted answer: http://stackoverflow.com/a/29973646
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/66406610
has comment: http://stackoverflow.com/comment/48066977
tagged with: big-o
has title: Most efficient way to calculate Fibonacci sequence in Javascript
upvote count: 2
has comment: http://stackoverflow.com/comment/48067114
possible better answer: http://stackoverflow.com/a/44079427
has answer: http://stackoverflow.com/a/29973646
has answer: http://stackoverflow.com/a/44079427

http://stackoverflow.com/q/29973679
has comment: http://stackoverflow.com/comment/48067505
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/48067878
has comment: http://stackoverflow.com/comment/48067365
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/48067829
has comment: http://stackoverflow.com/comment/48067330
has body: I am using a plugin that one of my peers has developed internally that takes a HTML table and turns it into an excel file for exporting using PHPExcel &amp; simple_HTML_DOM. What happens is when called, it finds the table element, adds the html to a textarea and posts it to the PHP will which does the processing. The issue is when we have a large amount of data in the table, it sends that content to the textarea element which seems to then break. Here is the snippet of code that takes the HTML and adds it to a textarea: var tableToExcel = { download:function(html, fileName, fileExtension, autosizeToColumn){ if(html &amp;&amp; html!=""){ if(!document.getElementById('tableToExcelForm')){ var f = document.createElement('form'); f.setAttribute('method', 'post'); f.setAttribute('action', window.location.protocol + "//" + window.location.host + "/resources/tableToExcel.php"); f.setAttribute('id', 'tableToExcelForm'); f.style['display'] = "none"; var t = document.createElement('textarea'); t.setAttribute('name', 'table'); t.setAttribute('id', 'tableToExcelTextarea'); ...... document.getElementsByTagName('body')[0].appendChild(f); document.getElementById('tableToExcelTextarea').value = html; document.getElementById('tableToExcelForm').submit(); If I pass the HTML to the PHP file directly, it works fine no matter the size so I know that's working fine. I believe it comes down to the amount of data a text area can hold even though its not implied in my code. Is there another element that I can use to store this data before posting it to my PHP file?
has comment: http://stackoverflow.com/comment/48068248
has comment: http://stackoverflow.com/comment/48068422
tagged with: php
has title: Limit on Textarea Element when Posting Data
type: Question
has comment: http://stackoverflow.com/comment/48068058
has comment: http://stackoverflow.com/comment/48067810
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/48068499

http://stackoverflow.com/q/29961411
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29961431
type: Question
tagged with: javascript
tagged with: jquery
has body: i'm trying to make function toogle layer using java script, this is the code : $(document).ready(function(){ function changeLayer(idSelections) { if (idSelections === "Agro Industri") { if (document.getElementById("AI").checked === true) { if(AI.getMap() === null) { AI.setMap(map); } } if (document.getElementById("AI").checked === false) { AI.setMap(null); // layer set off } } }; }); and this is the HTML : &lt;body&gt; &lt;div class="row"&gt; &lt;input type="checkbox" name="Agro Industri" value="Agro Industri" id="AI" onClick="changeLayer(this.value)"&gt; Layer AI&lt;br/&gt; &lt;/div&gt; &lt;script src="js/scripts.js"&gt;&lt;/script&gt; &lt;/body&gt; but every i try to check/uncheck the checkbox, i always got this error Uncaught ReferenceError: changeLayer is not defined. could someone help to to fix this error ?
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has title: Uncaught ReferenceError: changeLayer is not defined
has answer: http://stackoverflow.com/a/29961431

http://stackoverflow.com/a/29867165
has comment: http://stackoverflow.com/comment/47919845
upvote count: 1
has comment: http://stackoverflow.com/comment/47920179
accepted answer of: http://stackoverflow.com/q/29856383
has comment: http://stackoverflow.com/comment/47919393
has comment: http://stackoverflow.com/comment/47921735
score: 1
has body: So I had a crack at it anyway (see comments) and made this from it : http://codepen.io/anon/pen/mJyBgj?editors=011 var gate = $(window); var slider = $('#slider'); var slide = $('.slide'); var winWidth = gate.width(); slide.css({width: winWidth}); gate.resize(function() { winWidth = gate.width(); slide.css({width: winWidth}); }); var slideW = slide.width(), slidesQty = slide.length, sliderFullW = slidesQty*slideW, slideMvCheck = winWidth/2; slider.css({width: sliderFullW}); function cycleSlides() { $('.slide').eq(0).animate({opacity: 0}, 700); $('.slide').eq(1).delay(700).animate({opacity: 1}, 2000); slider.animate({left: -winWidth}, 2000, function() { $('.slide').eq(0).appendTo(slider); slider.css({left: 0}); }); } var autoSlide = setInterval(function() { cycleSlides(); }, 4000); The tricky thing with using a fade is that it will hide the element when opacity is zero, taking it out of (and interfering with) document flow. So I've made it an opacity animation (keeping physical dimensions intact). Hope that's closer to what was intended. Added a bit of CSS to set opacity to all but the first visible slide : .slide:not(:first-of-type) { opacity: 0; }
has comment: http://stackoverflow.com/comment/47896531
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/29856383
has comment: http://stackoverflow.com/comment/47918736
type: Answer

http://stackoverflow.com/q/29928397
type: AnsweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/47979160
upvote count: 1
linked to: http://stackoverflow.com/q/9127498
type: Question
has title: Search into divs
has body: I found this post How to perform a real time search and filter on a HTML table and I would like to adapt it to search in divs. Html : Panel 1 1 Panel 2 2 Js: var $rows = $('#table tr'); $('#search').keyup(function() { var val = '^(?=.*\\b' + $.trim($(this).val()).split(/\s+/).join('\\b)(?=.*\\b') + ').*$', reg = RegExp(val, 'i'), text; $rows .show() .filter(function() { text = $(this).text().replace(/\s+/g, ' '); return !reg.test(text); }) .hide(); }); Can someone explains how to access content into my div (and here, in "panel-heading") ?
has answer: http://stackoverflow.com/a/29928659
tagged with: indexof
has comment: http://stackoverflow.com/comment/47979071
tagged with: javascript
tagged with: search
answer count: 1
downvote count: 0
favorite count: 0
accepted answer: http://stackoverflow.com/a/29928659

http://stackoverflow.com/q/29911443
has answer: http://stackoverflow.com/a/29911654
tagged with: http://stackoverflow.com/tag/json
type: Question
has comment: http://stackoverflow.com/comment/47945140
has comment: http://stackoverflow.com/comment/47944980
tagged with: javascript
has answer: http://stackoverflow.com/a/29911495
score: 0
answer count: 2
has title: AngularJs read json file
has comment: http://stackoverflow.com/comment/47945012
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47945922
has body: I have a tree which is created dynamically with json.There is a one controller and in this controller there is a json array.I use this json to create a tree,but i need to read this json from file externally. My controller; .......... $scope.myjson = { "option1": [ { "child":[{"label":"Test1" },{"label":"Test2"}], "id": "option1" } ], "option2": [ { "child":[{"label":"Test1.1",}], "id": "option2" } ], ........... } Json array reading part(In Controller); angular.forEach($scope.myjson, function(value, key) { if (key === 'option1') { for(var t=0;t&lt;$scope.myjson[key][0].child.length;t++) { ......Somethings......... } } I want to call json file and read it to create a tree.How can i call json file and read in angularjs?

http://stackoverflow.com/a/29917107
has comment: http://stackoverflow.com/comment/110372139
has body: as PSkocik said, first detect the platform and get the command line : function getCommandLine() { switch (process.platform) { case 'darwin' : return 'open'; case 'win32' : return 'start'; case 'win64' : return 'start'; default : return 'xdg-open'; } } second , execute the command line followed by the path var exec = require('child_process').exec; exec(getCommandLine() + ' ' + filePath);
accepted answer of: http://stackoverflow.com/q/29902347
downvote count: 3
upvote count: 26
type: Answer
answers question: http://stackoverflow.com/q/29902347
has comment: http://stackoverflow.com/comment/126188914
has comment: http://stackoverflow.com/comment/115584133
has comment: http://stackoverflow.com/comment/110354459
has comment: http://stackoverflow.com/comment/64917470
has comment: http://stackoverflow.com/comment/110320250
score: 23
has comment: http://stackoverflow.com/comment/137596026
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/114286822

http://stackoverflow.com/comment/48004346
type: QuestionComment
has text: Why is services not working?
comment on: http://stackoverflow.com/q/29941713
type: Comment
score: 1

http://stackoverflow.com/a/29944060
type: Answer
score: 1
has body: Use an object rather than an array: var associativeArray = { city: "Portland", state: "Oregon", country: "United States" }; dwr.util.addOptions(makeId3.id, associativeArray, false); Or if you want to add the properties dynamically, use: var associativeArray = {}; associativeArray['city'] = "Portland"; associativeArray['state'] = "Oregon"; associativeArray['country'] = "United States"; See the documentation. It treats an array argument differently from an object.
upvote count: 1
downvote count: 0
answers question: http://stackoverflow.com/q/29943609

http://stackoverflow.com/q/29988270
has comment: http://stackoverflow.com/comment/48095968
tagged with: angularjs
has body: I have an array in the below format. var produce = [ {'supplierID':1,'produceID':1, 'name':'apple', 'qty': 10}, {'supplierID':1,'produceID':2, 'name':'carrot', 'qty': 10}, {'supplierID':1,'produceID':2, 'name':'bean', 'qty': 20}, {'supplierID':1,'produceID':1, 'name':'bananna', 'qty': 30}, {'supplierID':1,'produceID':1, 'name':'orange', 'qty': 65}, {'supplierID':2,'produceID':2, 'name':'pumpkin', 'qty': 120}, {'supplierID':2,'produceID':2, 'name':'cucumber', 'qty': 18}, {'supplierID':2,'produceID':1, 'name':'strawberry', 'qty': 130}, {'supplierID':2,'produceID':1, 'name':'mango', 'qty': 60}, {'supplierID':2,'produceID':1, 'name':'grapes', 'qty': 140} ]; //produceID 1 = fruit //produceID 2 = veg I want it in this sort of format. { 'id': 1, 'fruit': [ { 'name': 'apple', 'qty': 10 }, { 'name': 'bananna', 'qty': 30 }, { 'name': 'orange', 'qty': 65 } ], 'veg': [ { 'name': 'carrot', 'qty': 10 }, { 'name': 'bean', 'qty': 20 }, ] }, { 'id': 2, 'fruit': [ { 'name': 'strawberry', 'qty': 130 }, { 'name': 'mango', 'qty': 60 }, { 'name': 'grapes', 'qty': 140 } ], 'veg': [ { 'name': 'pumpkin', 'qty': 120 }, { 'name': 'cucumber', 'qty': 18 }, ] } So that I can group my items first by supplier then by produce type (fruit/veg) (using angular js) Supplier - {{res.id}} Fruit {{f.name}} Veg {{v.name}} A working eg of this can be seen in this codepen. http://codepen.io/anon/pen/rVVJjg How can I achieve this? So far I have found that I need to find all suppliers which I can with the below. //get unique suppliers var unique = {}; var distinct = []; for( var i in produce ){ if( typeof(unique[produce[i].supplierID]) == "undefined"){ distinct.push(produce[i].supplierID); } unique[produce[i].supplierID] = 0; } console.log(distinct); I can also get the right format for supplierID == 1 as shown below, but not sure how I could scale this to handle multiple suppliers var fruit = []; var veg = []; var res = []; for (var i in produce) { if (produce[i].supplierID == 1) { if (produce[i].produceID == …
tagged with: multidimensional-array
has answer: http://stackoverflow.com/a/29989405
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/48095891
has title: javascript group unique items in array
score: 0
type: Question
accepted answer: http://stackoverflow.com/a/29989405
tagged with: arrays
tagged with: javascript
answer count: 1

http://stackoverflow.com/q/29880282
score: 0
answer count: 3
upvote count: 1
has body: At the bottom of every page, I have a .php include that links to all my .js files. <?php include 'Core/js.php';?> Within this .php I have this code; This works perfectly for my pages placed in my root folder, ie "index.php" However, the pages that are located in folders, don't seem to call the javascript when I use the .php include such as; <?php include '../../../Core/js.php';?> Although, when I don't use the include funtion, and just paste the < script>, it calls it perfectly. This wouldn't be a huge problem for me, but it doesn't allow the mobile site to run properly. The first pages such as "index.php" have the mobile navigation, whereas pages located in the folders and don't have the php include code, don't have the same user friendly navigation. If someone could help me fix this, that would be great!
downvote count: 1
has comment: http://stackoverflow.com/comment/47884824
has comment: http://stackoverflow.com/comment/47884859
has answer: http://stackoverflow.com/a/29880390
favorite count: 0
type: UnansweredQuestion
tagged with: php
has title: .js files not being called on pages included in folders
has answer: http://stackoverflow.com/a/29880422
type: Question
tagged with: mobile
has comment: http://stackoverflow.com/comment/47884881
tagged with: javascript
has comment: http://stackoverflow.com/comment/47884973
has answer: http://stackoverflow.com/a/29880415

http://stackoverflow.com/comment/48012282
score: 0
type: AnswerComment
type: Comment
has text: yea try moving `return service` inside your inner success
comment on: http://stackoverflow.com/a/29944912

http://stackoverflow.com/comment/47878408
type: QuestionComment
comment on: http://stackoverflow.com/q/29874791
has text: But how can I make sure that the new mesh doesn't intersect with existing ones? Even if the new random position and all vertices of the polygon to be created are not in one of the existing polygons, edges of polygon still have chance to intersect other objects. @Careen
score: 0
type: Comment

http://stackoverflow.com/comment/47983326
score: 0
has text: I spotted a typo - try it now
type: AnswerComment
comment on: http://stackoverflow.com/a/29930169
type: Comment

http://stackoverflow.com/comment/48289896
type: AnswerComment
has text: I'm running into another perf issue: since the clone is returned asynchronously, the time it takes to append the clone to my container is highly variable. Is there a synchronous API to get the clone?
comment on: http://stackoverflow.com/a/29959195
type: Comment
score: 0

http://stackoverflow.com/comment/47834145
type: Comment
has text: ah!! that was all i needed, to user jQuery.on instead of jQuery.click. thank you!!
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29853638

radio-button
tags question: http://stackoverflow.com/q/29937183
tags question: http://stackoverflow.com/q/29952557
tag name: radio-button
tags question: http://stackoverflow.com/q/29886618
type: Tag
tags question: http://stackoverflow.com/q/29862140
tags question: http://stackoverflow.com/q/29926687
tags question: http://stackoverflow.com/q/29958134

http://stackoverflow.com/q/29877507
answer count: 1
has title: How to make my button work after I've been writing?
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has body: Im trying to make some kind of "blog" buttons. I want to click on a button, and then it will write in my textarea for whatever button I clicked. But for some reason, it wont add if I've been writing or done anything in the textarea before I clicked. Länk Fet Bild And my scriptcode is function knapp(value) { var text; switch(value){ case "fet": text = ''; break; case "lank": text = 'Klicka här'; break; case "bild": text = ' '; break; } var pp = document.createTextNode(text); document.getElementById('knappar').appendChild(pp); } So when I click the button, it writes and append. But if I've been writing, or deleting something, it wont work. I'm fairly new with Javascript, so sorry for noob question.
type: AnsweredQuestion
downvote count: 0
score: 1
accepted answer: http://stackoverflow.com/a/29877543
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/29877543
upvote count: 1

http://stackoverflow.com/a/31770875
accepted answer of: http://stackoverflow.com/q/29891458
answers question: http://stackoverflow.com/q/29891458
has comment: http://stackoverflow.com/comment/55246667
downvote count: 0
score: 49
has comment: http://stackoverflow.com/comment/74968558
has comment: http://stackoverflow.com/comment/102496934
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/76782508
has comment: http://stackoverflow.com/comment/74967127
upvote count: 49
type: Answer
has body: Solution: var req = require.context("../someDir", true, /^(.*\.(js$))[^.]*$/igm); req.keys().forEach(function(key){ req(key); }); // or just: req.keys().forEach(req) extra: regex to match js but ignore test.js /^(?!.*test.js)((.*\.(js\.*))[^.]*$)/igm)

http://stackoverflow.com/comment/47916974
type: Comment
type: QuestionComment
score: 0
has text: Well it coerces to a Boolean, and returning a Boolean is quite different to returning an Object property?
comment on: http://stackoverflow.com/q/29897137

http://stackoverflow.com/q/29922088
favorite count: 0
has comment: http://stackoverflow.com/comment/47975504
has answer: http://stackoverflow.com/a/42681526
tagged with: google-sites
has comment: http://stackoverflow.com/comment/48317075
answer count: 4
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/34965566
upvote count: 7
has body: I've made a Google Apps Script deployed as a standalone web app using HTMLService that provides a simple front end to enter budget data into a Google Spreadsheet. I'm using JQuery Mobile for some of the javascript as well as to style it a mobile-friendly manner, as my main use case for this app is to enter purchases from my mobile. My problem is that on a mobile browser, the app doesn't scale properly. It's the width of the browser, but it's as if it was "zoomed out". All the controls become essentially unusable on mobile. If the script is embedded in a Google Site, it scales properly, but I'd rather be able to view the web app directly, rather than embed it in Google Sites. EDIT: My rep is high enough to post photos now, so here they are (below code). EDIT: The beginning of my HTML is below. I originally had the javascript and the full HTML in here, and I can add snippets if needed, but I reviewed it again and don't think it's relelvant to the problem it was cluttering up the question, so I removed it. HTML: <?!= include('javascript'); ?> ... Code.gs: function doGet() { return HtmlService.createTemplateFromFile('index').evaluate() .setSandboxMode(HtmlService.SandboxMode.IFRAME).setTitle('Budget Entry'); } Snippet with full code: // <?!= include('javascript'); ?> Date Category Amount Note Success! Text goes here. OK <!--> -->
has comment: http://stackoverflow.com/comment/47975752
type: Question
tagged with: google-apps-script
has title: JQuery Mobile with Google Apps Script
possible better answer: http://stackoverflow.com/a/30645617
has answer: http://stackoverflow.com/a/42039494
tagged with: jquery-mobile
has answer: http://stackoverflow.com/a/30645617
tagged with: javascript
has comment: http://stackoverflow.com/comment/47980657
accepted answer: http://stackoverflow.com/a/42039494
has comment: http://stackoverflow.com/comment/49275781
has comment: http://stackoverflow.com/comment/47967623
downvote count: 0
score: 7

http://stackoverflow.com/comment/47961659
type: AnswerComment
has text: What happens when I am getting param1 from a drop down menu? How to store that value in 'some value'?
comment on: http://stackoverflow.com/a/29919671
type: Comment
score: 0

http://stackoverflow.com/comment/47923004
has text: Its because i forgot a }, function1 and function2 are defined inside object1. Im gonna try the prototype way but since i only need to use my objects once I avoided this.
score: 0
comment on: http://stackoverflow.com/q/29900011
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/48075787
score: 1
comment on: http://stackoverflow.com/q/29977241
type: Comment
type: QuestionComment
has text: Where, and especiall *when*, is `flipBool` called?

http://stackoverflow.com/comment/47855831
type: Comment
score: 0
comment on: http://stackoverflow.com/a/29865405
has text: This is a good solution. jQuery should be added to the question as a tag.
type: AnswerComment

http://stackoverflow.com/q/29936237
tagged with: css
has comment: http://stackoverflow.com/comment/47999790
downvote count: 0
score: 1
tagged with: iframe
has body: Trying to work out how to prevent iframe break out of the following page. http://www.virginaustralia.com/au/en/ The page loads fine in the iframe, but when I go to search for a flight, the break out occurs due to anti-iframe javascript I assume. I would like for this flight search to remain within the iframe. My Iframe is pretty straight forward: &lt;iframe id= "vaus" name="vaus" align="top" src="http://www.virginaustralia.com/au/en/" style="-webkit-transform:scale(0.75);"&gt;&lt;/iframe&gt; I've tried various Javascript suggestions on here and nwdisable, nwfaketop, allow- fixes, but nothing has worked. Any help would be greatly appreciated. Note the purpose is not for commercial purposes. Thanks
type: Question
has title: IFrame breakout
tagged with: javascript
has answer: http://stackoverflow.com/a/30153223
linked to: http://stackoverflow.com/q/14734296
has comment: http://stackoverflow.com/comment/47994330
upvote count: 1
answer count: 1
favorite count: 0
type: UnansweredQuestion

http://stackoverflow.com/comment/47853827
comment on: http://stackoverflow.com/a/29863980
type: Comment
has text: Console.log in the fail and success block is not printed
score: 0
type: AnswerComment

http://stackoverflow.com/q/29903915
has comment: http://stackoverflow.com/comment/47930502
has body: I am adding all categories after ticking them to true if they exists in selected categories of result but it combines previous categories results with current one. I tried closure but it doesn't give me fresh object. Check out fiddle. var allCatsResult = [{"id":1},{"id":2}, {"id":3}, ... ]; var catsArray = [1, 2] // Array of ids from allCatsResult var result = [ {"id":1, selectedCategories:[{"id":1},{"id":2}]}, {"id":2, selectedCategories:[{"id":4},{"id":5}]}, ... ]; for (var i = 0; i &lt; results.length; i++) { var tmp = allCatsResult; // tried to add function form here didn't work for (var k = 0; k &lt; results[i].selectedCategories.length; k++) { var index = catsArray.indexOf(results[i].selectedCategories[k].category_id); if(index !== -1) { tmp[index].ticked = true; } } results[i].categories = tmp; } Above code gives combined result for ticked = true for all categories in each result.
has comment: http://stackoverflow.com/comment/47930584
has comment: http://stackoverflow.com/comment/47931637
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29904146
has comment: http://stackoverflow.com/comment/47931673
has comment: http://stackoverflow.com/comment/47931532
upvote count: 1
has comment: http://stackoverflow.com/comment/47930532
downvote count: 1
type: Question
has title: JavaScript for loop closure issue
has comment: http://stackoverflow.com/comment/47931069
has comment: http://stackoverflow.com/comment/47931607
has comment: http://stackoverflow.com/comment/47931780
has comment: http://stackoverflow.com/comment/47931349
tagged with: closures
tagged with: javascript
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/29904146
has comment: http://stackoverflow.com/comment/47930667
favorite count: 0

http://stackoverflow.com/q/29942231
linked to: http://stackoverflow.com/q/13428678
has answer: http://stackoverflow.com/a/29942576
has comment: http://stackoverflow.com/comment/48005361
answer count: 1
has body: I format a float to a locale string (Euro) and there are very different results in every browser. Is it possible to fix without an own function? var sum=2282.0000; var formated_sum = Number(sum.toFixed(2)).toLocaleString("de-DE", {style: "currency", currency: "EUR"}); Firefox result: 2.282,00 € Chrome result: 2.282 € IE result: 2.282,00 € Safari result: 2282 € Safari results are very much wrong, chrome results are not so much bad. Any Idea how to fix that without writing an own function for formatting? This question may already have an answer here: Inconsistent behavior of toLocaleString() in different browser No, my question is different because i am searching for a solution for Currency, not DATE
downvote count: 0
favorite count: 0
score: 8
upvote count: 8
has comment: http://stackoverflow.com/comment/48005394
type: UnansweredQuestion
has title: Number().toLocaleString() has different format in different browsers
tagged with: numbers
has comment: http://stackoverflow.com/comment/48005299
has comment: http://stackoverflow.com/comment/48006063
type: Question
tagged with: javascript
linked to: http://stackoverflow.com/q/149055
tagged with: formatting

http://stackoverflow.com/q/29935730
has comment: http://stackoverflow.com/comment/47993295
has comment: http://stackoverflow.com/comment/47993633
has comment: http://stackoverflow.com/comment/47993441
has answer: http://stackoverflow.com/a/29935815
tagged with: javascript
has comment: http://stackoverflow.com/comment/47993563
has comment: http://stackoverflow.com/comment/47993323
has comment: http://stackoverflow.com/comment/47993252
answer count: 3
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/47993392
linked to: http://stackoverflow.com/q/18634087
tagged with: angularjs
upvote count: 2
type: UnansweredQuestion
duplicate of: http://stackoverflow.com/q/18634087
score: 2
has comment: http://stackoverflow.com/comment/47993363
has answer: http://stackoverflow.com/a/29935875
has body: I got a query how do I convert yyyy-mm-dd hh:mm:ss to UNIX time-stamp using angularjs or JavaScript for example:2015-04-17 10:12:12this is how my date value how do i convert ??
has answer: http://stackoverflow.com/a/29935782
has title: How to convert yyyy-mm-dd hh:mm:ss to unix timestamp in angularjs or javascript
type: Question

http://stackoverflow.com/q/29878609
tagged with: javascript
has answer: http://stackoverflow.com/a/30143953
upvote count: 1
has answer: http://stackoverflow.com/a/30144144
favorite count: 0
type: UnansweredQuestion
tagged with: node.js
has title: How to route the user and keep the paramater in URL
downvote count: 0
score: 1
type: Question
has body: I'm having an issue with nodejs. I route the user from www.example.com/en-US to www.example.com but I want to keep the en-US in the redirected link, when I tried to add it it said as an error en-US subdirectorie doesn't exist. Here is my code, couls any one help? var i18n = require("i18n"); i18n.configure({ locales: ['en-US', 'fr-FR'], defaultLocale: 'fr-FR', directory: __dirname + '/locales', cookiename: 'locale' }); app.get('/:locales/about', function(req, res) { var language = req.params.language; res.cookie('locale', language); i18n.setLocale(language); res.redirect('/'); });
answer count: 2

http://stackoverflow.com/q/29997944
has comment: http://stackoverflow.com/comment/48115366
type: Question
tagged with: javascript
score: 0
answer count: 2
upvote count: 1
has answer: http://stackoverflow.com/a/29997982
downvote count: 1
has answer: http://stackoverflow.com/a/29997972
accepted answer: http://stackoverflow.com/a/29997972
has body: I'm trying to change dinamically the value in one parragraph. Every time the Button is clicked it should increse the value and show it in the HTML, but it does not change, I have search around and have not found an answer, Example: My First Web Page My first paragraph. Click me!
favorite count: 0
possible better answer: http://stackoverflow.com/a/29997982
has title: Dynamically change a value with JavaScript
type: AnsweredQuestion

http://stackoverflow.com/comment/47964509
comment on: http://stackoverflow.com/a/29918178
has text: Okay, so how do we do this : "...to make sure that all our records/rows are having these attributes" ?
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/q/29973674
possible better answer: http://stackoverflow.com/a/29974061
answer count: 2
has body: My code isn't showing the markers all of the time on the leaflet map. My code is below. And below the code is the "view source" I get. As you can see markers are created with locations in my code but just don't show on the map. Any ideas? my website is here and if you view the source you can see that we are trying to make the markers. https://pursuer.herokuapp.com/maps/ {% load leaflet_tags %} {% leaflet_js %} {% leaflet_css %} {% block sidebar %} Home Register Login Setup Your Device {% endblock %} {% if user.is_authenticated %} Welcome, {{ user.username }}. Thanks for logging in. {% else %} Welcome, new user. Please log in. {% endif %} {% if latest_device_list %} {% else %} No Devices are available. {% endif %} {% leaflet_map "yourmap" callback="window.map_init_basic" %}
downvote count: 0
favorite count: 0
tagged with: python-3.x
has title: leaflet.js markers not showing up
has answer: http://stackoverflow.com/a/29974643
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29974643
tagged with: leaflet
score: 1
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/29974061
tagged with: javascript

http://stackoverflow.com/q/29859317
score: 3
has title: Nested flexboxes and items alignment
upvote count: 3
accepted answer: http://stackoverflow.com/a/29863544
type: Question
tagged with: javascript
has body: I'm trying to create my own small grid system based on CSS3 flex display. I basically have the following classes: a grid class, which is a flex container with flex-direction set to column. a row class, which is a flex container with flex-direction set to row. set of column classes of different flex-basis sizes. What I want is to be able to align each row to the left/center/right by setting the self-align property of the row element. However, whenever I try to do it, things seem to go bad. Here is a plunker that demonstrate it: http://plnkr.co/edit/mHOs7U28GCBJuPvi7ikJ?p=preview HTML 1 2 3 4 CSS * { box-sizing: border-box; } .grid { display: flex; flex-direction: column; } .row { display: flex; flex-direction: row; } .column-1 { flex-basis: 33.33%; padding: 10px; } .column-2 { flex-basis: 66.67%; padding: 10px; } .column-3 { flex-basis: 100%; padding: 10px; } .align-start { align-self: flex-start; } .align-center { align-self: center; } .align-end { align-self: flex-end; } .item { background-color: lightblue; font-family: "Arial"; text-align: center; padding: 4px; } As you can see, In this plunker I set up a grid with two rows, with two columns in each row. The two columns in the first row have a width of 33.33% (flex-basis). In the second row, the first column's width is 66.67% and the second column is 33.33%. Now, since the first row has some unused space, I want to try to align it to the right (for whatever reason). Therefore, I add to the div that represents the first row the class align-end, which basically just adds the property align-self: flex-end; to the element. As you can see, by doing so the first row looks bad, both columns are aligned to the right, but their width is totally corrupted (you can try and remove the class 'align-end' from the first row, and things will get back to normal). What am I missing? Why the row doesn't align correctly to the right? Thanks, Roy.
answer count: 2
tagged with: flexbox
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/29859861
downvote count: 0
has answer: http://stackoverflow.com/a/29859861
has answer: http://stackoverflow.com/a/29863544
favorite count: 0
tagged with: css
type: AnsweredQuestion

http://stackoverflow.com/a/30169713
type: Answer
has body: Per Lars' comment, edges does not contain the original link data. So it was currently pushing only edges.push({ source: sourceNode, target: targetNode }); so to add any information that isn't in my edges I would have to add it. An example is if I were to push the color attribute from JSON my code would look like edges.push({ source: sourceNode, target: targetNode, color: e.data['color'] });
score: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29972635
answers question: http://stackoverflow.com/q/29972635

http://stackoverflow.com/q/29947256
tagged with: css
score: 4
has title: Repeating fadein on news feed
type: Question
tagged with: javascript
has body: A page of my website has a news feed where I use AJAX to return each day one at a time and display it. I want each days news to appear with a fade in. The problem is the fade in repeats, for each day that I return Html &lt;div id='newsdiv' class='newsDiv'&gt;&lt;/div&gt; Javascript AJAX call document.getElementById('newsdiv').innerHTML += xmlhttp.responseText; CSS @keyframes fadein { from { opacity: 0; } to { opacity: 1; } } /* Firefox &lt; 16 */ @-moz-keyframes fadein { from { opacity: 0; } to { opacity: 1; } } /* Safari, Chrome and Opera &gt; 12.1 */ @-webkit-keyframes fadein { from { opacity: 0; } to { opacity: 1; } } /* Internet Explorer */ @-ms-keyframes fadein { from { opacity: 0; } to { opacity: 1; } } /* Opera &lt; 12.1 */ @-o-keyframes fadein { from { opacity: 0; } to { opacity: 1; } } .divFadeIn, .centreScreen, .tbl_houseForm { -webkit-animation: fadein 3s; /* Safari, Chrome and Opera &gt; 12.1 */ -moz-animation: fadein 3s; /* Firefox &lt; 16 */ -ms-animation: fadein 3s; /* Internet Explorer */ -o-animation: fadein 3s; /* Opera &lt; 12.1 */ animation: fadein 3s; -webkit-animation-iteration-count: 1; -moz-animation-iteration-count: 1; -ms-animation-iteration-count: 1; -o-animation-iteration-count: 1; animation-iteration-count: 1; -webkit-animation-fill-mode: forwards; -moz-animation-fill-mode: forwards; -ms-animation-fill-mode: forwards; -o-animation-fill-mode: forwards; animation-fill-mode: forwards; } If I put the fade in the parent to the new feed, then it'll fade in when the first day is returned, but not for any of the following days. If I put the fade in on a child div, then it'll fade in when each and every day is returned (i.e. repeating the fade in when the next day is returned). How do I stop this from happening? How do I stop each day from fading in more than once? I do understand that each day is only fading in because the div "divNews" is being re-populated. But this understanding doesn't solve my problem.
upvote count: 4
answer count: 2
has answer: http://stackoverflow.com/a/29947781
downvote count: 0
has answer: http://stackoverflow.com/a/29986652
favorite count: 0
tagged with: ajax
type: UnansweredQuestion
tagged with: animation
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/48125191
score: 1
comment on: http://stackoverflow.com/q/30002568
has text: Are you looking for something like [this](http://jsfiddle.net/jksups47/1/).
type: Comment
type: QuestionComment

mongoose
tags question: http://stackoverflow.com/q/29998323
tags question: http://stackoverflow.com/q/29995960
tags question: http://stackoverflow.com/q/29904322
type: Tag
tags question: http://stackoverflow.com/q/29899208
tags question: http://stackoverflow.com/q/29925152
tags question: http://stackoverflow.com/q/29963412
tag name: mongoose
tags question: http://stackoverflow.com/q/29863336
tags question: http://stackoverflow.com/q/29873732
tags question: http://stackoverflow.com/q/29947580
tags question: http://stackoverflow.com/q/29936078
tags question: http://stackoverflow.com/q/29896697
tags question: http://stackoverflow.com/q/29876253

http://stackoverflow.com/q/29891539
linked to: http://stackoverflow.com/q/2855865
type: Question
has comment: http://stackoverflow.com/comment/47916859
tagged with: javascript
tagged with: jquery
tagged with: email-validation
accepted answer: http://stackoverflow.com/a/29896746
has title: .test for email filter work well on jquery 1.4.4 instead of on jquery 1.8.3 doesn't work
downvote count: 0
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/47917424
has comment: http://stackoverflow.com/comment/47906585
tagged with: regex
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29896746
score: 1
upvote count: 1
has body: This is my simple code for filter email on form submit; var email_filter = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/; if(email_filter.test($('#email').val())) On jQuery version 1.4.4 this works well but on 1.8.3 the results change to; say true on; email@domain.e and email@domain.esse say false on; email@domain.es and email@dom etc.. Why does this fail on 1.8.3 if the code is the same, and how can I fix this?

http://stackoverflow.com/a/29989434
type: Answer
score: 2
has body: When someone clicks your comment button, the click handler receives a reference to that specific element as this. Since that button is inside the div, you can use closest to find the div that contains the button, then update that div. E.g.: $(".comm").on("click", function() { var $div = $(this).closest("div.post_area"); // Do something with `$div`... }); Live example: $(".comm").on("click", function() { var $div = $(this).closest("div.post_area"); var $input = $div.find("input[name=comment]"); var comment = $input.val(); $(" ").text(comment).appendTo($div); $input.val("").focus(); }); .post_area { border: 1px solid #ddd; height: 6em; overflow: auto; } Type in any of the comment boxes and click the button following it:
upvote count: 2
answers question: http://stackoverflow.com/q/29989327
accepted answer of: http://stackoverflow.com/q/29989327
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/a/29980440
has body: you can access those properties with [] brackets: ng-src=&quot;{{album.image[3]['#text']}}&quot; https://tc39.es/ecma262/multipage/ecmascript-language-expressions.html#sec-property-accessors
accepted answer of: http://stackoverflow.com/q/29980428
answers question: http://stackoverflow.com/q/29980428
upvote count: 17
score: 17
type: AcceptedAnswer
downvote count: 0
type: Answer

http://stackoverflow.com/q/29909403
tagged with: javascript
upvote count: 2
answer count: 1
favorite count: 0
linked to: http://stackoverflow.com/q/30355241
tagged with: http://stackoverflow.com/tag/html
has body: I am trying to figure out how an svg file works. I successfully found out the amount of stroke-dasharray of the path using JavaScript: var path = document.querySelector(".aa") path.getTotalLength(); When you checkout the svg file there are three elements. The first one is a path, the second one is a rect, and the last is a circle. The console keeps showing error messages on the rect and circle. Is there any solution for this? Here is my original code: <path d="M423.5 251.1c0 0 1.2-25.2 23.6-25.2 22.3 0 909.9 0.7 909.9 0.7s19.5-0.6 19.5 21.4 0 597 0 597 1.5 21.5-21.5 21.5 -909 0-909 0 -22.5-1.4-22.5-21.8C423.5 824.2 423.5 251.1 423.5 251.1z" class="aa"/> <rect x="466.6" y="271.6" width="865.5" height="540" class="bb"/> <circle cx="900.5" cy="246" r="8.2" class"cc"/>
has title: How to get exact amount of stroke-dasharray on circle and rect?
accepted answer: http://stackoverflow.com/a/29911481
score: 2
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/svg
downvote count: 0
has answer: http://stackoverflow.com/a/29911481
type: Question
has comment: http://stackoverflow.com/comment/48877158

http://stackoverflow.com/comment/48105466
type: AnswerComment
has text: moving it to the open with index.html worked, now to do the same for unload and reload
type: Comment
score: 1
comment on: http://stackoverflow.com/a/29992956

http://stackoverflow.com/a/29949477
upvote count: 1
has comment: http://stackoverflow.com/comment/48020134
has comment: http://stackoverflow.com/comment/48142333
downvote count: 0
has comment: http://stackoverflow.com/comment/48019926
answers question: http://stackoverflow.com/q/29949344
type: Answer
has body: As for W3CSchool http://www.w3schools.com/jsref/jsref_pop.asp You can use the .pop() method. var fruits = ["Banana", "Orange", "Apple", "Mango"]; fruits.pop(); The result of fruits will be: Banana,Orange,Apple Remove another element To remove a certain element at an index inside the array you can use the method splice So For example var myFish = ['angel', 'clown', 'drum', 'surgeon', 'apple']; // removes 1 element from index 3 removed = myFish.splice(3, 1); And the result will be myFish is ['angel', 'clown', 'drum', 'apple'] removed is ['surgeon'] Remember that array is zero-indexed so the 3rd element is the element number 2.
score: 1

http://stackoverflow.com/q/29994512
accepted answer: http://stackoverflow.com/a/29994824
favorite count: 0
linked to: http://stackoverflow.com/q/29989031
duplicate of: http://stackoverflow.com/q/29989031
type: AnsweredQuestion
score: 4
tagged with: google-chrome
type: Question
has body: I want to make a bookmarklet that will take me to isup.me and check the site that wouldn't load. So basically it would be like running this in the console: window.location.href = "http://isup.me/" + window.location.host; Which is supposed to navigate me to http://isup.me/site_I_want_to_check This works fine for sites that are already loaded, but fails on sites that won't load. Here is window.location.href containing the string that is shown in the address bar: And here is window.location.href on a site that can't be reached: As you can see in the above screenshot, the value of window.location.href does not match what is displayed in the address field. Instead of returning "http://www.minetest.net" I get "data:text/html,chromewebdata" and when I look at the value of window.location.host it actually returns a blank string. How can I get the visible contents of the address bar with JavaScript while viewing Chrome's internal fail webpage informing me that a site cannot be reached?
tagged with: javascript
has title: Get browser URL box contents with JavaScript
upvote count: 4
has answer: http://stackoverflow.com/a/29994824
tagged with: bookmarklet
answer count: 1
downvote count: 0

http://stackoverflow.com/a/29861661
score: 0
has comment: http://stackoverflow.com/comment/47858103
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/29861307
answers question: http://stackoverflow.com/q/29861307
has body: Basically, Angular doesn't know that there is a change if you are outside the Angular context, so you need to tell Angular that something has changed. One of the thing, you are already using is the $timeout service. But there is an another a cleaner solution for this. The place where you are using jQuery to change the DOM, you can call tell angular to fix things: angular.element(document.querySelector("body")).scope().$apply(); $apply() method call be trigger digest cycle manually which Angular does on it's own when you work inside Angular context.

http://stackoverflow.com/q/29965886
type: AnsweredQuestion
downvote count: 2
has title: Javascript: How to copy content from a element to hidden element?
has body: Basically I have a element as is demonstrated here: This is a paragraph. It is editable. Try to change this text. The user can paste data into that field and therefore change the contents between the tags. The reason to do this is to get the metadata (like hyperlinks, etc.) that would be lost with a simple element. How can you copy this data into an element, if the content is changed by the user? This question is unlike this question where there is no output of the data (a static text is shown, which does not indicate how to access the real data that the User has entered) and the input is of a different type ( vs. )
type: Question
possible better answer: http://stackoverflow.com/a/29966029
score: -2
has answer: http://stackoverflow.com/a/29966029
tagged with: javascript
has answer: http://stackoverflow.com/a/29966069
linked to: http://stackoverflow.com/q/1391278
has answer: http://stackoverflow.com/a/29965985
upvote count: 0
duplicate of: http://stackoverflow.com/q/1391278
favorite count: 0
has answer: http://stackoverflow.com/a/29966074
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/29966069
answer count: 4

http://stackoverflow.com/comment/48048347
type: Comment
has text: that's weird, you may double check property name or log the whole `$route.current` object` and look whats inside
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29963526

http://stackoverflow.com/comment/48122231
type: Comment
has text: Are you wanting to add to the choices or add to the selection? or both?
type: QuestionComment
comment on: http://stackoverflow.com/q/30001494
score: 0

http://stackoverflow.com/a/29877643
downvote count: 0
upvote count: 2
answers question: http://stackoverflow.com/q/29877597
type: Answer
has comment: http://stackoverflow.com/comment/47879398
score: 2
has body: your code is running fine with no problems You need to put it in $(document).ready(); here is demo https://jsfiddle.net/8w2jb1Lr/

http://stackoverflow.com/a/29860949
accepted answer of: http://stackoverflow.com/q/29860884
score: 1
has comment: http://stackoverflow.com/comment/47847738
answers question: http://stackoverflow.com/q/29860884
upvote count: 1
type: AcceptedAnswer
type: Answer
has body: /(^[a-z-0-9]([a-z_\.0-9]*)@([a-z_\.]*)([.][a-z]{3})$)|(^[a-z]([a-z_\.]*)@([a-z_\.]*)(\.[a-z]{3})(\.[a-z]{2})*$)/i Simply add 0-9 to your pattern.
downvote count: 0

http://stackoverflow.com/a/30001493
has comment: http://stackoverflow.com/comment/48121826
has comment: http://stackoverflow.com/comment/48121794
type: Answer
has comment: http://stackoverflow.com/comment/48121598
has body: EDIT: According to http://api.jquery.com/hide/ hide will save the previous state. But as it seems it is not working in your case. Solution: js $(document).ready(function () { console.log("1 display: " + $("#foo").css("display")); $("#foo").addClass('hideFlex'); console.log("2 display: " + $("#foo").css("display")); $("#foo").removeClass('hideFlex'); console.log("3 display: " + $("#foo").css("display")); }); css: .hideFlex{ display:none; } So replace the js with my js and add .hideFlex to your css. Should work then.
answers question: http://stackoverflow.com/q/30001404
has comment: http://stackoverflow.com/comment/48121592
score: 0
has comment: http://stackoverflow.com/comment/60251821
has comment: http://stackoverflow.com/comment/48121958

http://stackoverflow.com/q/29895480
tagged with: jetty
has comment: http://stackoverflow.com/comment/48142133
has comment: http://stackoverflow.com/comment/47949797
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47949879
tagged with: apache
answer count: 0
tagged with: javascript
has title: Not downloading a file if download URL is of different localhost port
tagged with: cross-domain
type: Question
tagged with: http://stackoverflow.com/tag/html
has body: I am having a text file and wants to download. I am working in localhost. The HTML page from which I am downloading file, is called from localhost:8080. And the file which I want to download, I am calling using another port i.e. 'localhost:100'. If I do like this I am not getting that particular txt file, in fact the whole location of the of the folder is getting downloaded in HTML format. How to resolve this issue ? But when the port is same for both HTML and the download URL , that particular text file is getting downloaded. EDIT HTML Page (http://localhost:8080/project/test.html) When this runs following file gets downloaded - download.html In download.html there is Index of /test The localhost:8080 is Jetty Server and localhost:100 is Apache Server
score: 0

http://stackoverflow.com/q/29872752
tagged with: javascript
tagged with: copy
answer count: 2
downvote count: 0
has body: I am using AWS' s3.copyObject for moving a file from source to destination. How can I get the entire path of new destination. Is there any callback params of s3.copyObject which gives this result?
has title: aws s3.copyObject return params with destination path
tagged with: amazon-web-services
favorite count: 0
has answer: http://stackoverflow.com/a/29874181
has answer: http://stackoverflow.com/a/31272731
possible better answer: http://stackoverflow.com/a/29874181
score: 1
upvote count: 1
accepted answer: http://stackoverflow.com/a/31272731
type: Question
type: AnsweredQuestion
tagged with: amazon-s3

http://stackoverflow.com/q/29922837
score: 0
has comment: http://stackoverflow.com/comment/47983032
has body: I have added script tag as follows working on a https website. I replaced the http to https still no luck. I have downloaded remote.js and added relative path still no luck. Any suggestion?
has title: how to inject JS Console in to https page? jsconsole.com
has comment: http://stackoverflow.com/comment/47967454
has comment: http://stackoverflow.com/comment/47967606
type: UnansweredQuestion
tagged with: remote-debugging
has comment: http://stackoverflow.com/comment/47967694
tagged with: console.log
answer count: 0
type: Question
tagged with: javascript

materialize
tags question: http://stackoverflow.com/q/29949221
tags question: http://stackoverflow.com/q/29905199
tag name: materialize
type: Tag

ios
tags question: http://stackoverflow.com/q/29943509
tags question: http://stackoverflow.com/q/29900047
tags question: http://stackoverflow.com/q/29908115
tags question: http://stackoverflow.com/q/29985506
tags question: http://stackoverflow.com/q/29894406
type: Tag
tags question: http://stackoverflow.com/q/29903273
tags question: http://stackoverflow.com/q/29959036
tags question: http://stackoverflow.com/q/29974612
tags question: http://stackoverflow.com/q/29894997
tags question: http://stackoverflow.com/q/29958407
tags question: http://stackoverflow.com/q/29845312
tags question: http://stackoverflow.com/q/29970717
tags question: http://stackoverflow.com/q/29948606
tags question: http://stackoverflow.com/q/29904260
tags question: http://stackoverflow.com/q/29897838
tags question: http://stackoverflow.com/q/29901083
tag name: ios
tags question: http://stackoverflow.com/q/29895570
tags question: http://stackoverflow.com/q/29906818
tags question: http://stackoverflow.com/q/29904366
tags question: http://stackoverflow.com/q/29902889
tags question: http://stackoverflow.com/q/29857285
tags question: http://stackoverflow.com/q/29996851
tags question: http://stackoverflow.com/q/29848084
tags question: http://stackoverflow.com/q/29925251
tags question: http://stackoverflow.com/q/29893970
tags question: http://stackoverflow.com/q/29905394
tags question: http://stackoverflow.com/q/29968081
tags question: http://stackoverflow.com/q/29900887
tags question: http://stackoverflow.com/q/29949928
tags question: http://stackoverflow.com/q/29995024
tags question: http://stackoverflow.com/q/29961388
tags question: http://stackoverflow.com/q/29927680
tags question: http://stackoverflow.com/q/29849408
tags question: http://stackoverflow.com/q/29905472

http://stackoverflow.com/comment/74798227
has text: To clarify - the same problem, but for different reasons; I'm attempting to do some of this work in the cloud where there isn't a UI. However, I should already have an access token coming in with my request.
type: Comment
comment on: http://stackoverflow.com/q/29930271
score: 0
type: QuestionComment

http://stackoverflow.com/q/29972638
tagged with: javascript
score: 0
has title: How to play sound and/or vibration on all mobile devices (phone gab, JQM & JS)
answer count: 1
has body: I am making a web app that includes a timer that counts down and alerts the user when it reaches 0. I found the functions navigator.vibrate(); and a similar one called beep. They work great in Chrome / Android, but are not supported in Safari &amp; IE. Is there any simple solution that works on both platforms? Any kind of sound or vibration alert will do the trick.
has answer: http://stackoverflow.com/a/29972728
type: UnansweredQuestion
tagged with: phonegap-build
tagged with: web-applications
type: Question
tagged with: iphone
tagged with: jquery-mobile

http://stackoverflow.com/comment/47956077
has text: What's the output of `$row` ?
score: 0
comment on: http://stackoverflow.com/q/29917319
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29936409
has body: Using jquery: $(".panel").click(function(){ var h2 = $(this).find('h2'); });
score: 0
answers question: http://stackoverflow.com/q/29936379
type: Answer

http://stackoverflow.com/q/29900882
favorite count: 0
has title: AngularJS service gets the data, but doesn`t return it to the controller?
tagged with: angularjs
tagged with: angular-promise
has comment: http://stackoverflow.com/comment/47932584
has comment: http://stackoverflow.com/comment/47932533
has answer: http://stackoverflow.com/a/29905917
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47933596
has comment: http://stackoverflow.com/comment/47924781
accepted answer: http://stackoverflow.com/a/29906692
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/47933040
tagged with: angularjs-service
has comment: http://stackoverflow.com/comment/47924670
tagged with: javascript
has answer: http://stackoverflow.com/a/29906692
score: 0
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/47924621
possible better answer: http://stackoverflow.com/a/29905917
has body: scope.membersWarnings in controller is always empty, but in service it gets the data from the server. Somehow my data from the server is lost between callback of get function in service and controller. Controller: AndreaApp.controller('MemberDetailController', ['$scope', '$rootScope','$http','$location','$routeParams','MemberService','MemberGroupsService','ArrivalsService','WarningsService','NotificationsService',function (scope,rootScope, http,location,routeParams,MemberService,MemberGroupsService,ArrivalsService,WarningsService,NotificationsService) { scope.member = MemberService.get(routeParams.id); scope.membersGroup = MemberService.membersGroup(routeParams.id); scope.membersWarnings = WarningsService.get(routeParams.id); scope.editMember = function(id){ location.path('/editMember/'+id); } scope.membersDocument = function(id){ location.path('/membersDocument/'+id); } scope.templates = [ { name: 'packages.html', url: 'views/members/packages.html'}, { name: 'notifications.html', url: 'views/members/notifications.html'}, { name: 'warnings.html', url: 'views/members/warnings.html'}, { name: 'arrivals.html', url: 'views/members/arrivals.html'} ]; scope.template = scope.templates[0]; scope.loadTemplate = function(templateId){ if(templateId == 3){ scope.arrivals = ArrivalsService.get(routeParams.id).arrivalsId; console.log(scope.arrivals); } scope.template = scope.templates[templateId]; }}]); WarningsService: AndreaApp.service('WarningsService', function ($http,$q) { var warnings = []; this.save = function (warnings, memberId) { $http.post('/api/warnings/new/member/'+memberId, { name: warnings.name, description: warnings.description, readed: false, clanId: memberId }). success(function(data, status, headers, config) { }). error(function(data, status, headers, config) { alert("Error occurred while adding a warning. HTTP Respone: " + status); }); } this.get = function (id) { var deferred = $q.defer(); $http.get('/api/warnings/member/'+id). success(function(data, status, …

http://stackoverflow.com/comment/47882488
has text: Only using addition? Subtraction? Other math operators?
type: Comment
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/29877868

http://stackoverflow.com/comment/47925273
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29901333
has text: Your question is?? also, please format your code in order to get help.
score: 0

http://stackoverflow.com/comment/48117355
has text: No idea how this got 2 upvotes. You can't just nest a block inside an object literal like that. This doesn't address the issue at all.
type: AnswerComment
comment on: http://stackoverflow.com/a/29998676
score: 0
type: Comment

http://stackoverflow.com/comment/60460124
has text: This got me to resolve the issue but for future visitors choosing 'AMD' may not be correct option for you as it was 'System' I had to change it to as correct option depends on system you use for your modules. I also had to change 'JSX compilation' to remove all my errors
comment on: http://stackoverflow.com/a/32362310
type: AnswerComment
type: Comment
score: 0

http://stackoverflow.com/q/29865103
answer count: 1
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29865265
tagged with: node.js
has body: I am trying to implement a db-to-server push model using node's watchFile functionality. Right now I am exporting an nfs4 share from the db. The server mounts that share. When the db processes new data, it touches files in its export location. The server sees the time change of the files and performs its push to clients. Problem is that the server isn't seeing the files being updated until it performs a subsequent poll request. This effectively makes it a pull model, not a push. If I unmount the share serverside and touch files in the mount folder, watchFile performs just fine and sees changes within the default 5007ms window. My alternate ideas include using scp to push files from the db to the server, - seems cludgy but I've tested it and watchFile works with it. I haven't gone the cifs route yet. Should I give up on relying on nfs4 to behave with node's watchFile()? If not, what should I tweak/test? What alternative methods have worked for you?
score: 0
has title: using node watchFile reliably - nfs, cifs, scp?
type: Question
tagged with: javascript
tagged with: nfs

http://stackoverflow.com/comment/47869529
has text: Side note: with $http your msg aka data. Should be a javascript object literal not a JSON string.
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29872133

http://stackoverflow.com/comment/48109677
has text: Sorry for inconvenience I have posed snaps of my code html/js not full code.
score: 0
comment on: http://stackoverflow.com/q/29994908
type: Comment
type: QuestionComment

http://stackoverflow.com/a/58324804
has body: @Jai Prak's answer is brilliant. What about the case of three tabs or more? The newest tab will always be the last Tab. return await driver.wait(async function () { return await driver.getAllWindowHandles().then(async function (handles) { // var isHandleCount2 = (handles.length == 2); if (handles.length &gt; 1) { return driver.switchTo().window(handles[handles.length - 1]); } return false; }); }).then(function () { // Now do some stuff in new tab }); The above will apply except in cases you switch between Tabs. To move the next tab, get the current Tab's index -1
score: 0
type: Answer
answers question: http://stackoverflow.com/q/29855006

http://stackoverflow.com/comment/48141604
comment on: http://stackoverflow.com/a/29989256
has text: HI this works for me , did you get it working with bootstrap 3 I couldn't implement it with the latest B3 and Jquery?
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/29940392
type: Question
has title: AngularJS : Isolate the scope of a single directive to avoid updating in other part of application
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: angularjs
answer count: 0
has body: sorry for the confused title but I couldn't specify better in short text, I will try to be more explicit in deeply description. I created a web application with angularJS. One of the requirements was that in a part of the page (in a directive) the page needs to have 3 different DOMs with a number that is going to be updated very often (generally 150 times per seconds each of them). First solution I adopted was (I show just the directive's controller): angular.module('myModule') .controller('myController', function($scope, $interval) { $scope.items = [{ name: 'item 1', speed: 100 },{ name: 'item 2', speed: 150 },{ name: 'item 3', speed: 300 }]; angular.forEach($scope.items, function (item) { item.count = 1; $interval(function increment () { item.count++; }, item.speed); }); }); and of course in template: &lt;ul&gt; &lt;li ng-repeat="item in items"&gt; {{item.count}} &lt;/li&gt; &lt;/ul&gt; It works fine, but it creates a problem for the whole page application has several angular directives like ng-show/ng-hide/ng-if/ng-bind/ng-class and others that calls functions and the functions are called a lot of times for the double binding of angularJS. The reported controller in directive updates often the scope and angular check every time to evaluate the functions related to ng-. Every single ng- function is called pretty much 550 times per second. This scenario is a problem for my application has to run on smartphone too and this solution will consume a lot of battery (for it's execute a lot of useless js functions). I had as solution to update the number by using pure js and DOM references, but I'd like to keep the whole js code in angularJS. Can someone please suggest a way to do it in angularJS? Maybe a way to isolate the scope? Cheers.
type: UnansweredQuestion
upvote count: 1
tagged with: angularjs-directive
score: 1
tagged with: angularjs-scope

http://stackoverflow.com/comment/110015877
comment on: http://stackoverflow.com/a/29927491
has text: Hi @Kathir or anyone else, know how to modify this so the animation only offsets by 1 image instead of all 3? (jrobichaud mentions this in his comment above)
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/29878522
has comment: http://stackoverflow.com/comment/47885987
has comment: http://stackoverflow.com/comment/47885710
tagged with: php
has comment: http://stackoverflow.com/comment/53815527
has comment: http://stackoverflow.com/comment/47885765
has comment: http://stackoverflow.com/comment/47885633
has answer: http://stackoverflow.com/a/29891787
has comment: http://stackoverflow.com/comment/47885907
has comment: http://stackoverflow.com/comment/47885685
type: Question
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/47881247
has title: Build charts from polling JSON data
score: 0
tagged with: highcharts
answer count: 1
tagged with: javascript
has body: I have a bitcoin miner which can output data in JSON fromat as follows: { "Data1": { "timestamp_raw": 1442856476, "timestamp": { "Year": 2015, "Month": 9, "Day": 21, "Hour": 20, "Minutes": 27, "Seconds": 56 }, "CG_Uptime": 15572, "MHS_Avg": 2695618.06, "DegC_In": "29", "DegC_TopOut": "54", "DegC_BotOut": "59", "Unit_Uptime": 118393, "FreeMem": "440", "PSUVolt_Top": "217", "PSUVolt_Bot": "217", "FAN": "40", "Total_Watts": 1264, "Total_KWh": 0 }, "Data2": { "timestamp_raw": 1442856495, "timestamp": { "Year": 2015, "Month": 9, "Day": 21, "Hour": 20, "Minutes": 28, "Seconds": 15 }, "CG_Uptime": 15592, "MHS_Avg": 2695948.02, "DegC_In": "29", "DegC_TopOut": "54", "DegC_BotOut": "59", "Unit_Uptime": 118412, "FreeMem": "440", "PSUVolt_Top": "217", "PSUVolt_Bot": "217", "FAN": "40", "Total_Watts": 1248, "Total_KWh": 30.006586944 }, "Data3": { "timestamp_raw": 1442856535, "timestamp": { "Year": 2015, "Month": 9, "Day": 21, "Hour": 20, "Minutes": 28, "Seconds": 55 }, "CG_Uptime": 15631, "MHS_Avg": 2698686.25, "DegC_In": "29", "DegC_TopOut": "54", "DegC_BotOut": "59", "Unit_Uptime": 118451, "FreeMem": "440", "PSUVolt_Top": "217", "PSUVolt_Bot": "217", "FAN": "40", "Total_Watts": 1232, "Total_KWh": 0.013688752 }, ...... What I want to do is to make a webpage in php which will read this json file and display the values on charts, x-axis would be time (from timestamp section in json) and y-axis would be a value for each chart. I've seen something similar here http://powerprice.info/SPT/graphic.php which uses highcharts. How can I accomplish this?
has comment: http://stackoverflow.com/comment/47907486
has comment: http://stackoverflow.com/comment/47888766
has comment: http://stackoverflow.com/comment/47888627
type: UnansweredQuestion

http://stackoverflow.com/comment/47967402
has text: yes lukya. i'll change calculation .m and .h file consequentially update each time . So there is have any sort cut logic have to change calculation but not need next release in app store. We need change calculation while application in store.
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29895570

http://stackoverflow.com/comment/47853941
comment on: http://stackoverflow.com/q/29864058
score: 0
type: Comment
type: QuestionComment
has text: `system("\"C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe\" display.txt");`

http://stackoverflow.com/a/30112643
score: 5
upvote count: 5
type: Answer
has body: This is exactly what the evaluate method is for: http://angular.github.io/protractor/#/api?view=ElementFinder.prototype.evaluate element(by.model('data.person')).evaluate('data.person.firstname = "yourvaluehere"'); I assume by "targeting the model" you want to change the controller's value and have the ng-model directive update the view, rather than the other way around.
downvote count: 0
answers question: http://stackoverflow.com/q/29869372

http://stackoverflow.com/comment/48089090
has text: @Callum, no need to include the parent in it at all
comment on: http://stackoverflow.com/a/29984855
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/29943258
type: UnansweredQuestion
downvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/48008998
has comment: http://stackoverflow.com/comment/48008167
type: Question
has title: Infinite scrolling not working
tagged with: infinite-scroll
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/48007986
score: 1
favorite count: 0
answer count: 0
has body: I am trying to implement infinite scrolling function but it seems that my code is not working. Can you help me? $(document).ready(function(){ var origElement = $('.scroll').clone(); if($(window).width() > 500){ $('.scroll').jscroll(); } $(window).resize(function(){ if($(window).width() < 500){ alert($(window).width()); $('.scroll').remove(); $('#container').append(origElement); } else{ $('.scroll').jscroll(); } }); }); Bellow is my html code: Page 1 Page 1 of jScroll Example - jQuery Infinite Scrolling Plugin This is the content of page 1 in the jScroll example. Scroll to the bottom of this box to load the next set of content. This is example text for the jScroll demonstration. jScroll is a jQuery plugin for infinite scrolling, endless scrolling, lazy loading, auto-paging, or whatever you may call it. With jScroll, you can initialize the scroller on an element with a fixed height and overflow setting of "auto" or "scroll," or it can be set on a standard block-level element within the document and the scrolling will be initialized based on the brower window's scroll position. jScroll is open-source and can be downloaded from my GitHub repository at github.com/pklauzinski/jscroll. next page Thanks I am trying to run the first example in JSFIDDLE but it seems it is not working: http://jscroll.com/
tagged with: lazy-loading
upvote count: 1
has comment: http://stackoverflow.com/comment/48008118

http://stackoverflow.com/comment/47847840
comment on: http://stackoverflow.com/q/29860970
score: 0
has text: Why do you call `load` after `setInterval`, instead of inside the `setInterval` callback?
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/48102666
has text: remove this style: .btn1:hover{ color: inherit; background-color:#ff7743; }
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29991113

http://stackoverflow.com/comment/47988144
comment on: http://stackoverflow.com/q/29932935
score: 3
has text: the last code should work, leave it like `.....on('click', '#tableid button', function(){....`
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47834367
type: AnswerComment
has text: @alexbfree I removed my comment because I feel like another user explained it better here (http://stackoverflow.com/questions/2728278/what-is-a-practical-use-for-a-closure-in-javascript). Check out Andy E's example.
type: Comment
comment on: http://stackoverflow.com/a/29853946
score: 0

http://stackoverflow.com/q/29858846
has title: How can i limit the number of articles (retrieved from an RSS) shown in php per page ? (Eg 10 articles per page)
tagged with: rss
upvote count: 1
tagged with: php
type: AnsweredQuestion
score: 1
tagged with: dom
type: Question
has body: Here is the code : I retrieve data from an RSS and i show them in a php page. These data are items (Articles) which contains title, date, description ... Now i want to show just 10 articles per page. Please how can i do that. Thank you <?php $fichier = 'http://korben.info/feed'; $dom = new DOMDocument(); $slashNS = "http://purl.org/rss/1.0/modules/slash/"; if (!$dom->load($fichier)) { die('Impossible to load the XML'); } $itemList = $dom->getElementsByTagName('item'); foreach ($itemList as $item) { $titre = $item->getElementsByTagName('title'); $date = $item->getElementsByTagName('pubDate'); if ($titre->length > 0) { echo $titre->item(0)->nodeValue; } else { echo '(sans titre)'; } echo date (" d/m/Y - H:i", strtotime($date->item(0)->nodeValue))."\t"; echo ' ' . 'Nmber of comments : ' . $item->getElementsByTagNameNS($slashNS, 'comments')->item(0)->nodeValue; echo ' '."\n"; $desc = $item->getElementsByTagName('description'); if ($desc->length > 0) { echo ' '.$desc->item(0)->nodeValue."\n"; } $lien = $item->getElementsByTagName('link'); if ($lien->length >0) { echo ' item(0)->nodeValue.'">Article complet'; } echo ' '."\n".' '."\n".' '."\n"; } ?>
has answer: http://stackoverflow.com/a/29858860
downvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/29858860

http://stackoverflow.com/comment/47868469
comment on: http://stackoverflow.com/a/29871765
type: Comment
has text: I am looking for development and production if possible
score: 0
type: AnswerComment

http://stackoverflow.com/comment/48052509
has text: Could you update your code in jsfiddle.net.
score: 1
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29966407

http://stackoverflow.com/q/29939361
type: Question
tagged with: javascript
tagged with: ajax
has body: I'm trying to use the mailjet(as mandrill tests weren't successfuls because sent email remained 'queued' and never reach the box) mailing service in my web application using an AJAX request : $.ajax({ // The 'type' property sets the HTTP method. // A value of 'PUT' or 'DELETE' will trigger a preflight request. type: 'POST', // The URL to make the request to. url: 'https://api.mailjet.com/v3/send/message', contentType: 'text/plain', data: { 'user': '10ca83...public key 1ccd945:f58e84f9d...private key..8e9502fd7a', 'from': emaildata.email, 'to': 'recipiant@gmail.com', 'subject': 'mailjet test', 'text': emaildata.msg }, xhrFields: { withCredentials: false }, headers: { }, success: function() { // Here's where you handle a successful response. }, error: function() { // Here's where you handle an error response. // Note that if the error was due to a CORS issue, // this function will still fire, but there won't be any additional // information about the error. } }).done(function(response) { console.log(response); // if you're into that sorta thing }); } as i got this error in the browsers consoles : index.php:1 XMLHttpRequest cannot load https://api.mailjet.com/v3/send/message. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost' is therefore not allowed access. The response had HTTP status code 401. I tried to find a solution to get rid of it and i found two solution : 1/ using CORS. 2/ i also found that it can be a problem to send the request from a local web page so i runned a wamp server and i launched the app on it instead directly in browsers. But i still have that error :/ Any suggestion ? Next i will try the google gmail API for sending email.
tagged with: mailjet
downvote count: 0
answer count: 1
has title: Couldn't get rid of the multi-origins error when sending an ajax request to mailjet
has answer: http://stackoverflow.com/a/29939509
favorite count: 0
upvote count: 1
type: AnsweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/47999862
accepted answer: http://stackoverflow.com/a/29939509
has comment: http://stackoverflow.com/comment/47999812

http://stackoverflow.com/a/29905731
type: Answer
has body: Honestly, you could simplify it developing a validation engine, but wait! There're a plenty of validation libraries. For example, ParsleyJS (there're many ones...). Using a validation library will supress the lines instead of simplifying them, and many of these validation libraries implement declarative validation (i.e. they use HTML attributes like required, min-length, max-length...) so there will near to zero JavaScript code to perform form validation. Of course, you could also simplify your code using a function like some other answer suggests to... but again, honestly, if you're developing a Web site or app which has forms and you need to validate them (I would say you must validate forms!!), I wouldn't waste my time performing form validation manually. Keep it simple.
answers question: http://stackoverflow.com/q/29905640
has comment: http://stackoverflow.com/comment/47934215
has comment: http://stackoverflow.com/comment/47934315
score: 0

http://stackoverflow.com/q/29913997
score: 3
accepted answer: http://stackoverflow.com/a/29914363
tagged with: javascript
tagged with: forms
has body: I have a button which by default is disable, but when a checkbox is checked the button is then enabled. I would like to edit the script to make an alert window when the button is clicked when disabled, to make sure the user knows he/she has to check the checkbox. My script so far: &lt;script type="text/javascript"&gt; $('#terms').on('change', function(){ if ($(this).is(':checked')){ $('#customButton').removeProp('disabled'); } else{ $('#customButton').attr('disabled', 'disabled'); } }); &lt;/script&gt; &lt;form id="payment-form" action="chargeCard.php" method="POST" name="payment-form"&gt; &lt;input type="checkbox" id="terms" /&gt; &lt;input type="image" src="button3.png" id="customButton" value="submit" alt="button" disabled="disabled"/&gt; &lt;/form&gt;
answer count: 2
downvote count: 0
tagged with: button
has comment: http://stackoverflow.com/comment/47950006
has comment: http://stackoverflow.com/comment/47949836
favorite count: 0
has title: Make alert window when clicking a disabled button
linked to: http://stackoverflow.com/q/3100319
has comment: http://stackoverflow.com/comment/47949771
tagged with: http://stackoverflow.com/tag/html
tagged with: checkbox
type: AnsweredQuestion
upvote count: 3
has comment: http://stackoverflow.com/comment/47950075
possible better answer: http://stackoverflow.com/a/29914148
has answer: http://stackoverflow.com/a/29914363
type: Question
has answer: http://stackoverflow.com/a/29914148

http://stackoverflow.com/a/29983164
has comment: http://stackoverflow.com/comment/48086907
upvote count: 1
score: 1
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/48085851
has body: You could add a class ~"selected" to the option which you want to select on the new page and then apply css to change the color of the option field. Example select#one{ color:red; } select#one option:not(.selected){ color:blue; } Example
accepted answer of: http://stackoverflow.com/q/29982723
type: Answer
has comment: http://stackoverflow.com/comment/48086358
answers question: http://stackoverflow.com/q/29982723
has comment: http://stackoverflow.com/comment/48086571

http://stackoverflow.com/a/29990315
has comment: http://stackoverflow.com/comment/48100320
accepted answer of: http://stackoverflow.com/q/29990245
has comment: http://stackoverflow.com/comment/48100092
answers question: http://stackoverflow.com/q/29990245
score: 2
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/48100529
has comment: http://stackoverflow.com/comment/48100255
type: Answer
has comment: http://stackoverflow.com/comment/48100132
has body: Ok! Good news is, you essentially have it already. If you want to add ... to the end, you've just about got it - just change return str to return str + "..."; To ensure that we don't add ... when num is equal to the string's length, we can simply change &lt; to &lt;=. So that gives you: function truncate(str, num) { if(str.length &lt;= num) { return str; } else { str = str.slice(0, num); return str + "..."; } } Output: truncate('A-tisket a-tasket A green and yellow basket', 11); &gt;&gt;&gt; "A-tisket a-..." truncate('A-tisket a-tasket A green and yellow basket', 'A-tisket a-tasket A green and yellow basket'.length); &gt;&gt;&gt; "A-tisket a-tasket A green and yellow basket" truncate('A-tisket a-tasket A green and yellow basket', 'A-tisket a-tasket A green and yellow basket'.length + 2); &gt;&gt;&gt; "A-tisket a-tasket A green and yellow basket"
has comment: http://stackoverflow.com/comment/48100615
upvote count: 2

http://stackoverflow.com/comment/48020517
type: QuestionComment
comment on: http://stackoverflow.com/q/29949732
has text: @A.Wolff Sorry about that, changed it, next time I'll get an ERROR message. Thanks.
score: 0
type: Comment

http://stackoverflow.com/comment/47957495
type: AnswerComment
comment on: http://stackoverflow.com/a/29917797
score: 0
type: Comment
has text: Calltime binding can be a bit of a brain bender, since it's an unusual feature. But it's pretty simple once you know it exists. Javascript really only has two significant parts to it: objects and functions. Both have very few rules, and everything else follows from that. If you're used to classical inheritance, simply forget about it. ;)

http://stackoverflow.com/a/29894621
upvote count: 1
answers question: http://stackoverflow.com/q/29894461
has body: Well, passing current item into ngClick handler is pretty usual way to solve this task. I'm not sure why it's not working for you, it should. Here is the example of this typical approach. In backbone I would have a seperate view for each row where the model is bound to. But in Angular models aren't as explicit as in backbone. Actually Angular is even more elegant in this concern. You still have model available in every iterated row. You can refer current child scope as this in controller. So in your case if you don't want to pass record object into controller function on click, you can use this and it will point to the current scope object (remember that ngRepeat creates new child scope for every row): $scope.selectRow = function() { alert(this.record.id); }; and you don't have to pass anything in HTML: ng-click="selectRow()" Demo: http://plnkr.co/edit/kN0vB6N6v7XnqASRSmAd?p=preview
accepted answer of: http://stackoverflow.com/q/29894461
has comment: http://stackoverflow.com/comment/47912822
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 1

http://stackoverflow.com/comment/47956533
type: Comment
has text: Ya! a closure needs to be setup.
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/29917060

http://stackoverflow.com/a/29935753
type: Answer
has body: Once you include new image in your html, your browser is download this image and put it to cache, before displaying.This process is take time. If your images is big size, is take more time. So you can solve your problem by caching images before your loop is start running : &lt;div style="display:none;"&gt; &lt;img id="seat0" src="some image source" alt=""/&gt; &lt;img id="seat0" src="some image source" alt=""/&gt; &lt;img id="seat0" src="some image source" alt=""/&gt; &lt;img id="seat0" src="some image source" alt=""/&gt; &lt;img id="seat0" src="some image source" alt=""/&gt; &lt;img id="seat0" src="some image source" alt=""/&gt; &lt;/div&gt; This hidden block,if you put him on your site start page, will load all images into browser cache.
accepted answer of: http://stackoverflow.com/q/29935657
score: 0
answers question: http://stackoverflow.com/q/29935657
type: AcceptedAnswer

http://stackoverflow.com/q/29909557
has body: Alright, seems like I'm always coming here for help because I'm missing something stupid. So for my class I'm attempting to use JavaScript and jQuery to create a slider that fades out items that are above the value specified by the slider, so for example if an item cost 8 dollars and the slider is set to 7, everything that costs over 8 dollars fades out. So here's the code of the entire page: The Candy Bar Here at the Candy Bar we're only interested in providing the highest quality candies. Please look at our select gourmet pieces below, select favorites or see how much you want to buy! Chocolate Caramel $1 Gum Drops $2 French Truffles $3 Saltwater Taffy $4 Peanut Butter Cups $5 Cinnamon Bears $6 Toffee $7 Peanut Brittle $8 Price Favorites Drag Favorites Here Home | Contact Us The areas most specifically I'm having problems with are: and: Chocolate Caramel $1 Gum Drops $2 French Truffles $3 Saltwater Taffy $4 Peanut Butter Cups $5 Cinnamon Bears $6 Toffee $7 Peanut Brittle $8 Any help on what I might be missing would be very appreciated. Thank you EDIT: As suggested I tried moving the data portion into the rest of the function like so: Unfortunately it does not appear to fix anything. EDIT 2: I opened Google's developers tool and it's telling me that $ is not defined, did I forget to note something somewhere so that it knows it's dealing with jQuery? EDIT 3: I figured it was something stupid like that, that fixed it. Thank you all very much for your help.
favorite count: 0
has comment: http://stackoverflow.com/comment/47942060
has comment: http://stackoverflow.com/comment/47941803
type: Question
has comment: http://stackoverflow.com/comment/47942153
upvote count: 1
has comment: http://stackoverflow.com/comment/47941733
has comment: http://stackoverflow.com/comment/47942176
has comment: http://stackoverflow.com/comment/47941560
has title: jQuery filter by slider
answer count: 0
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47941720
has comment: http://stackoverflow.com/comment/47941943
downvote count: 0
tagged with: jquery
score: 1

http://stackoverflow.com/a/29999897
has comment: http://stackoverflow.com/comment/48119934
has comment: http://stackoverflow.com/comment/48118942
answers question: http://stackoverflow.com/q/29999771
has comment: http://stackoverflow.com/comment/48119901
has body: Actually, to find all non-closed tags, you need to check if there is no closing tag, and it can be done with a negative look-ahead: (<DT[^<]*><A HREF="[\s\S]*?<\/A>)(?!<\/DT>) Replace with $1 . Adding i option, we make sure we'll also capture tags. [\s\S]*? will capture newlines, too. [^<]* in <DT[^<]*> will make sure we'll also capture tags with attributes. See demo. Sample code: var re = /(<DT[^<]*><A HREF="[\s\S]*?<\/A>)(?!<\/DT>)/gi; var str = ' \n Links for United States \n \n GobiernoUSA.gov\n USA.gov\n \n MSN Websites \n \n MSN Autos\n MSN Entertainment\n MSN Money\n MSN Sports\n MSN\n MSNBC News\n \n\n '; var subst = '$1 '; var result = str.replace(re, subst);
accepted answer of: http://stackoverflow.com/q/29999771
has comment: http://stackoverflow.com/comment/48119728
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/48143199
has comment: http://stackoverflow.com/comment/48118956
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/48143674
score: 1
has comment: http://stackoverflow.com/comment/48119323

http://stackoverflow.com/comment/47824628
type: QuestionComment
has text: Yes, please do a request to ```/XMII/Illuminator?QueryTemplate=ZTest/QueryTemplates/table%20list&content-type=text/json``` manually and post the resulting JSON here
score: 3
comment on: http://stackoverflow.com/q/29846033
type: Comment

http://stackoverflow.com/comment/48098442
score: 0
type: Comment
has text: Yeah, how does this return the account data? It's just the ids right? I really appreciate the answer though!
comment on: http://stackoverflow.com/a/29989498
type: AnswerComment

http://stackoverflow.com/comment/47850523
type: QuestionComment
comment on: http://stackoverflow.com/q/29862545
score: 1
type: Comment
has text: Why are the names different from the input to the output?

http://stackoverflow.com/comment/75362317
type: Comment
has text: I did [a performance test](https://jsperf.com/object-keys-vs-for-in-for-object-generators) and it seems like `for in` is faster. Can you confirm on your browser?
type: AnswerComment
comment on: http://stackoverflow.com/a/32671263
score: 0

http://stackoverflow.com/a/29867248
answers question: http://stackoverflow.com/q/29861966
score: 0
has body: I figured it out, I wasn't accounting for the operation correctly, I needed to add the operation to the axis I was moving on, so the statement Math.abs( app.cursor[axis] - origin[axis] ) + // calculate the difference between the opposite axis and // the origin and add it to the previous calculation Math.abs( app.cursor[oppositeAxis] - origin[oppositeAxis] ) + // add the operation to be performed ( movement of cursor, 1 or -1 ) operation; should actually be like this: // add operation to curser location to account for movement Math.abs(( app.curser[axis] + operation ) - origin[axis] ) + // instead of the adding operation at the end Math.abs( (app.curser[oppositeAxis]) - origin[oppositeAxis] );
accepted answer of: http://stackoverflow.com/q/29861966
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/comment/48068599
comment on: http://stackoverflow.com/q/29974229
type: Comment
type: QuestionComment
score: 0
has text: @Sergeinsas I don't have problems with that. But if you must know, I have a folder named "Users" and I get it using the id. I am am using the createFolder(_folder_) method to create the userFolder inside my folder named "Users"

http://stackoverflow.com/comment/47992274
type: QuestionComment
comment on: http://stackoverflow.com/q/29935042
score: 1
has text: works fine for me http://jsfiddle.net/moogs/NpgD5/481/
type: Comment

http://stackoverflow.com/comment/47949276
type: AnswerComment
score: 0
type: Comment
has text: Oh, I think I understand! Perhaps to clarify your answer, provide an example of what the JSON-formatted response should look like.
comment on: http://stackoverflow.com/a/29913694

http://stackoverflow.com/q/29907560
type: Question
tagged with: audio
has title: How to extract audio from a website
score: 1
has answer: http://stackoverflow.com/a/29907931
answer count: 1
tagged with: javascript
favorite count: 0
upvote count: 2
type: UnansweredQuestion
downvote count: 1
has body: I'm trying to download the audio file for the background music running on this site: http://middle-earth.thehobbit.com/map I was expecting to find it under something like 'resources' with Chrome developer tools but no luck. Is there some kind of javascript reference to the audio files? Thanks in advance, Will

http://stackoverflow.com/a/29984973
upvote count: 2
accepted answer of: http://stackoverflow.com/q/29984909
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/48089337
downvote count: 0
has comment: http://stackoverflow.com/comment/48089294
type: AcceptedAnswer
has body: You shouldn't add keypress on the button, but on the body or the window. $(document.body).keydown(function(event){ if(event.keyCode == 13){ $("#guessSubmit").click(); } }); Demo
answers question: http://stackoverflow.com/q/29984909

http://stackoverflow.com/q/29942018
tagged with: http://stackoverflow.com/tag/html
tagged with: sencha-touch
has answer: http://stackoverflow.com/a/29947210
has comment: http://stackoverflow.com/comment/48005659
answer count: 1
accepted answer: http://stackoverflow.com/a/29947210
has body: I am working with a major improvement in a website, currently the language is english but I need support for hebrew, I have modify all my text components and forms for this purpose. At the moment I have added the next line: &lt;meta http-equiv="Content-Language" content="de, fr, it, en, he, iw"/&gt; for to support special characters or symbols (right?) But I have seen the metadata dirin the html tag is needed to specify the direction of writing, but I suppose is needed in all the text components. Question is: how to change the direction of writing in all these form components depending of the country?
score: 0
has title: How to change the direction of writing depending of the country?
tagged with: lang
type: AnsweredQuestion
tagged with: javascript
has comment: http://stackoverflow.com/comment/48005245
type: Question

http://stackoverflow.com/a/29895984
has body: You can't get the cookie data in your JS. The API won't allow you. What do I have to do to save the cookie in my front end app? Just set the Set-Cookie header in the response from the server side code. The browser should save it automatically. As a developer, you may be able to inspect the value of the cookies using "Developer Tools". And the same cookie will be sent in subsequent requests to the same domain, until the cookie expires.
upvote count: 16
has comment: http://stackoverflow.com/comment/124027782
has comment: http://stackoverflow.com/comment/47914602
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29895569
answers question: http://stackoverflow.com/q/29895569
type: Answer
has comment: http://stackoverflow.com/comment/47915301
has comment: http://stackoverflow.com/comment/47914626
downvote count: 0
has comment: http://stackoverflow.com/comment/124027302
score: 16

http://stackoverflow.com/q/29864734
has comment: http://stackoverflow.com/comment/47854586
type: Question
has comment: http://stackoverflow.com/comment/47854650
has comment: http://stackoverflow.com/comment/47854608
has comment: http://stackoverflow.com/comment/47854666
has title: understanding MDN's example of bind
upvote count: 2
accepted answer: http://stackoverflow.com/a/29864810
has body: Hey guys i have been trying to learn what the bind() method does in JS and i have found a few helpful resources in SO , MDN and also git that do explain this rather well , but i am still a bit confused with a practical example that i found on MDN. The below code i am talking about : function LateBloomer() { this.petalCount = Math.ceil(Math.random() * 12) + 1; } // Declare bloom after a delay of 1 second LateBloomer.prototype.bloom = function() { window.setTimeout(this.declare.bind(this), 1000); }; LateBloomer.prototype.declare = function() { console.log('I am a beautiful flower with ' + this.petalCount + ' petals!'); }; now bind function just like call() or apply() , thats what i understood so far , but what it does is , it can delay the execution of a function while preserving or rather binding the value of the this to a specific function . now in the below lines of code : LateBloomer.prototype.bloom = function() { window.setTimeout(this.declare.bind(this), 1000); }; what is the 1st this pointing to ? and what is the secound this pointing to ?
has comment: http://stackoverflow.com/comment/47854646
answer count: 1
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/29864810
has comment: http://stackoverflow.com/comment/47854679
has comment: http://stackoverflow.com/comment/47854658
linked to: http://stackoverflow.com/q/15455009
score: 2
type: AnsweredQuestion
downvote count: 0
has comment: http://stackoverflow.com/comment/47854624

http://stackoverflow.com/q/29982228
accepted answer: http://stackoverflow.com/a/29982343
upvote count: 5
tagged with: javascript
score: 5
tagged with: canvas
has body: I want to move from having a ball bounce back and forth around a canvas to having some gravity and eventually dropping. I know i need to change the velocity when it reaches the bottom but i have no idea how this should be done and coded. I am a completely new JS student, with no physics background - how hard is this going to be? I'm quite happy to learn etc. I tried having balls collide and come off at correct angles but that seems way above me for now. var canvas, ctx, cx = 100, cy = 150, vx = 0, vy = 5, radius = 30; function init() { canvas = document.getElementById("gameCanvas"); ctx = canvas.getContext("2d"); circle(); } function circle() { ctx.clearRect(0, 0, canvas.width, canvas.height); requestAnimationFrame(circle); if (cx + radius &gt; canvas.width || cx - radius &lt; 0) vx = -vx; if (cy + radius &gt; canvas.height || cy - radius &lt; 0) vy = -vy; cx += vx; cy += vy; } I've taken out cx movement just for up/down animation and the circle draw codes for space What would be the next step? Will i be multiplying its current velocity by a number like 0.8 on collision and where/how? Forgive basicness/horrible written code - gotta start somewhere!
downvote count: 0
answer count: 1
favorite count: 0
has title: How to apply gravity to bouncing balls in javascript -
has answer: http://stackoverflow.com/a/29982343
type: AnsweredQuestion
type: Question

http://stackoverflow.com/comment/47915609
type: Comment
has text: The link I mentioned in the answer has several examples of how to loop through the array of data ... I'm not quite sure if I understand what you're asking for, if that post doesn't answer your question.
comment on: http://stackoverflow.com/a/29851805
score: 0
type: AnswerComment

http://stackoverflow.com/comment/48056378
has text: That `[object Object]` means that where you think you've got a string, there's an object instead.
comment on: http://stackoverflow.com/q/29968394
score: 1
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/47887997
has text: Some code samples and demo would help if you want more defintive answers
type: Comment
comment on: http://stackoverflow.com/q/29881757
type: QuestionComment
score: 0

http://stackoverflow.com/q/29910504
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
has title: Swapping elements in React.js and getting <error>
has body: So I have a deck of study cards, and have a link to start the study session up top. After a user has finished a study session, I do not want the user to access the the study session link for two minutes. Instead of the link I have a timer counting down from 2 minutes to 0 using the timeLeft state. After 2 minutes, the timer goes away and is replaced by the link to the study session by setting the state to "link" in componentDidUpdate. Everything works as expected, except for a react that slows down the rendering of the deck page. My code is as follows: /** @jsx React.DOM */ var cardModel = require("../models/card.js"); var Card = React.createFactory(require("./card.jsx")); //var BackboneMixin = require("../../BackboneMixin.js"); var DeckShow = React.createClass({ //mixins: [BackboneMixin], getInitialState: function() { return {elapsedTime: this.setTime(), timeLeft: 0, cards: this.props.cards, cardsCollection: [], cardShow: "question", empty: "none" } }, componentDidMount: function () { this.props.cardCollection.fetch(); var boxes = this.getBoxState(this.props.deck) this.setState({timeLeft: this.props.delay - this.state.elapsedTime}) this.interval = setInterval(this.countDown, 1000) var startBox = []; var i = 0; while (i <= (this.props.deck.get("session_num") % 5)) { startBox.concat(boxes[i]) i += 1; } if ((this.props.deck.get("cards").length > 0) && (this.state.elapsedTime >= this.props.delay || this.props.deck.get("last_session") === null)) { this.setState({empty: "link"}); } else if (this.props.deck.get("cards").length > 0 && startBox.length === 0) { this.setState({empty: "timer"}) //setTimeout(this.setState({empty: "link"}), this.state.timeLeft) } else{ this.setState({empty: "none"}); } }, componentDidUpdate: function(nextProps, nextState) { this.props.deck.on("sync", function(){ this.forceUpdate(); }, this) if (this.state.timeLeft <= 0) { clearInterval(this.interval) this.setState({empty: "link"}) this.forceUpdate(); } }, componentWillUpdate: function(){ // var …
tagged with: backbone.js
score: 2
upvote count: 2
type: UnansweredQuestion
type: Question
tagged with: reactjs
has answer: http://stackoverflow.com/a/29913727

http://stackoverflow.com/comment/47960103
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29919051
has text: I do not see any issue in firing of event. Is that your real question? Or are you looking for some optimized method to achieve same functionality?
type: Comment

http://stackoverflow.com/comment/47841449
has text: @NormanBreau - thanks, that was better feedback. He was asking why. I gave him a answer that would probably get him the result he was looking for in the first place.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29857718

http://stackoverflow.com/comment/48007553
type: Comment
has text: Make sure you applied all webkit animation inside that.
type: AnswerComment
comment on: http://stackoverflow.com/a/29942269
score: 0

http://stackoverflow.com/comment/47896501
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29886072
has text: Tried this but the code is still not running. Very odd. I have a model window that opens within the HTML itself but cant get a simple click function to work :D
type: AnswerComment

http://stackoverflow.com/comment/47854898
has text: If I give json data inside the program it works, If the data is in external json file it is not working. like : data = '[{"k": "RAM" , "v":0.515625},{"k": "Camera" , "v":0.515625},{"k": "Design" , "v":0.05},{"k": "Processor" , "v":0}]';
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29864389

http://stackoverflow.com/comment/48115429
has text: This would only work if you have access to the other server..
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29997920
type: Comment

http://stackoverflow.com/comment/48035415
comment on: http://stackoverflow.com/q/29957278
score: 1
has text: what file is that JavaScript in? I don't see any reference to another `.js` in your HTML....
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/47940226
type: Comment
has text: @MichaelJones I have been helping you for several days, it is pleasure! :)
type: AnswerComment
comment on: http://stackoverflow.com/a/29908723
score: 0

http://stackoverflow.com/a/29984836
has comment: http://stackoverflow.com/comment/48089283
has body: There are no class variables in Javascript. Actually, there are no classes altogether in Javascript. Thinking in terms of classes and static variables (are you a Java dev?) won't let you know what's going on. Even if the concept of "a class" is independent of the programming language to some degree, it is important to understand that it's not a fundamental programming construct - and in fact there are languages without classes, like Javascript. Javascript is a very simple language: it has functions and dictionaries, and has the syntax to combine both and support programming the object-oriented way. Take this example: var johnSnow = { first: "John", last: "Snow" }; function fullName(character) { return character.first + " " + character.last; } console.log(fullName(johnSnow)); And now the OO version: var Character = function(first, last) { this.first = first; this.last = last; } Character.prototype.fullName = function() { return this.first + " " + this.last; } console.log(new Character("John", "Snow").fullName()); Finally we can answer your question: when should you set a property on a constructor and when you should use an instance? Set the property on the instance when they should not be shared with other instances (obviously). You recognize these properties because often are used in instance methods and read with this.$name Set the property on the constructor... never! Properties set on constructors are simply global variables. So just use global variables, possibly namespacing them (but obviously you'll need a global at some point!)
answers question: http://stackoverflow.com/q/29984261
upvote count: 1
type: Answer
has comment: http://stackoverflow.com/comment/48089158
has comment: http://stackoverflow.com/comment/48089484
downvote count: 0
score: 1

http://stackoverflow.com/comment/47828113
score: 0
type: QuestionComment
type: Comment
has text: i am on version `41.0.2272.101` ... though i doubt that that should make a difference... ?? -- @adeneo please look at the definition of outer vs inner height on the jquery website. Outer includes the browser's tabs and menu bars...
comment on: http://stackoverflow.com/q/29850717

http://stackoverflow.com/comment/47966422
comment on: http://stackoverflow.com/q/29922093
has text: I mean your code (OP = Original Poster). It does what's it's supposed to, it appends the elements, but they aren't visible, you can read why in the duplicate question.
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/comment/48112009
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29996167
score: 0
has text: Try deferring `return $('.gridly').gridly();` at the end of your add callback: `setTimeout(function () { $('.gridly').gridly(); }, 100);`

http://stackoverflow.com/a/29872953
answers question: http://stackoverflow.com/q/29872848
has comment: http://stackoverflow.com/comment/47886537
score: 0
has comment: http://stackoverflow.com/comment/47882394
has body: I think the ng-if is the problem. Change this: ng-if="drop == nav.drop" to this: ng-if="nav.drop" and this: ng-if="drop != nav.drop" to this: ng-if="!nav.drop" Incidentally, I agree with the commenter that ng-repeat="nav in nav" is confusing. EDIT: How to get one list instead of two: {{nav.display}} {{nav.display}} {{sub.display}}
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47883125
has comment: http://stackoverflow.com/comment/47885031
type: Answer
accepted answer of: http://stackoverflow.com/q/29872848

http://stackoverflow.com/q/29908568
has title: jQuery - .load() each incremental id (ex: content1, content2, etc.)
tagged with: javascript
has comment: http://stackoverflow.com/comment/48021768
has answer: http://stackoverflow.com/a/29908704
has answer: http://stackoverflow.com/a/29968968
answer count: 2
has comment: http://stackoverflow.com/comment/47965308
downvote count: 0
possible better answer: http://stackoverflow.com/a/29908704
score: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/47939657
favorite count: 0
tagged with: php
accepted answer: http://stackoverflow.com/a/29968968
has body: Wasn't quite sure how to ask this, but anyways. I am automatically adding divs (in php) depending on the id's stored in an array, and I'd like to refresh every existing div with a different value. Here's an example of what the divs look like: Data: $device_data I'm trying to reload the elements with the id "reload$device_id" (currently have 2 different id's, so it'd be reload1 and reload2). Thank you for your help! p.s: first time posting a question, not sure how this will work Edit1: had a <=device_id_list.length instead, quick typo was fixed. Edit2: Current code, pretty similar, only reloads first one :/
type: AnsweredQuestion
upvote count: 1
type: Question

http://stackoverflow.com/comment/48106288
has text: Thanks for the help tpie! I had done that exact thing but I didn't understand how to stop the animation. I was stuck trying to switch classes, remove the attr all together, and then add it back on another mouseenter. I was making it way too complicated obviously.
comment on: http://stackoverflow.com/a/29993281
type: AnswerComment
type: Comment
score: 1

http://stackoverflow.com/q/29915003
has body: I have yo someGen, that prompts few questions. one of the prompts, someQuestion is asking would you like to use smthng? and the user can choose from smthng1,smthng2 or no. I have a a sub generator yo someGen:smthng that do something else(smthng1 or smthng2) , with regard to the answer from someQuestion. Now if the user trying yo someGen:smthng, but earlier (in main gen) he answered no, I want to propmt someQuestion again. giving him the chance to decide smthng now, and then operate yo someGen:smthng according to the new answer, with the ability to regret and answer no again. How would I do that?
score: 0
tagged with: yeoman
tagged with: yeoman-generator
type: UnansweredQuestion
has title: yeoman call generator prompt from sub-generator
type: Question
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/29931753

http://stackoverflow.com/comment/47828107
has text: Do not forget to accept answers (I say this also for your old questions)
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29850812

http://stackoverflow.com/q/29987238
type: AnsweredQuestion
score: 3
has comment: http://stackoverflow.com/comment/48093734
tagged with: http://stackoverflow.com/tag/json
downvote count: 1
type: Question
upvote count: 4
has title: Convert object to JSON Array?
possible better answer: http://stackoverflow.com/a/29987365
answer count: 2
has answer: http://stackoverflow.com/a/29987338
has answer: http://stackoverflow.com/a/29987365
has body: I have the following object being returned. I am counting a list of names by reading from a json file and storing the results in a new object. { ted: 501, jeff: 40, tony: 90 } The following function creates an object with the names as properties and the count as their values. function countNames(json){ var count = {}; for (var i = 0, j = json.length; i &lt; j; i++) { if (count[json[i].name]) { count[json[i].name]++; } else { count[json[i].name] = 1; } } return count; } I need to create an array of objects that generate a result like this. [ { name: 'ted', total: 501 }, { name: 'jeff', total: 40 } { name: 'tony', total: 90 } ] I am not sure what the best approach and most efficient way of achieving this is. Any help is appreciated.
tagged with: javascript
has comment: http://stackoverflow.com/comment/48093844
favorite count: 0
accepted answer: http://stackoverflow.com/a/29987338

http://stackoverflow.com/comment/47842593
type: Comment
has text: @D-side take a look at the accepted answer if you'd like an explanation of why Ruby's console output works. The console output is not the exact string returned by the `to_json` call.
type: AnswerComment
comment on: http://stackoverflow.com/a/29857786
score: 0

http://stackoverflow.com/comment/47947056
type: QuestionComment
score: 0
has text: any type of javascript verification is insecure, because as you said, anyone can see or edit the javascript client-side. The proper way to do it would be with php, which is server side and secure. I believe you are doing everything else correctly though.
type: Comment
comment on: http://stackoverflow.com/q/29912485

http://stackoverflow.com/q/29959702
tagged with: charts
accepted answer: http://stackoverflow.com/a/29960044
answer count: 1
tagged with: javascript
tagged with: jquery
score: 0
tagged with: http://stackoverflow.com/tag/html
has title: Google table chart not loading toggle
tagged with: twitter-bootstrap
has answer: http://stackoverflow.com/a/29960044
type: AnsweredQuestion
has body: I have used bootstrap toggle for on off button. If I used this out of the google table chart it is working fine. But it was showing the simple checkbox inside the google table. Alerts Please give me a solution for this, Thanks in Advance.
type: Question

http://stackoverflow.com/comment/48072299
comment on: http://stackoverflow.com/a/29974998
has text: Ah, that's a shame. I figured hardly anyone uses/supports IE8 nowadays. I feel for you man.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/48110236
score: 1
comment on: http://stackoverflow.com/a/29995324
has text: [Documentation is helpful](https://developer.mozilla.org/en-US/docs/Web/API/Location/reload)
type: AnswerComment
type: Comment

http://stackoverflow.com/q/29850596
has body: I'm storing different values in the sessionStorage during a longer process. At the end i want to read all the data and send it to my php backend using ajax. The problem is that php seems to take every value including quotes. Here is what i got: // Reading data from storage var imgb = sessionStorage.getItem("img_b_id"); .... // perpare data var oData = { imgb: imgb, ... }; // Sending data $.post( "../php/direct/create.php", oData).done(function(data) { if(data==true) { window.open("step5.php", "_self"); } else { alert("Error: " + data.toString()); } }); This is working perfectly fine. However, php will read the value of imbg with quotes. Example: echo $_POST['imgb']; /* Returns "asd" instead of asd The image below shows that my data is stored without the quotes (chrome sessionstorage screenshot) Do you have any suggestions on how to solve this. I currently replace the quotes, but I'd love to fix this problem at it's root...
tagged with: php
type: Question
score: 2
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47828468
answer count: 1
tagged with: sessionstorage
downvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47827694
has title: Remove quotes when reading from sessionStorage and sending to php using jquery
has answer: http://stackoverflow.com/a/29866017
accepted answer: http://stackoverflow.com/a/29866017
favorite count: 0
has comment: http://stackoverflow.com/comment/47829607
upvote count: 2

http://stackoverflow.com/comment/48077714
type: Comment
comment on: http://stackoverflow.com/q/29977537
has text: Can you share a JSFiddle with what you tried so far and what you want to achieve? Might turn to be really easier to get an aswer.
score: 0
type: QuestionComment

http://stackoverflow.com/a/29857475
type: Answer
has body: Try this: var data = ["Michael", "Marc", "John", "David", "Nick", "Mom", "Al", "Marlana", "Max", "Scooter", "Pat", "George", "Lynne", "Tatyana", "Kim", "Kerry", "Enza", "Matt", "Liz", "Linda", "Ryan", "Ed", "Frank", "Christine", "Bill", "Jack", "Jill", "Joe", "Harry", "Red", "Fred", "Iggy", "Brian", "Bob", "Paul", "Gil", "Damian", "Kip", "Phil", "Curtis", "Aly", "Richard", "Robin", "Grant", "Ian", "Raptor", "T-Rex", "Stegosaurux", "Triceratops", "Compy"] var sixteengroup = []; var x = -1; for (var i = 0; i &lt; data.length; i++){ if (i % 16 == 0) { sixteengroup[++x] = [data[i]] continue; } sixteengroup[x].push(data[i]) } console.log(sixteengroup); Fiddle here: https://jsfiddle.net/n9ro2vwr/1/
upvote count: 1
has comment: http://stackoverflow.com/comment/47890564
answers question: http://stackoverflow.com/q/29857327
score: 1
has comment: http://stackoverflow.com/comment/47891003
downvote count: 0

http://stackoverflow.com/comment/47870075
type: QuestionComment
has text: Which one would you recommend?
comment on: http://stackoverflow.com/q/29872443
score: 0
type: Comment

http://stackoverflow.com/comment/48222130
score: 1
has text: I tried that, resetting location, rotation, scale, etc.. but unfortunately that wasn't what is causing this problem.
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/30050230

http://stackoverflow.com/comment/47992121
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/29935019
has text: Thanks, its working now. (just for the record. Some people told me i have to do it in CGI modification, which was completely wrong suggestion.)
type: Comment

http://stackoverflow.com/a/29869705
has body: You cannot do this in CSS. You will need JavaScript. If you are using jQuery, it offers a :visible selector. EDIT: jQuery's :visible selector is not the same as "in viewport", as @mplungjan pointed out. @mplungjan also found this page on viewport selectors for jQuery: http://www.appelsiini.net/projects/viewport
downvote count: 0
has comment: http://stackoverflow.com/comment/47864501
type: Answer
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/29869671

http://stackoverflow.com/comment/47826347
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29849866
type: Comment
has text: @enigma because OP is loading the same script more than once and needs to either unbind `off()` before adding handlers or use event delegation just once

http://stackoverflow.com/q/29936688
has title: Get Selected check box items from a click of a button
has comment: http://stackoverflow.com/comment/48007566
tagged with: checkbox
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29936934
score: 1
has body: How can I go about getting checked check box item's ID in a repeated list from a click of a button and add items to a variable / Array for later use? html: &lt;input id="btnCheck" type="button" value="Next" ng-click="addSelected()" /&gt; &lt;div ng-controller="movieController"&gt; &lt;ul&gt; &lt;li ng-repeat="movie in Movies"&gt; &lt;input id="chkBox-{{ movie.MovieID }}" type="checkbox" ng-checked="selection.indexOf(movie.MovieID) &gt; -1" ng-click="toggleSelection(movie.MovieID)" /&gt; &lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; Script: $scope.AddSelected = function () { var selected = $scope.selection console.log(selected); } $scope.selection = []; $scope.toggleSelection = function toggleSelection(movie) { var idx = $scope.selection.indexOf(movie); if (idx &gt; -1) { $scope.selection.splice(idx, 1); } else { $scope.selection.push(movie); } };
has comment: http://stackoverflow.com/comment/47995640
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/29936934
upvote count: 1
possible better answer: http://stackoverflow.com/a/29936864
tagged with: javascript
favorite count: 0
linked to: http://stackoverflow.com/q/14514461
tagged with: angularjs-ng-repeat
tagged with: angularjs
downvote count: 0
has answer: http://stackoverflow.com/a/29936864

http://stackoverflow.com/comment/47947171
score: 0
comment on: http://stackoverflow.com/q/29912286
type: QuestionComment
type: Comment
has text: i am getting sample.dev//common/css/test.css @ViperCode

http://stackoverflow.com/a/29953687
has comment: http://stackoverflow.com/comment/48029408
answers question: http://stackoverflow.com/q/29953628
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29953628
has comment: http://stackoverflow.com/comment/48028381
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/48028629
has body: The image has to load before you can get the dimensions var height_array = [] var width_array = [] for (i = 1; i &lt;= 13;i = i + 1) { (function(j) { var img = new Image(); img.onload = function() { height_array[j] = img.height; width_array[j] = img.width; } if (img.complete) img.onload(); if (j &lt;= 9){ img.src = "img/rehe/RE0"+j+"/001.png"; } else { img.src = "img/rehe/RE"+j+"/001.png"; } })(i); }
upvote count: 2
has comment: http://stackoverflow.com/comment/48028775
has comment: http://stackoverflow.com/comment/48028566
has comment: http://stackoverflow.com/comment/48029005

http://stackoverflow.com/q/29950772
answer count: 2
tagged with: extjs5
tagged with: gridview
type: UnansweredQuestion
tagged with: extjs-stores
has body: How can i loop through my store in a grid to validate a whole column? I know how to query the grid and store but how do i loop in it to check if that specific column has what I'm checking for? var grid = Ext.ComponentQuery.query('gridItemID')[0]; //query grid grid.getStore().data.items[0].raw['HeaderOfColumnIWant']; //get column header //now how to loop in store to validate what is in that column
has title: Loop through store to validate column in grid
has answer: http://stackoverflow.com/a/29951479
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/29952046
tagged with: extjs
score: 0

http://stackoverflow.com/comment/47866846
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29870715
type: Comment
has text: The demo that I have offer, does not show any of points regarded in the signed answer of http://stackoverflow.com/questions/802854/why-is-document-write-considered-a-bad-practice. Simply it works and it is the more near solution from the OP code.

http://stackoverflow.com/a/54586278
has body: If you have checked all the solution than also having this error than check this one Another cause of having this error is calling a method which is not exist or not not exported. In my case i am calling login method but i forgot to define them I was trying to call this method app.post('/api/login', db.login); but i had forgot to create login method so i got this error. also try to check spelling mistake may be you might have typed wrong spell
answers question: http://stackoverflow.com/q/29941208
downvote count: 0
score: 1
upvote count: 1
type: Answer

http://stackoverflow.com/q/29891859
has title: URL change when scrolling on the page
downvote count: 4
upvote count: 0
answer count: 1
has body: I want to change URL of the site when i scrolling the page. When I scrolling the page,URL of the page will automatically change after each content.
tagged with: jquery
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47907137
score: -4
has comment: http://stackoverflow.com/comment/47907094
has answer: http://stackoverflow.com/a/29891947
linked to: http://stackoverflow.com/q/3338642
type: Question
tagged with: javascript

http://stackoverflow.com/comment/47983801
comment on: http://stackoverflow.com/q/29930565
has text: Ok, I'll be more mindful of this next time.
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/comment/48007688
score: 0
has text: Filter works even better. I forgot about it the first time around :P
type: Comment
comment on: http://stackoverflow.com/a/29942573
type: AnswerComment

http://stackoverflow.com/comment/47914211
comment on: http://stackoverflow.com/a/29895363
type: Comment
has text: I've checked, but seriosly I didn't find answers to my questions, I will use the subdirectories, but i don't know if it's better to put the language here www.example.com/fr-FR/index.html or www.example.com/index.html/fr-FR. I don't know if I have to redirect, or only use a render to keep fr-FR in the URL , do you have an idea about those type of questions?
score: 0
type: AnswerComment

http://stackoverflow.com/a/29945623
has body: Answer: optimized noops are - wait for it - noops :) Explanation: If you use your gen code here http://www.closure-compiler.appspot.com/home with ADVANCED_OPTIMIZATIONS it produces: new function(){}; if you add myTestData.addBlog("test"); it produces: (new (function(){function a(){}a.prototype.a=function(){console.log("add blog")};return a}())).a();
answers question: http://stackoverflow.com/q/29944248
has comment: http://stackoverflow.com/comment/48012487
has comment: http://stackoverflow.com/comment/48012354
score: 1
has comment: http://stackoverflow.com/comment/48012711
has comment: http://stackoverflow.com/comment/48013525
downvote count: 0
has comment: http://stackoverflow.com/comment/48012258
upvote count: 1
type: Answer

http://stackoverflow.com/q/29939367
answer count: 1
has answer: http://stackoverflow.com/a/30692676
linked to: http://stackoverflow.com/q/13576906
tagged with: d3.js
has comment: http://stackoverflow.com/comment/47999925
has body: One of graph, I display the number of persons in each category, so the axis is ordinal. If I put 10 ticks and elasticX, it starts with a max number of several hundreds, and each tick as a good number. However, if I click on other charts and I filter until the max category has only 5 persons, the tick will be a 0,5 | 1 | 1,5 | 2... It obviously looks silly to display an option of 1.5 person. Is there a way to adjust the number of ticks so it doesn't display a step &lt; 1?
type: AnsweredQuestion
has title: How to format the units to avoid decimal points?
accepted answer: http://stackoverflow.com/a/30692676
type: Question
has comment: http://stackoverflow.com/comment/49427700
tagged with: javascript
tagged with: dc.js
score: 0

http://stackoverflow.com/comment/48080734
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29980190
has text: @prashanth did you get to see the dynamic message after entering the username and password in register.html? It doesn't work at my end :'(

http://stackoverflow.com/a/29893145
answers question: http://stackoverflow.com/q/29893009
type: Answer
has body: That's because ticket_arr isn't an array, it's a string. Fix that either by removing the single quotes around the value: var ticket_arr = [{"Id":"a874062a-3f1e-4f91-a9d7-334aedd2e79f","Name":"Tesr","StartDate":"2015-04-08","EndDate":"2015-04-09","Duration":"1","leaf":true,"IsProject":false,"IsStage":false,"IsActivity":false,"IsTicket":true,"IsTask":false},{"Id":"19f3722f-5f19-430a-bf8a-699c6841aec2","Name":"Go define this test projecct","StartDate":"2015-04-21","EndDate":"2015-04-29","Duration":"8","leaf":true,"IsProject":false,"IsStage":false,"IsActivity":false,"IsTicket":true,"IsTask":false},{"Id":"5576edbf-3feb-4204-b488-0d0a35688538","Name":"Mike is getting a lesson in cool","StartDate":"2015-04-08","EndDate":"2015-04-10","Duration":"2","leaf":true,"IsProject":false,"IsStage":false,"IsActivity":false,"IsTicket":true,"IsTask":false},{"Id":"5bf5d77c-73b1-480b-8758-2e822db73964","Name":"Test ticket","StartDate":"2015-04-08","EndDate":"2015-04-09","Duration":"1","leaf":true,"IsProject":false,"IsStage":false,"IsActivity":false,"IsTicket":true,"IsTask":false}]; Or, if it's loaded via AJAX or generated on the client side, by parsing it as JSON: var ticket_arr = JSON.parse('[{"Id":"a874062a-3f1e-4f91-a9d7-334aedd2e79f","Name":"Tesr","StartDate":"2015-04-08","EndDate":"2015-04-09","Duration":"1","leaf":true,"IsProject":false,"IsStage":false,"IsActivity":false,"IsTicket":true,"IsTask":false},{"Id":"19f3722f-5f19-430a-bf8a-699c6841aec2","Name":"Go define this test projecct","StartDate":"2015-04-21","EndDate":"2015-04-29","Duration":"8","leaf":true,"IsProject":false,"IsStage":false,"IsActivity":false,"IsTicket":true,"IsTask":false},{"Id":"5576edbf-3feb-4204-b488-0d0a35688538","Name":"Mike is getting a lesson in cool","StartDate":"2015-04-08","EndDate":"2015-04-10","Duration":"2","leaf":true,"IsProject":false,"IsStage":false,"IsActivity":false,"IsTicket":true,"IsTask":false},{"Id":"5bf5d77c-73b1-480b-8758-2e822db73964","Name":"Test ticket","StartDate":"2015-04-08","EndDate":…
score: 1
upvote count: 1
downvote count: 0

http://stackoverflow.com/a/29995514
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29995382
type: Answer
has body: $('a[href^="#"]') This selector is saying "get all a tags that start with href=#". So the best idea would be to change this selector, to instead go by class names. You could for example do this: link And js: $('.autoscrollLink').on('click', function(event) { var target = $( $(this).attr('href') ); if( target.length ) { event.preventDefault(); $('html, body').animate({ scrollTop: target.offset().top-30 }, 1000); } });
score: 1
upvote count: 1
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29995382

http://stackoverflow.com/comment/47954948
comment on: http://stackoverflow.com/a/29906546
type: AnswerComment
score: 0
type: Comment
has text: sorry, i thought you need native code. Have you see this [Possible Answer](http://stackoverflow.com/questions/13044805/how-to-check-if-an-app-is-installed-from-a-web-page-on-an-iphone)

http://stackoverflow.com/q/29908807
has body: My array is: { "data":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAyAAAAJYCAYAAACadoJwAAAgAElEQ…ACCCCAAAIIIICAvwIEIP760zoCCCCAAAIIIIAAAoES+P992sgQ2E6rdwAAAABJRU5ErkJggg==", "name":"splash.png", "imageOriginalWidth":1024, "imageOriginalHeight":768, "imageWidth":1969, "imageHeight":1477, "width":800, "height":600, "left":-585, "top":-406 } and I have two variables: $image_data = $array['data']; $image_name = $array['name']; Both of these variables return undefined Am I missing something obvious?
has title: Can't access items in javascript array
has comment: http://stackoverflow.com/comment/47940572
has comment: http://stackoverflow.com/comment/47940964
upvote count: 2
answer count: 2
has comment: http://stackoverflow.com/comment/47940818
tagged with: arrays
tagged with: javascript
tagged with: variables
has answer: http://stackoverflow.com/a/29908899
has answer: http://stackoverflow.com/a/29908900
accepted answer: http://stackoverflow.com/a/29908900
has comment: http://stackoverflow.com/comment/47940663
favorite count: 0
has comment: http://stackoverflow.com/comment/47940497
has comment: http://stackoverflow.com/comment/47940417
has comment: http://stackoverflow.com/comment/47940177
duplicate of: http://stackoverflow.com/q/11922383
possible better answer: http://stackoverflow.com/a/29908899
has comment: http://stackoverflow.com/comment/47940223
tagged with: undefined
score: 2
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/11922383
downvote count: 0
has comment: http://stackoverflow.com/comment/47940746
has comment: http://stackoverflow.com/comment/47940266
type: Question

http://stackoverflow.com/q/29991783
answer count: 1
has comment: http://stackoverflow.com/comment/48102959
has comment: http://stackoverflow.com/comment/48126013
tagged with: kendo-chart
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/30945958
type: Question
tagged with: javascript
tagged with: jquery
tagged with: kendo-ui
score: 0
has title: Kendo Bar Chart With Multiple Vertical Axis
has body: I have a chart where I would like to display two vertical axis: value and percentages for alcohol &amp; drugs in a given month. Graph is showing columns for drug and alcohol by linking them to value field but it is not displaying percentages. I want the graph to show both values and percentages for each month for both drugs and alcohol. Here is the Fiddle HTML &lt;div id = "parentDiv"&gt;&lt;/div&gt; Java Script var sharedDataSource = new kendo.data.DataSource({ data: [ { id: 1, value: 10, seriesTitle:"Alcohol", percentValue: 33, item: "Apr 15", ServiceName:"Test1" }, { id: 2, value: 20, seriesTitle:"Drug", percentValue: 67, item: "Apr 15",ServiceName:"Test1" }, { id: 3, value: 10, seriesTitle:"Alcohol", percentValue: 50, item: "May 15",ServiceName:"Test1" }, { id: 4, value: 10, seriesTitle:"Drug", percentValue: 50, item: "May 15",ServiceName:"Test1" } ], schema: { model: { id: "id", fields: { id: { type: "number", editable: false }, value: { type: "number" }, seriesTitle: { type: "string" }, percentValue: { type: "number" }, item: { type: "string" }, ServiceName: { type: "string" } } } }, sort: [ { field: "ServiceName", dir: "asc" } ], group: [ { field: "seriesTitle" } ] }); createChart(); function createChart() { $("#parentDiv").kendoChart({ dataSource: sharedDataSource, autoBind: false, legend: { position: "top" }, chartArea:{ width:200, height:140}, valueAxis: [{ //min: 100, field: "value" } , { labels: { format: "{0}%" }, //min: 100, //max: 100, // name; "percentValue" field: "percentValue" } ], categoryAxis: { field: "item" }, series: [ { field: "value" } ] }); } sharedDataSource.read(); External Sources &lt;link rel="stylesheet" href="http://cdn.kendostatic.com/2015.1.408/styles/kendo.common.min.css"&gt; &lt;link rel="stylesheet" href="http://cdn.kendostatic.com/2015.1.408/styles/kendo.rtl.min.css"&gt; &lt;link rel="stylesheet" href="http://cdn.kendostatic.com/2015.1.408/styles/kendo.default.min.css"&gt; &lt;link rel="stylesheet" href="http://cdn.kendostatic.…
has answer: http://stackoverflow.com/a/30945958

http://stackoverflow.com/q/29954028
type: AnsweredQuestion
downvote count: 0
tagged with: jquery
favorite count: 0
tagged with: bootstrap-datepicker
accepted answer: http://stackoverflow.com/a/29954350
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/48029009
possible better answer: http://stackoverflow.com/a/29971588
score: 4
has answer: http://stackoverflow.com/a/29971588
tagged with: twitter-bootstrap
has body: Lets say for example that I make the first selection within Check-In on May 10th, it automatically goes to the Check-Out section with May 10th selected as well and rest of the days afterwards available. What I'm trying to do is make it so that the day selected and the following 2 days are available and not the rest. If your curious about documentation, the URL link for the Bootstrap Datepicker that I'm using is: http://www.eyecon.ro/bootstrap-datepicker/ A JSFiddle link of what I currently have is here: http://jsfiddle.net/9f6xhrm9/2/ If the above JSFiddle link doesn't work for you, then its probably cause your browser is forcing a https, using chrome does not cause this issue except for when I make it into a https. So either switch to chrome or here is the files associated with the JSFiddle link - located below: http://www.eyecon.ro/bootstrap-datepicker/js/bootstrap-datepicker.js http://www.eyecon.ro/bootstrap-datepicker/css/datepicker.css http://getbootstrap.com/dist/js/bootstrap.min.js http://www.eyecon.ro/bootstrap-datepicker/css/bootstrap.css Though since it's required to have the associated code from JSFiddle on here, I posted that down below as well: HTML &lt;input type="text" id="txtCheckIn" placeholder="* Check-In Date (M/D/Y)" readonly&gt; &lt;input type="text" id="txtCheckOut" placeholder="* Check-Out Date (M/D/Y)" readonly&gt; JS $(function(){ var nowTemp = new Date(); var now = new Date(nowTemp.getFullYear(), nowTemp.getMonth(), nowTemp.getDate()+7); $('#txtCheckOut').attr('disabled', 'disabled'); var checkin = $('#txtCheckIn').datepicker({onRender: function(date) {return date.valueOf() &lt; now.valueOf() ? 'disabled' : '';}}) .on('changeDate', function(ev) { if (ev.date.valueOf() &gt; checkout.date.valueOf()) { $('#txtCheckOut').removeAttr('disabled'); var newDate = new Date(ev.date); newDate.setDate(newDate.getDate()); checkout.setValue(newDate); } checkin.hide(); $('#txtCheckOut')[0].focus(); }) .data('datepicker'); var checkout = $('#txtCheckOut').d…
has title: Bootstrap Datepicker, maxdate, 2 days from the first date selection
has answer: http://stackoverflow.com/a/29954350
has comment: http://stackoverflow.com/comment/48029757
tagged with: javascript
upvote count: 4

http://stackoverflow.com/comment/47841664
has text: I can't call it in my main function :( could you please help
type: AnswerComment
comment on: http://stackoverflow.com/a/29857294
score: 0
type: Comment

http://stackoverflow.com/comment/47860692
has text: Maybe these old posts will help: "How do you display javascript datetime in 12 hour AM/PM format?" --> http://stackoverflow.com/questions/8888491/how-do-you-display-javascript-datetime-in-12-hour-am-pm-format or "How do you display javascript datetime in 12 hour AM/PM format?" --> http://stackoverflow.com/questions/24315100/convert-utc-time-to-hours-minutes-and-am-pm-format-in-javascript
score: 0
comment on: http://stackoverflow.com/q/29867862
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29963195
has body: This is what you want: function myFunction() { var inputElt = document.getElementById("text"); var res = inputElt.value.replace("1", "2"); inputElt.value = res; }
downvote count: 0
type: Answer
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/29963145

http://stackoverflow.com/tag/csv
type: Tag
tag name: csv
tags question: http://stackoverflow.com/q/29940225
tags question: http://stackoverflow.com/q/29859521
tags question: http://stackoverflow.com/q/29954146
tags question: http://stackoverflow.com/q/29998231
tags question: http://stackoverflow.com/q/29978957
tags question: http://stackoverflow.com/q/29945181
tags question: http://stackoverflow.com/q/29884914
tags question: http://stackoverflow.com/q/29958079
tags question: http://stackoverflow.com/q/29864960

http://stackoverflow.com/comment/101591906
score: 4
type: Comment
comment on: http://stackoverflow.com/a/41410938
has text: Just a heads up, those links are out of date
type: AnswerComment

http://stackoverflow.com/q/29868478
has answer: http://stackoverflow.com/a/29868563
type: Question
has body: I want to toggle a "hide table" button with a "search" button so that it only appears when the searched table appears and disappears. Both the functions initiated by onClick work, it's just the toggle. Any help would be great! thanks. &lt;input name="Search_Country" id="Search_Country" type="text"&gt; &lt;input type="button" value="Search" onclick="searched_country_table()"/&gt; &lt;input id="Hide" value="Hide Table" type="button" onclick="hide_table()"&gt; &lt;div id="search_table"&gt;&lt;/div&gt;
has comment: http://stackoverflow.com/comment/47862651
has answer: http://stackoverflow.com/a/29869358
tagged with: javascript
has title: Toggle a "hide table" button with "search" button
answer count: 3
accepted answer: http://stackoverflow.com/a/29868563
has answer: http://stackoverflow.com/a/29868917
possible better answer: http://stackoverflow.com/a/29868917
type: AnsweredQuestion
score: 0
tagged with: toggle

http://stackoverflow.com/a/29997718
answers question: http://stackoverflow.com/q/29997638
type: Answer
has body: First of all, you have the same id for the two buttons which leads to selecting the first button always. Accordingly you will need to target both buttons using their html attribute instead of specific id. You can do something like: $(document).ready(function () { $(".comments").hide(); var toggled = false; $("button").click(function () { if (toggled) { $(this).next().slideToggle(100); toggled = false; $(this).text("Show Comments"); } else { $(this).next().slideToggle(100); toggled = true; $(this).text("Hide Comments"); } }); }); Show Comments Author Comment Content Author Comment Content Author Comment Content Show Comments Author Comment Content Author Comment Content Author Comment Content You example with header was working because you were targeting all header tags not only a specific header as you did with the buttons. Hopefully, this will help you.
upvote count: 1
score: 1
downvote count: 0

http://stackoverflow.com/comment/48083034
comment on: http://stackoverflow.com/q/29981753
score: 0
type: QuestionComment
has text: Why don't you put `randomChar` in the `INSERT` statement?
type: Comment

http://stackoverflow.com/comment/47939460
type: Comment
has text: is this not what i am doing.... in any case ur comment has worked for the buttonsClick part. Thanks... however my error with the commentsClick still persists
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/29908352

http://stackoverflow.com/a/29900723
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29900628
has body: You can't actually delay code in JavaScript (well, not reasonably), but you can schedule it to run later and then let the current task complete. On browsers and in some non-browser environments, that's done with setTimeout or setInterval. In your case, setTimeout would probably make the most sense: var test=['1','2','3','4','5','6','7','8','9','10','11','12','13']; var i =0; loop(); function loop() { var max = Math.min(i + 5, test.length); var j; for (j = i; j &lt; max; ++j, ++i) { console.log(test[j]); } if (j &lt; test.length) { setTimeout(loop, 5000); // 5000ms = 5 second } } Live Example: (using a shorter delay) var test = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13']; var i = 0; loop(); function loop() { var max = Math.min(i + 5, test.length); var j; for (j = i; j &lt; max; ++j, ++i) { snippet.log(test[j]); } if (j &lt; test.length) { setTimeout(loop, 1000); // 1000ms = 1 second } } &lt;!-- Script provides the `snippet` object, see http://meta.stackexchange.com/a/242144/134069 --&gt; &lt;script src="http://tjcrowder.github.io/simple-snippets-console/snippet.js"&gt;&lt;/script&gt;
answers question: http://stackoverflow.com/q/29900628
type: Answer
upvote count: 4
downvote count: 0
score: 4

http://stackoverflow.com/comment/47912618
type: Comment
comment on: http://stackoverflow.com/a/29887136
score: 0
type: AnswerComment
has text: Awesome! thanks, I will read up on these. Does the CSV part of the code look like it would work?

http://stackoverflow.com/comment/47952721
type: Comment
comment on: http://stackoverflow.com/a/29914444
type: AnswerComment
score: 0
has text: Demo it. Make a JSFiddle, Codepen or whatever

http://stackoverflow.com/comment/47901803
comment on: http://stackoverflow.com/q/29888844
has text: can you post screenshots of how you want and how it is now since it's not clear in the fiddle for me!!
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29921674
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/47964720
type: AnsweredQuestion
tagged with: innerhtml
has answer: http://stackoverflow.com/a/29933240
upvote count: 1
has comment: http://stackoverflow.com/comment/47964945
linked to: http://stackoverflow.com/q/29918850
type: Question
has comment: http://stackoverflow.com/comment/47964831
tagged with: audio
tagged with: alert
score: 1
has title: Javascript:: audio.currentTime is updated properly only after alert
has body: I think that I found a bug on JavaScript Audio API. My code is working perfectly like that : var audio=new Audio(); var lastPause; var myPlayer=document.querySelector('#player&gt;.button.hand'); var playerStatus=("textContent" in document)?"textContent":"innerText"; myPlayer.addEventListener ( 'click', function() { if(audio.paused) { audio.src="Nadav Guedj - Golden Boy (Eurovision 2015 - Israel - Karaoke).mp3"; myPlayer.innerHTML="&amp;#9658;"; if(lastPause) { alert(lastPause); //If I remove this line it's not working when lastPause is defined! audio.currentTime=lastPause; } audio.play(); } else { myPlayer.innerHTML="||"; lastPause=audio.currentTime; audio.pause(); } } ); BUT If I remove or remark the alert line alert(lastPause); the audio stuck when lastPause is defined or iow... The second time the user press play (after pause).
tagged with: isset
accepted answer: http://stackoverflow.com/a/29933240

http://stackoverflow.com/q/29953261
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29953642
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29953457
tagged with: popup
has title: How to create a popup page using javascript
type: Question
has body: I'm new in web develop. I want to realize a function that when I click the link "click to see sample colors", it will popup a page like the picture to show all my sample colors. But I don't know what kind of technics to use to do it. I have search on w3schools. But the popup window or popup boxes using javaScript is not what I want. Could you help me to realize the effect using a simple way? Thank you very much!!
tagged with: javascript
score: 0
answer count: 3
possible better answer: http://stackoverflow.com/a/29953466
tagged with: jquery
has answer: http://stackoverflow.com/a/29953466
has answer: http://stackoverflow.com/a/29953457

http://stackoverflow.com/a/78750997
type: Answer
score: 0
has body: JavaScript: function join(...parts) { return parts.reduce((baseUrl, part) =&gt; new URL(part, baseUrl).toString(), ''); } TypeScript: function join(...parts: string[]): string { return parts.reduce((baseUrl, part) =&gt; new URL(part, baseUrl).toString(), ''); } This function is concise and handles several key scenarios effectively. It combines multiple path segments or URLs into a single URL using the URL constructor, which intelligently manages relative paths and normalizes the URL to avoid double slashes (e.g., http://example.com//path). If no parts are provided, it returns an empty string by using an empty string as the initial value in the reduce method. This approach eliminates unnecessary exceptions and ensures robustness, making it a reliable utility for URL manipulation in JavaScript/TypeScript.
answers question: http://stackoverflow.com/q/29855098

http://stackoverflow.com/comment/47950075
comment on: http://stackoverflow.com/q/29913997
score: 0
type: Comment
type: QuestionComment
has text: you should check this question, http://stackoverflow.com/questions/3100319/event-on-a-disabled-input

http://stackoverflow.com/q/30001404
has body: I'm getting unpredictable results when calling jquery's css("display") on an element; sometimes it's flex, other times it is block. What's strange is that this error is only present when I'm using jquery's show/hide, and the error happens about 50% of the time. What's even more strange is that I'm seeing these results before hide even runs. Update: It seems to also be tied to this google webfont css I'm including. If I remove the font the problem goes away. This is all very strange. Here's a simplification of my code: js: $(document).ready(function () { console.log("1 display: " + $("#foo").css("display")); $("#foo").hide(); console.log("2 display: " + $("#foo").css("display")); $("#foo").show(); console.log("3 display: " + $("#foo").css("display")); }); html: Test Hello! css: #foo { background: white url("bg.jpg") center no-repeat; background-size: 100vw auto; } .centerer { display: flex; flex-flow: column nowrap; align-items: center; justify-content: center; } The correct behavior should print out: 1 display: flex 2 display: none 3 display: flex But what I'm seeing about 50% of the time is: 1 display: block 2 display: none 3 display: block Any ideas on what could be causing this? I want to know why.
has title: display:flex is randomly turning into display:block with jquery hide/show and google webfont
type: AnsweredQuestion
downvote count: 0
has answer: http://stackoverflow.com/a/30001493
has answer: http://stackoverflow.com/a/30001641
accepted answer: http://stackoverflow.com/a/30001641
has answer: http://stackoverflow.com/a/36314138
upvote count: 8
type: Question
possible better answer: http://stackoverflow.com/a/36314138
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/48121678
has comment: http://stackoverflow.com/comment/48121579
has comment: http://stackoverflow.com/comment/48121509
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: css
answer count: 4
score: 8
has comment: http://stackoverflow.com/comment/48121456
has answer: http://stackoverflow.com/a/30001495

web-audio-api
tags question: http://stackoverflow.com/q/30001577
tags question: http://stackoverflow.com/q/29882702
tags question: http://stackoverflow.com/q/29903600
type: Tag
tag name: web-audio-api

http://stackoverflow.com/comment/48028935
type: Comment
has text: Glad it helped, in older devices you will notice scrollling a little bit smoother. But in newer devices you definitely won't notice the difference.
comment on: http://stackoverflow.com/a/29938828
score: 0
type: AnswerComment

http://stackoverflow.com/comment/47901776
type: AnswerComment
score: 0
type: Comment
has text: Is there any error on console???
comment on: http://stackoverflow.com/a/29888923

http://stackoverflow.com/comment/47987070
has text: you need to pass `foo` as a `Bar()` parameter, check my answer
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29932336

http://stackoverflow.com/a/29871467
accepted answer of: http://stackoverflow.com/q/29870563
answers question: http://stackoverflow.com/q/29870563
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 2
has body: The problem (which was not apparent from the JavaScript code in the question but could be seen in your fiddle) is that you are using a &lt;canvas&gt; element for the map. Don't be misled by the use of the word canvas in any Maps API example code you may have looked at. Some Maps API examples use canvas for an element ID and/or variable name. This is a very poor choice of words in these examples! It's just an arbitrary name and doesn't imply that the element itself should use a &lt;canvas&gt; tag. Change the &lt;canvas&gt; tag in your HTML code to a &lt;div&gt; and it will work.
upvote count: 2

http://stackoverflow.com/comment/48021049
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29950082
has text: Working much better now : http://jsfiddle.net/h0pkf541/6/ One small comment. When I click `Georgia` then click `Choose a state...` it goes blank. Should it not show all my entries at that point?

selenium
tags question: http://stackoverflow.com/q/29948478
tags question: http://stackoverflow.com/q/29996685
tags question: http://stackoverflow.com/q/29929848
tags question: http://stackoverflow.com/q/29936836
tags question: http://stackoverflow.com/q/29896848
tags question: http://stackoverflow.com/q/29956640
tags question: http://stackoverflow.com/q/29870440
tags question: http://stackoverflow.com/q/29999482
tags question: http://stackoverflow.com/q/29855006
tags question: http://stackoverflow.com/q/29942581
tag name: selenium
tags question: http://stackoverflow.com/q/29903695
tags question: http://stackoverflow.com/q/29930885
tags question: http://stackoverflow.com/q/29954054
tags question: http://stackoverflow.com/q/29912567
tags question: http://stackoverflow.com/q/29912867
tags question: http://stackoverflow.com/q/29932651
tags question: http://stackoverflow.com/q/29928856
tags question: http://stackoverflow.com/q/29982072
tags question: http://stackoverflow.com/q/29965085
type: Tag
tags question: http://stackoverflow.com/q/29948320
tags question: http://stackoverflow.com/q/29894519
tags question: http://stackoverflow.com/q/29900625

http://stackoverflow.com/q/29896697
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29896931
score: 1
tagged with: database
type: Question
tagged with: mongodb
answer count: 2
possible better answer: http://stackoverflow.com/a/29897216
tagged with: mongoose
tagged with: javascript
has answer: http://stackoverflow.com/a/29897216
upvote count: 1
has title: Multiple MongoDB queries without using a loop?
tagged with: node.js
favorite count: 0
downvote count: 0
accepted answer: http://stackoverflow.com/a/29896931
has body: I'm trying to figure out if I can make my MongoDB queries (fron Node.js) more quicker and more efficient. Basically I have an array of "Players", each Player has a "player_id" property. I want to iterate over each Player and use the player_id to find data about the Player in a MongoDB database. Because of the Asynchronous nature of Node.js I have to guarantee that when I send in a query to the database, the data that I get back corresponds to the player_id that was used to query. So far I have the following code (that I simplified). What I'm most interested in is how I can achieve this without using a for loop. Thanks. var playersArray = new Array({"player_id":1234567}, {"player_id":9847621}, {"player_id":0946783}, {"player_id":8712890}); queryDataForPlayers(playersArray, function(data){ //Done - Each Player now has a "new_data_property" property }) function queryDataForPlayers(playersArray){ var newPlayersArray = new Array(); var counter = 0; for(var i=0; i&lt;playersArray.length; i++) { retrievePlayerData(playersArray[i].player_id, playersArray[i], function(err,data) { newPlayersArray.push(data); if(++counter == playersArray.length) { callback(newPlayersArray); }//end if }); } } var Schema = mongoose.model('Schema'); var ObjectID = require('mongodb').ObjectID; function retrievePlayerData(playerID, obj, callback){ Schema.find({_id:ObjectID(String(playerID))}, function(err,data){ obj["new_data_property"] = data; callback(err,obj); }); }

http://stackoverflow.com/q/29885674
has answer: http://stackoverflow.com/a/50606049
score: 4
has answer: http://stackoverflow.com/a/29886503
upvote count: 4
answer count: 3
linked to: http://stackoverflow.com/q/6677035
downvote count: 0
has title: Scroll to top of facebook messages
favorite count: 0
has answer: http://stackoverflow.com/a/70147617
tagged with: facebook
accepted answer: http://stackoverflow.com/a/29886503
type: AnsweredQuestion
tagged with: scroll
has body: Is there some JavaScript code I can execute to scroll to the top of the messages box on Facebook? So when you click 'see all' and go the main message page, if you scroll up it loads more messages. I want to force the it to keep scrolling up to keep loading messages. I've tried document.body.scrollTop = document.documentElement.scrollTop = 0; But that of course only scrolls to the top of the actual page. Any ideas on how to scroll the messages box up?
type: Question
possible better answer: http://stackoverflow.com/a/50606049
tagged with: javascript

http://stackoverflow.com/a/29990265
accepted answer of: http://stackoverflow.com/q/29989830
has body: Sure you can! Just use an ng-show (good thinking) to see that both inputs are filled (using ng-model). Here is a simple example. As for your second question, you can and should put them in .js files, and include them in your index.html.
answers question: http://stackoverflow.com/q/29989830
type: Answer
downvote count: 0
score: 1
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/comment/81315137
has text: you saved me :)
score: 2
comment on: http://stackoverflow.com/a/29866068
type: AnswerComment
type: Comment

game-loop
tag name: game-loop
type: Tag
tags question: http://stackoverflow.com/q/29856379

http://stackoverflow.com/q/29956640
has comment: http://stackoverflow.com/comment/48235066
type: Question
answer count: 2
accepted answer: http://stackoverflow.com/a/30042016
linked to: http://stackoverflow.com/q/24145054
tagged with: javascript
has comment: http://stackoverflow.com/comment/48245059
possible better answer: http://stackoverflow.com/a/30063444
has answer: http://stackoverflow.com/a/30063444
has comment: http://stackoverflow.com/comment/48235241
favorite count: 0
tagged with: ruby
tagged with: angularjs
tagged with: selenium
has answer: http://stackoverflow.com/a/30042016
has body: I'm trying to see if this is possible - to automate a file upload when the HTML code is NOT an &lt; input type='file' &gt; but rather a link &lt;a ng-click="upload('files')"&gt; File Upload &lt;/a&gt; When this link is clicked, it automatically opens a file selector to choose which file you want to upload. The problem is, it does not contain an INPUT type='file' element which I could locate and then use webdriver.send_keys('/Users/myname/testfile.txt'). How can I go about trying to get selenium webdriver to handle this file upload? Any help to direct me to a solution is greatly appreciated.
has comment: http://stackoverflow.com/comment/48234856
has title: Selenium webdriver how to do file upload with ng-click="upload('files')"
downvote count: 1
type: AnsweredQuestion
score: 2
has comment: http://stackoverflow.com/comment/48234933
upvote count: 3

http://stackoverflow.com/comment/48108915
comment on: http://stackoverflow.com/a/29994545
has text: The `var email` in the above instance still contains whatever was written in the input (even after the input loses focus)
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/comment/47967623
score: 2
type: Comment
type: QuestionComment
has text: What sandbox setting are you using? IFRAME / NATIVE? Have you tried different settings?
comment on: http://stackoverflow.com/q/29922088

http://stackoverflow.com/comment/48036083
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29957632
type: AnswerComment
has text: try this one: https://jsfiddle.net/5ppbgxvq/3/ I removed the extra element and used the `rawV` back again and just used percentage so that `.drgM` resizes when `mainGT` resizes.

http://stackoverflow.com/a/30184194
has body: The following javascript code is used to load 4 records when the scroll bar hit at the bottom of screen. That means when first time 4 records will fetched, second time next 4 records fetched and these all records will displayed on the screen. This code help us to decrease the load lag at page load time. $(window).scroll(function() { if($(window).scrollTop() + $(window).height() == $(document).height()) { //alert("bottom!"); loadNext(); } }); var n1=0; var n2=4; function loadFirst() { var n1=0; var n2=4; } function loadNext() { n1=n1+4; n2=n2+4; //alert(n1); //alert(n2); 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("testidiv").innerHTML=document.getElementById("testidiv").innerHTML+xmlhttp.responseText; } } xmlhttp.open("GET","next_testimonial_action.php?a=" + n1 + "&amp;b=" + n2,true); xmlhttp.send(); } &lt;/script&gt; "next_testimonial_action.php?a=" + n1 + "&amp;b=" + n2" is the php page that contains logic for fetching data from db, and n1,n2 are the limit of the records to be fetched. If you need the php file you can request as a comment. Thank you ---- Important---- "You must call loadFirst() function at bodyOnload or document.ready() jquery"
downvote count: 1
answers question: http://stackoverflow.com/q/30001920
type: Answer
score: 2
upvote count: 3

http://stackoverflow.com/a/29994214
accepted answer of: http://stackoverflow.com/q/29993931
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/48108227
score: 0
answers question: http://stackoverflow.com/q/29993931
has body: Change '.material-label' to matLabel $(matLabel).after(matInput); Here is the JSFiddle: https://jsfiddle.net/82o6hfna/

http://stackoverflow.com/comment/48010210
comment on: http://stackoverflow.com/a/29944470
has text: @Benjamin: Updated. I found that only specify the size of background image could work very well.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/47939721
score: 2
comment on: http://stackoverflow.com/q/29908617
type: Comment
type: QuestionComment
has text: can you create a jsfiddle with some test values?

http://stackoverflow.com/comment/51143189
has text: Yes — I misspoke. It's a dict of dicts, but the physical nesting never goes any deeper (so it'll never become a dict of dicts of dicts of ...etc) but logically it can represent that.
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/29966397
type: Comment

http://stackoverflow.com/a/29961795
accepted answer of: http://stackoverflow.com/q/29961119
type: Answer
answers question: http://stackoverflow.com/q/29961119
has comment: http://stackoverflow.com/comment/48044406
score: 1
has comment: http://stackoverflow.com/comment/48044619
downvote count: 0
has body: When you create the dropdown option you already know its value, so just bind with that, so the callback is called with the correct parameter, saving you from inspecting the DOM, eg: in render() {company_items.map(function(option, index){ return ( {option.text} ); })} Then in the handler: clickSelectOption(payload){ console.log(payload); this.setState({ selected: payload }); }
has comment: http://stackoverflow.com/comment/48045731
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/48045534

http://stackoverflow.com/comment/48127214
comment on: http://stackoverflow.com/a/29996139
type: Comment
has text: But, thank you for the clarification -- usually people load all of their third party libraries before their own. So that was a bad assumption on my part that you would have done that. Once you re-order your scripts so that yours is last, you'll hopefully find my answer makes more sense.
score: 0
type: AnswerComment

http://stackoverflow.com/a/29847230
type: Answer
has body: You can use eval var searchQuery = '(data.id == "1") &amp;&amp; (data.first == "et")'; if(eval(searchQuery) === true) alert('yes'); or Function constructor: if (new Function('return ' + searchQuery)() === true) alert('yes');
answers question: http://stackoverflow.com/q/29847124
score: 0

http://stackoverflow.com/a/29919506
has comment: http://stackoverflow.com/comment/48328811
has comment: http://stackoverflow.com/comment/48328981
has comment: http://stackoverflow.com/comment/48393845
type: Answer
has comment: http://stackoverflow.com/comment/48393408
has comment: http://stackoverflow.com/comment/48328797
has comment: http://stackoverflow.com/comment/48328534
upvote count: 1
has comment: http://stackoverflow.com/comment/48329882
has comment: http://stackoverflow.com/comment/48328713
score: 1
has body: You must include the JS file where the Slider function is defined. Maybe jQuery Slider, from jQueryUI? Here is the working demo.
has comment: http://stackoverflow.com/comment/48306785
answers question: http://stackoverflow.com/q/29919425
has comment: http://stackoverflow.com/comment/48329134
accepted answer of: http://stackoverflow.com/q/29919425
has comment: http://stackoverflow.com/comment/48328692
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/a/29890131
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 1
accepted answer of: http://stackoverflow.com/q/29889998
answers question: http://stackoverflow.com/q/29889998
score: 1
has body: It is not possible in HTML but you can do it using PHP using File methods more more information you can look into php manual

http://stackoverflow.com/a/30028393
type: Answer
answers question: http://stackoverflow.com/q/29937255
has body: The problem was solved when i edited the image location in CSS page of uploadify and gave the correct path of the "uploadify-cancel.png" and it worked.
has comment: http://stackoverflow.com/comment/68117751
score: 0

http://stackoverflow.com/comment/47921432
type: Comment
type: QuestionComment
score: 1
has text: @apsillers Best bet to get it there would be to edit it to make it clearer; one of our policies is not to migrate questions that would be closed for the same reason on another site.
comment on: http://stackoverflow.com/q/29899212

http://stackoverflow.com/comment/47951812
comment on: http://stackoverflow.com/a/29894170
has text: @ Nilesh Mahajan: yaah, you are correct. for for desktop it is not look like in center as previous. then is it possible by any other way?
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/47963514
type: Comment
score: 1
type: QuestionComment
has text: if you are creating in controller then just use `first_name.value`, do not use `$.first_name`. You can directly access it by its variable name.
comment on: http://stackoverflow.com/q/29919633

http://stackoverflow.com/comment/47997275
has text: For getting Data of dollar exchange rate from the Web: http://www.finanzen.net/devisen/dollarkurs Is there any better idea?
type: Comment
comment on: http://stackoverflow.com/a/29937633
score: 0
type: AnswerComment

openlayers-3
type: Tag
tags question: http://stackoverflow.com/q/29954301
tags question: http://stackoverflow.com/q/29953530
tag name: openlayers-3
tags question: http://stackoverflow.com/q/29939272
tags question: http://stackoverflow.com/q/29986785
tags question: http://stackoverflow.com/q/29905165

http://stackoverflow.com/q/29914054
upvote count: 1
type: AnsweredQuestion
has title: Want to fetch value of a tag using javascript
has body: I have an html on a page like this: InfosysSolutions Pvt. Ltd. The value in paragraph tag changes every time. I want too fetch value inside this tag ie: in this case it is "InfosysSolutions Pvt. Ltd." using javascript.
type: Question
has comment: http://stackoverflow.com/comment/47949861
downvote count: 0
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/29914093
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/29914093
score: 1

http://stackoverflow.com/comment/47897525
type: Comment
comment on: http://stackoverflow.com/a/29886757
has text: @AndrewAlexander could you show us a basic example of the data structure you want to create written as a literal?
type: AnswerComment
score: 0

http://stackoverflow.com/q/29847281
tagged with: jquery
has title: jQuery UI autocomplete unexpected token ","(comma)
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29847340
has comment: http://stackoverflow.com/comment/47820251
type: Question
has comment: http://stackoverflow.com/comment/47847102
tagged with: autocomplete
tagged with: jquery-mobile
tagged with: javascript
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/29847340
has body: I use the autocomplete and it works on PC just fine. However, when I try to debug it on a mobile device, that is the error I am getting. I have heard about jQuery mobile, is that a requirement if I want jQuery to work on mobile devices or not? CODE(error on the 3rd line): $('#autocomplete').autocomplete({addresses, minLength: 3, messages: { noResults: '', results: function() {} } });

http://stackoverflow.com/comment/47843579
type: Comment
comment on: http://stackoverflow.com/q/29858699
score: 0
type: QuestionComment
has text: As explained in the Programmers question, you can't really determine whether a function is truly impure, just whether it's potentially impure. You have to solve the halting problem to determine if it's truly impure.

http://stackoverflow.com/a/29870397
has body: If you're not opposed to using a library for this, I find Mousetrap.js to be awesome and very easy to use. Here are a few examples from the link above: &lt;script&gt; // single keys Mousetrap.bind('4', function() { console.log('4'); }); Mousetrap.bind("?", function() { console.log('show shortcuts!'); }); Mousetrap.bind('esc', function() { console.log('escape'); }, 'keyup'); // combinations Mousetrap.bind('command+shift+k', function() { console.log('command shift k'); }); // map multiple combinations to the same callback Mousetrap.bind(['command+k', 'ctrl+k'], function() { console.log('command k or control k'); // return false to prevent default browser behavior // and stop event from bubbling return false; }); // gmail style sequences Mousetrap.bind('g i', function() { console.log('go to inbox'); }); Mousetrap.bind('* a', function() { console.log('select all'); }); // konami code! Mousetrap.bind('up up down down left right left right b a enter', function() { console.log('konami code'); }); &lt;/script&gt;
type: Answer
answers question: http://stackoverflow.com/q/29870106
score: 0

http://stackoverflow.com/comment/48033803
type: Comment
has text: @Xufox A scan is needed, but if you generate a lookup map, you only need to scan once. In your solution, it has to scan every time.
comment on: http://stackoverflow.com/a/29956385
type: AnswerComment
score: 0

http://stackoverflow.com/a/29991822
has comment: http://stackoverflow.com/comment/48106243
score: 3
has comment: http://stackoverflow.com/comment/48105660
upvote count: 3
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29974854
has comment: http://stackoverflow.com/comment/48106383
answers question: http://stackoverflow.com/q/29974854
has comment: http://stackoverflow.com/comment/48107092
type: Answer
has body: Out of interest I did this: Parse.Cloud.define("update_user", function(request, response) { var data = request.params["data"] var customerId = data.object.customer; get_stripe_customer(customerId, 100).then(function(stripeResponse) { return set_user_status(username, stripeResponse); }).then(function(username) { response.success(username); }, function(error) { response.error(error); }); }); function get_stripe_customer (customerId) { Stripe.initialize(STRIPE_SECRET_KEY); return Stripe.Customers.retrieve( customerId, { success:function(results) { // console.log(results["email"]); }, error:function(error) { } } ); }; function set_user_status(stripeResponse) { Parse.Cloud.useMasterKey(); var emailquery = new Parse.Query(Parse.User); emailquery.equalTo("username", stripeResponse['email']); // find all the women return emailquery.first({ success: function(results) { alert('running set_user_status success'); var user = results; user.set("tier", "paid"); user.save(); }, error:function(error) { console.log('error finding user'); } }); }; open to improvements... EDIT - I (@danh) cleaned it up a bit. A few notes: used promises throughout. much easier to read and handle errors get_stripe_customer requires only one param (that 100 was my idea to charge $100) set_user_status appears to need only user email as param, which apparently is in the stripeResponse set_user_status returns a promise to save the user. that will be fulfilled with the user object, not the username be sure you're clear on how to identify the user. stripe apparently provides email address, but in your user query (in set_user_status) you compare email to "username". some systems set username == email. make sure yours does or change that query. Parse.Cloud.define("update_user", function(request, response) { var data = request.params["data"] var customerId = data.object.customer; get_stripe_customer(customerId).then(function(stripeResponse) { var email = stripeResponse.email; return set_user_status(email); }).the…

http://stackoverflow.com/comment/48493683
comment on: http://stackoverflow.com/q/29934252
score: 0
type: Comment
type: QuestionComment
has text: You don't need the isColor line (that was to understand if it had underline or not, it's sort of a boolean value, as bold,italics,etc...), simply use `setStyle(obj, 'fill', color);`

http://stackoverflow.com/q/29963882
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/48049035
has title: typeahead directive in AngularJS to get chain input autofill
type: Question
has comment: http://stackoverflow.com/comment/48049484
has answer: http://stackoverflow.com/a/29965650
accepted answer: http://stackoverflow.com/a/29965650
has comment: http://stackoverflow.com/comment/48048939
answer count: 1
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/48048383
tagged with: angularjs
has body: I am now trying to write a expression using angularJS, which is like math expression. But I got stuck when I was trying to give suggestion to the operators. For example, the expression may like this: ABS(x)+Floor(y). I tried to use the typeahead directive, but suggestion only shows for the ABS(x). When operator "+" and Floor(y) were inputted, there is no suggestion. Here is my code snap. I will be very happy if anyone can help on this. Thanks! JS: $scope.explist = ['ABS(x)', 'Floor(y)'] HTML: &lt;div&gt; &lt;input type="text" maxlength="100" ng-model="exp" typeahead="e for e in explist | filter:$viewValue | limitTo:8" /&gt; &lt;/div&gt;

http://stackoverflow.com/comment/48101862
type: Comment
has text: this [link](http://stackoverflow.com/questions/6023418/when-do-i-use-if-endif-versus-if) should help you! ps. don't forget to mark my answer as the correct one. Thanks!
comment on: http://stackoverflow.com/a/29990967
score: 0
type: AnswerComment

http://stackoverflow.com/q/29856954
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47839852
has title: Load JSON file, error undefined
type: Question
has comment: http://stackoverflow.com/comment/47840614
possible better answer: http://stackoverflow.com/a/29857202
has comment: http://stackoverflow.com/comment/47840048
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/29857202
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29857294
has comment: http://stackoverflow.com/comment/47840417
has comment: http://stackoverflow.com/comment/47842391
has comment: http://stackoverflow.com/comment/47842086
score: 0
answer count: 3
has body: I'm trying to load a JSON file that I'll use as constants file, but I'm always getting the error undefined, could any one help? Here is the code: function loadJsonFile(filePath){ $.getJSON(filePath, function(Mydata) { alert(Mydata.length); return Mydata; }) error(function() { alert("error"); }); The structure of constants file is: { "var1":"v1", "var2":"v2" } Thank you in advance for your help.
has comment: http://stackoverflow.com/comment/47840021
has comment: http://stackoverflow.com/comment/47839857
tagged with: load
has comment: http://stackoverflow.com/comment/47840162
linked to: http://stackoverflow.com/q/14220321
has comment: http://stackoverflow.com/comment/47851978
has comment: http://stackoverflow.com/comment/47840501
has comment: http://stackoverflow.com/comment/47840241
has answer: http://stackoverflow.com/a/29857139
has answer: http://stackoverflow.com/a/29857294

http://stackoverflow.com/comment/47954070
score: 1
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29916227
has text: @DattaSai It seems you've misunderstood how Stack Overflow works.

http://stackoverflow.com/comment/47894543
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29885104
has text: Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/76312/discussion-between-wilfredo-turner-and-kojow7).
score: 0

http://stackoverflow.com/comment/48014830
has text: you could try ` ` that will load template from url
type: Comment
comment on: http://stackoverflow.com/q/29945757
type: QuestionComment
score: 0

http://stackoverflow.com/a/29904272
type: Answer
has body: Change if (col = 2) { doc.Tables(1).Rows.Add() doc.Tables(1).Cell(row,2).Range.Text = rs.Fields("firstname").value col = 1 rs.movenext } to if (col = 2) { if (rs.AbsolutePosition &lt; rs.RecordCount) { doc.Tables(1).Rows.Add() } doc.Tables(1).Cell(row,2).Range.Text = rs.Fields("firstname").value col = 1 rs.movenext }
downvote count: 0
answers question: http://stackoverflow.com/q/29903636
score: 1
upvote count: 1

http://stackoverflow.com/comment/47962155
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29907127
has text: There you go https://jsfiddle.net/69z2wepo/7277/. Unfortunately in the browser dev tools the generated output seems correct (as the `&amp;` is displayed as `&`), but you can see that the css struggles (It should display an invalid character). With serverside rendering in my app I can see the undesired `&amp;` output in the html source.
score: 0

http://stackoverflow.com/q/30000706
tagged with: momentjs
tagged with: node.js
score: 8
type: Question
type: AnsweredQuestion
tagged with: javascript
tagged with: date
has answer: http://stackoverflow.com/a/30000825
answer count: 1
downvote count: 0
favorite count: 0
accepted answer: http://stackoverflow.com/a/30000825
has body: I have a moment.js code that works well: var startDate = '2015-05-06T19:00:00+0300'; moment(startDate).isBetween(moment(), moment().add(30, 'days')); // returns true, that's great! But when I start refactoring to make it more readable it fails to work: var today = moment(); var startDate = '2015-05-06T19:00:00+0300'; moment(startDate).isBetween(today, today.add(30, 'days')); // returns false.. but why?
has title: moment.js - isBetween() method doesn't work consistently
upvote count: 8

http://stackoverflow.com/q/29895063
downvote count: 0
tagged with: javascript
type: UnansweredQuestion
score: 1
tagged with: jquery
has answer: http://stackoverflow.com/a/29895242
has answer: http://stackoverflow.com/a/29895245
has title: add simple onclick js to rails
has comment: http://stackoverflow.com/comment/47912913
favorite count: 0
type: Question
answer count: 3
has answer: http://stackoverflow.com/a/29895856
upvote count: 1
tagged with: ruby-on-rails
has comment: http://stackoverflow.com/comment/47913099
has body: I have a simple div in one of my views that I want to click to hide another element on the page. I put this in my application.js But it doesn't do anything. Did I put it in the wrong place? function toggleNewPostForm { $('.new-post-btn').hide(); }
has comment: http://stackoverflow.com/comment/47912939

http://stackoverflow.com/q/29961319
tagged with: jquery
favorite count: 0
upvote count: 5
tagged with: semantic-ui
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29961650
accepted answer: http://stackoverflow.com/a/29961650
has body: I want to change color of dimmer of my modal, but I can't! what should I do? Profile Picture sth Nope Yep, that's me In JS: I tried for example following code, yet, no change! $('.ui.modal').each(function() { $(this).modal({allowMultiple: true}).modal('show').css('background-color', 'yellow'); });
has title: Semantic-UI: How to change dimmer background color?
type: Question
tagged with: javascript
score: 4
answer count: 1
downvote count: 1

http://stackoverflow.com/comment/47830470
comment on: http://stackoverflow.com/a/29850548
has text: hey thanks, but this just passed these two functions to Modal. let's say inside Modal I have a method `close:function(){ $(React.getDOMNode(this)).modal.close() }` , what should I do in handleCancel so I can call this close method ?
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/47949189
has text: @T.J.Crowder could you please explain what you mean by control the pages?
comment on: http://stackoverflow.com/a/29913072
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/29853527
type: Answer
has comment: http://stackoverflow.com/comment/47841500
has comment: http://stackoverflow.com/comment/47839207
answers question: http://stackoverflow.com/q/29851146
has body: You are incorrectly icluding Javascript files that are meant for testing in your HTML file. The error you are seeing comes from the "mock" version of HTTPBackend that is used in unit tests. You should remove lines like these from the HTML:
score: 0
has comment: http://stackoverflow.com/comment/47841368

http://stackoverflow.com/comment/48016302
type: Comment
comment on: http://stackoverflow.com/a/29936873
has text: also, the only reason I'm using AJAX is to *not* have to update the array every time. It will get all images in a directory
type: AnswerComment
score: 0

http://stackoverflow.com/q/29857269
downvote count: 0
has comment: http://stackoverflow.com/comment/47846856
tagged with: jquery-validate
type: Question
upvote count: 2
possible better answer: http://stackoverflow.com/a/29858546
answer count: 2
has comment: http://stackoverflow.com/comment/47841666
has answer: http://stackoverflow.com/a/29858546
tagged with: javascript
tagged with: jquery
favorite count: 0
accepted answer: http://stackoverflow.com/a/29860551
has title: How to validate and wrap error message around input?
has body: I use the great jQuery validate plugin on my inputs: I would like to add this structure (add a div.error around my input and display my error label inside the div), something like this: This field is required. I've try to play with errorPlacement function but I can't make it.
has answer: http://stackoverflow.com/a/29860551
tagged with: input
score: 2
type: AnsweredQuestion

http://stackoverflow.com/comment/71034362
type: AnswerComment
comment on: http://stackoverflow.com/a/29929597
type: Comment
has text: Thanks; this was very helpful. I'll offer an improvement of a few lines: `var viewportContentOrig = viewportmeta.getAttribute('content'); viewportmeta.setAttribute('content', 'width=device-width, minimum-scale=1.0, maximum-scale=1.0, initial-scale=1.0'); viewportmeta.setAttribute('content', viewportContentOrig);`
score: 0

http://stackoverflow.com/comment/48107482
score: 0
comment on: http://stackoverflow.com/q/29993753
has text: What partial view? I guess what I'm trying to say is you haven't provided enough information to really get solid help yet.
type: Comment
type: QuestionComment

charts
tags question: http://stackoverflow.com/q/29969830
tags question: http://stackoverflow.com/q/29959702
tags question: http://stackoverflow.com/q/29885296
tags question: http://stackoverflow.com/q/29973833
type: Tag
tags question: http://stackoverflow.com/q/29999963
tags question: http://stackoverflow.com/q/29999382
tags question: http://stackoverflow.com/q/29960524
tags question: http://stackoverflow.com/q/29925656
tags question: http://stackoverflow.com/q/29939741
tags question: http://stackoverflow.com/q/29924793
tags question: http://stackoverflow.com/q/29891394
tags question: http://stackoverflow.com/q/29909430
tags question: http://stackoverflow.com/q/29935357
tag name: charts
tags question: http://stackoverflow.com/q/29873806
tags question: http://stackoverflow.com/q/29964121
tags question: http://stackoverflow.com/q/29929201
tags question: http://stackoverflow.com/q/29853693

http://stackoverflow.com/a/29907618
has comment: http://stackoverflow.com/comment/47959649
has comment: http://stackoverflow.com/comment/47956236
has comment: http://stackoverflow.com/comment/48031648
has comment: http://stackoverflow.com/comment/48951431
upvote count: 4
has comment: http://stackoverflow.com/comment/48899300
has comment: http://stackoverflow.com/comment/48027098
has comment: http://stackoverflow.com/comment/48030139
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/48898431
has comment: http://stackoverflow.com/comment/48878238
has comment: http://stackoverflow.com/comment/48005571
accepted answer of: http://stackoverflow.com/q/29893628
has comment: http://stackoverflow.com/comment/48899375
has comment: http://stackoverflow.com/comment/48958690
has comment: http://stackoverflow.com/comment/48860414
answers question: http://stackoverflow.com/q/29893628
has body: Components.utils.importGlobalProperties(['crypto']); var blah = crypto.subtle.deriveKey({....}); Taken from here: https://developer.mozilla.org/en-US/docs/Components.utils.importGlobalProperties
has comment: http://stackoverflow.com/comment/48897040
has comment: http://stackoverflow.com/comment/48899049
has comment: http://stackoverflow.com/comment/48899401
type: Answer
score: 4

hide
tags question: http://stackoverflow.com/q/29852293
tags question: http://stackoverflow.com/q/29857694
type: Tag
tags question: http://stackoverflow.com/q/29880871
tag name: hide

http://stackoverflow.com/q/29856612
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/29856967
has comment: http://stackoverflow.com/comment/47839340
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47839586
has comment: http://stackoverflow.com/comment/47839168
has comment: http://stackoverflow.com/comment/47839511
type: Question
has body: I am trying to get the change events to swap on a dropdown menu. If one is hidden, I want it to show when the value matches, and vise versa. Currently, once One is hidden, and the value changes, it remains hidden. Please Help. toggle isnt' working well for me. Issue Type: Any Incidents Feature Requests $(".sort > tr > td:nth-child(1)").each(function(){ var textid = $(this).text(); $(this).attr('id', textid); var id = $(this).attr('id'); $(".sort > tr").each(function(){ var ide = $(this).children('td:nth-child(1)').attr('id'); $(this).attr('id', ide); }); var username = "dariuscastillo12@qa-team.com" var password = "DpcMixcolt12!!" var formurl = "/api/v2/requests/"+id+".json)"; function make_base_auth(user, password) { var tok = user + ':' + password var hash = btoa(tok); return "Basic " + hash; } $.ajax({ type: 'GET', url: formurl, datatype: "json", beforeSend: function (xhr) { xhr.setRequestHeader('Authorization',make_base_auth(username, password)); }, success: function (result) { $.each(result, function(i, value) { $('.filter').change(function() { if ($(this).val() =='any') { $('.sort > tr').each(function() { $(this).show(); }); } if ($(this).val() === 'incident') { $('.sort > tr').each(function() { if (value.ticket_form_id == '59229' & value.id == $(this).attr('id')) { console.log('incident', $(this).attr('id')); $(this).toggle(); } }); } else if ($(this).val() === 'feature') { $('.sort > tr').each(function() { if (value.ticket_form_id == '39365' & value.id == $(this).attr('id')) { console.log('new feature', $(this).attr('id')); $(this).toggle(); } }); } }); }) } }); });
has title: jQuery change event show on click, swap
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/a/29906125
type: Answer
has comment: http://stackoverflow.com/comment/47936476
score: 0
upvote count: 1
downvote count: 1
accepted answer of: http://stackoverflow.com/q/29905794
answers question: http://stackoverflow.com/q/29905794
has body: There are lots of ways to do this, you can use the network information API with NetworkInformation.connection which is supported in chrome. do something like var connection = navigator.connection || navigator.webkitConnection; this will give you access to a boolean (which you already have) or a value. But I think what you're looking for is to IP detect, because the range would be the same for their "home network" the network itself, the network name, and data wouldn't be available to a clientside code like JS. You could use a deferred language like Python and get it hooked up with PyJamas. http://pyjs.org/ EDIT: Alternatively try using Node. Yes this is serverside, but there are resources for implementing it for chrome extensions. By using the network module you can sniff out lots of different information such as network.get_private_ip(function(err, ip) { console.log(err || ip); // should give you the users public IP, to help find out where they are }) or use network.get_interfaces_list(function(err, list) { } to get something like name: 'eth0', ip_address: '10.0.1.3', mac_address: '56:e5:f9:e4:38:1d', type: 'Wired', netmask: '255.255.255.0', gateway_ip: '10.0.1.1'
has comment: http://stackoverflow.com/comment/47964747
type: AcceptedAnswer

http://stackoverflow.com/comment/47941779
type: Comment
has text: @mido22 it's not a matter of targeting the correct video id. the video src is indeed added, as I can see from the developer console. I've tested both `stream` and `vidSource` getting the `currentTime` from the `LocalMediaStream` object. And, yes, I did try the suggestion, but it didn't change anything.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/29908926

http://stackoverflow.com/q/30002393
has title: jQuery: cannot change background-color of a table cell
type: Question
answer count: 2
tagged with: javascript
tagged with: jquery
tagged with: asp.net
score: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/48123788
tagged with: css
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/30002597
has answer: http://stackoverflow.com/a/30002971
has body: I spent way too much time solving this simple problem than I should. Therefore, I would like SO to look at this, because I do not get why it does not work. I am used to change CSS properties with jQuery, but in this particular case it doesn't work. So this is my function that is supposed to change the background colour of table cells: $("table#project_table td").click(function () { //function_td var currProjectVar = "#MainContent_CurrProject"; if ($(currProjectVar).val() == "None") { $(currProjectVar).val($(this).attr('id')); $(this).css("background-color", "red"); } else { $("table#project_table td#" + $(currProjectVar).val()).css("background-color", "blue"); $(currProjectVar).val($(this).attr('id')); $(this).css("background-color", "red"); } }) It does change background-color to red, but not to blue. When that line that changes colour to blue is executed, nothing happens. The cell is still red. This is the code that defines the table: Project0 Project1 Project2 Project3 Project4 Project5 Project6 Project7 Project8 Project9 Project10 Project11 Project12 This is the hidden field that I use to store the current chosen project: There are no problems with marking new cells red or changing the value of the current project. I cannot make earlier cells blue though. What am I doing wrong? Btw: do not know, whether this is important to mention, but this script runs in an ASP.NET website.

http://stackoverflow.com/q/29853015
has body: I am learning JS and currently studying for my MTA exam, so I am not an expert as you can see. I don't get where is the element that makes this code to be execute over and over. When the document loads, init() is called, it gets the element that is going to be moved and then it calls move_par() And here the function moves the element until it reaches 300. Why after this is executed it starts over again? Can you help.? Thanks here is the code Animation animation with js Do you see me moving?
type: Question
has answer: http://stackoverflow.com/a/29853064
tagged with: javascript
has answer: http://stackoverflow.com/a/29853078
has answer: http://stackoverflow.com/a/29853208
has comment: http://stackoverflow.com/comment/47836825
accepted answer: http://stackoverflow.com/a/29853078
answer count: 3
has comment: http://stackoverflow.com/comment/47831923
upvote count: 1
favorite count: 0
type: AnsweredQuestion
has title: What make this code to be execute over and over
downvote count: 0
score: 1
possible better answer: http://stackoverflow.com/a/29853064

http://stackoverflow.com/a/29943975
has comment: http://stackoverflow.com/comment/48093345
has comment: http://stackoverflow.com/comment/48038509
upvote count: 1
has comment: http://stackoverflow.com/comment/48039531
has comment: http://stackoverflow.com/comment/48038860
type: Answer
answers question: http://stackoverflow.com/q/29941825
downvote count: 0
has body: Here is a simple example that set you on your way: $(':checkbox[name=office]').on('change', function() { if( $(':checkbox[value=other]').is(':checked') ) { $('span.other-txt').removeClass( 'hide' ); } else { $('span.other-txt').addClass( 'hide' ); } }); .hide { display: none; } &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"&gt;&lt;/script&gt; Office:&lt;br&gt; &lt;input type="checkbox" name="office" value="singapore"&gt; Singapore&lt;br&gt; &lt;input type="checkbox" name="office" value="kuala lampur"&gt; Kuala Lampur&lt;br&gt; &lt;input type="checkbox" name="office" value="other"&gt; Other &lt;br&gt; &lt;span class="other-txt hide"&gt; &lt;input type="textbox" name="Other_Text"/&gt; &lt;/span&gt;
score: 1

http://stackoverflow.com/comment/47874036
has text: I get it after reading the blogpost. "Ditching DI" is a very wrong way of putting it imo. Not using it where it does not belong is not "ditching".
comment on: http://stackoverflow.com/q/29874315
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47996320
comment on: http://stackoverflow.com/a/29937369
type: Comment
has text: Thanks for the answer. I do now it's not possible now.
type: AnswerComment
score: 0

http://stackoverflow.com/a/29930940
accepted answer of: http://stackoverflow.com/q/29930802
score: 2
has body: Actually, it's because "events" must be a member of "metadata"! So the correct code would be: sap.ui.core.Control.extend("mycontrols.CustomContent", { metadata: { properties: { // etc... }, events: { press: {} } }, // browser Events: ontap: function (oEvent) { this.firePress({}); // -&gt; will work now! } });
upvote count: 2
answers question: http://stackoverflow.com/q/29930802
type: AcceptedAnswer
downvote count: 0
type: Answer

http://stackoverflow.com/comment/48064353
has text: Add `alert(this.responseText);` before your `if(this.responseText == "friend_request_sent")` and compare your results !
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29972255

http://stackoverflow.com/comment/136768174
type: Comment
has text: In a Mongoose schema for a date field, keep in mind that the default value is evaluated once when the schema is compiled. if you use Date.now() as a default value, multiple documents will share the same timestamp. Beacause of this, for unique vaules on "default" you need pass a function.
score: 0
comment on: http://stackoverflow.com/a/29899898
type: AnswerComment

http://stackoverflow.com/q/29905472
linked to: http://stackoverflow.com/q/433907
has answer: http://stackoverflow.com/a/29906546
score: 1
upvote count: 1
type: Question
tagged with: iphone
has comment: http://stackoverflow.com/comment/47934032
has title: iOS App URL Scheme launch application or open app store
has comment: http://stackoverflow.com/comment/47934081
tagged with: ios
tagged with: url-scheme
tagged with: javascript
tagged with: app-store
answer count: 1
downvote count: 0
linked to: http://stackoverflow.com/q/13044805
has comment: http://stackoverflow.com/comment/47934063
favorite count: 0
has body: In iOS App, to launch an application from safari, the URL scheme is something like this, Launch App from URL is it possible to re-direct URL to Appstore pointing to the App if the particular app is not installed in the device, Basically what i am looking If app is already installed then let it be launch from the URL "A" if app is not installed let it point to app store and promot user to download app, there are examples of how to link to app to app store, but not able to add condition in the js when to launch custom URL scheme if app is there, else launch app store. Update : the answer provided and in the comment take me to the page which says how to launch the app store with specific app that's secdonary requirement, initially i need to have some js code which can detect whether the device has an app specific to URL scheme if not then open the App Store app page element
type: UnansweredQuestion

http://stackoverflow.com/q/29995207
upvote count: 6
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29997873
has comment: http://stackoverflow.com/comment/48110786
has answer: http://stackoverflow.com/a/29997679
has body: I have followed this guide on how to send an email using JavaScript with Mandrill, but am receiving this error in my console: Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://mandrillapp.com/api/1.0/messages/send.json. This can be fixed by moving the resource to the same domain or enabling CORS. Here is my code: $('#submitEmail').click(function() { $.ajax({ type: "POST", url: "https://mandrillapp.com/api/1.0/messages/send.json", data: { 'key': 'my_api_key', 'message': { 'from_email': 'test@hotmail.com', 'to': [{ 'email': 'test@gmail.com', 'name': 'RECIPIENT NAME (OPTIONAL)', 'type': 'to' }], 'autotext': 'true', 'subject': 'test', 'html': 'test' } } }).done(function(response) { console.log(response); }); }); What am I doing wrong?
type: Question
tagged with: mandrill
has answer: http://stackoverflow.com/a/38246264
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/38246264
answer count: 3
tagged with: email
downvote count: 0
has answer: http://stackoverflow.com/a/29997873
favorite count: 0
has title: How to send an email with Mandrill using JavaScript?
score: 6

http://stackoverflow.com/comment/47884356
comment on: http://stackoverflow.com/a/29879764
score: 0
type: AnswerComment
type: Comment
has text: @HenrikPetterson can do

http://stackoverflow.com/comment/104385161
has text: A word of caution: This technique works well for "small" arrays but it can be a pain performance and memory-wise if your arrays are huge and are mostly different because _.xor() will keep going waaaay past the first difference. In other words it doesn't return fast on the first difference detected.
type: AnswerComment
comment on: http://stackoverflow.com/a/54788640
type: Comment
score: 9

http://stackoverflow.com/comment/48046143
type: Comment
type: QuestionComment
has text: here's a start http://jsfiddle.net/rb8rnmb1/
comment on: http://stackoverflow.com/q/29962802
score: 0

http://stackoverflow.com/comment/47963442
type: QuestionComment
comment on: http://stackoverflow.com/q/29920727
type: Comment
score: 0
has text: Thanks @epascarello. My perl habits leaking into the code there. Edited.

http://stackoverflow.com/comment/48112799
comment on: http://stackoverflow.com/q/29995748
has text: The css is on an external style sheet, @dev101 The php is before any of the html code, would it be better putting the css in the head of the document to make this work?. @ Artur Filipiak I have changed the php to reflect your suggestion as I accept the logic used, and it has also been mentioned in other responces to this question
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29979555
answer count: 1
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/29979776
score: 6
favorite count: 0
type: UnansweredQuestion
has title: How do I run site-specific user scripts in Safari?
upvote count: 6
has body: I created a javascript user script for one website. I would like that my navigator detect automatically when I am on this website and execute the script. Is it possible to run an injected script on a specific site only?
tagged with: safari
tagged with: navigator
type: Question

http://stackoverflow.com/comment/47895375
comment on: http://stackoverflow.com/a/29884476
score: 0
type: Comment
has text: I know the directives call $apply automatically, but the article I was reading didn't mention anything about listeners in the directive. It looks like Angular attaches event handlers to appropriate inputs which trigger the call to $apply -> $digest in the rootScope and all the subsequent watchers in $$watcher. Basically, I wanted to know that Angular automatically adds event handlers where necessary when using certain directives.
type: AnswerComment

http://stackoverflow.com/comment/47920067
score: 2
has text: Also very easy to go to the jQuery API docs and read all about selectors and since they mostly follow css selector protocols to read up on those too
comment on: http://stackoverflow.com/q/29898485
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29923753
has comment: http://stackoverflow.com/comment/47969340
has comment: http://stackoverflow.com/comment/47969391
score: 0
has comment: http://stackoverflow.com/comment/47969196
type: Answer
has comment: http://stackoverflow.com/comment/47969939
has body: Updated to fix the long-press issue. Problem is simple, you had an event listening for keyup, you specifically gave focus to that element, so it was triggering when user released the key. Update #2: This one should work fully, Ironically, I had to reverse my initial change to execute everything upon element hiding. Try this: var enterPressed = false; var enteredExclusion = false; $(document).ready(function() { $('#edit').hide(); $('#value') .css('cursor', 'pointer') .click(function() { $('#value').hide(); $('#edit').show(); $('#editabletext').focusin(function(e){ enteredExclusion = true; }).focusout(function(e){ enterPressed = false; enteredExclusion = false; }).focus(); }); $('#editabletext') .keydown(function(e){ if (e.keyCode == 13 && !enteredExclusion) { // <enter> console.log('setting true'); enterPressed = true; } }) .keyup(function(e) { enteredExclusion = false; if (e.keyCode == 13 && (enterPressed )) { $('#value').show(); $('#edit').hide(); console.log('setting false - keyup'); enterPressed = false; } }); }); html: hello
answers question: http://stackoverflow.com/q/29923269

http://stackoverflow.com/comment/47993153
has text: Are you sure that your call_juvlon_api function returns a valid JSON ?
score: 1
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29935647

http://stackoverflow.com/q/29990720
has comment: http://stackoverflow.com/comment/48100939
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/3561493
has answer: http://stackoverflow.com/a/29991356
score: 1
has answer: http://stackoverflow.com/a/29990799
type: Question
possible better answer: http://stackoverflow.com/a/29991356
answer count: 2
tagged with: encoding
has body: I think this is a character encoding problem. My javascript search fails to identify a string whenever the string contains certain special characters such as ()* parenthesis, asterisks, and numerals. The javascript is fairly simple. I search a string (str) for the value (val): n = str.search(val); The string I search was written to a txt file using PHP... $scomment = $_POST['order']; $data = stripslashes("$scomment\n"); $fh = fopen("comments.txt", "a"); fwrite($fh, $data); fclose($fh); ...then retrieved with PHP... $search = $_GET["name"]; $comments = file_get_contents('comments.txt'); $array = explode("~",$comments); foreach($array as $item){if(strstr($item, $search)){ echo $item; } } ...and put into my HTML using AJAX... xmlhttp.open("GET","focus.php?name="+str,true); xmlhttp.send(); My HTML is encoded as UTF-8. &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"&gt; The problem is that the when I search() for strings, special characters are not recognized. I didn't really see an option to encode the PHP created text, so I assumed it was UTF-8 too. Is that assumption incorrect? If this is an encoding problem, how do I change the encoding of the txt file written with PHP? If it is caused by the above code, where is the problem?
downvote count: 0
tagged with: javascript
has title: Why is my search() unable to find special characters?
accepted answer: http://stackoverflow.com/a/29990799
tagged with: utf-8
tagged with: string
has comment: http://stackoverflow.com/comment/48100865
favorite count: 0
has comment: http://stackoverflow.com/comment/48101044
upvote count: 1
tagged with: php

http://stackoverflow.com/q/29914212
tagged with: javascript
upvote count: 2
favorite count: 0
has title: How to optimize GC for regular object allocation/deallocation in THREE.js
type: UnansweredQuestion
tagged with: three.js
tagged with: garbage-collection
has body: After many time of research I found that one of the big hurdle in performances in my game was because of the GC's triggers. Thus I spent a lot of time optimizing were I could adding pool. Now the performances are way better but still after some games it starts to GC a lot again. The thing is that from one game to another models are different, there is no memory leak but amount of allocated/freed memory is about 5mb between each game and most is taken by geometry. This is a screenshot on what happens between two game reload ( the models are the same ), ~3-4mb is allocated. I though of different solutions so maybe someone would have a better one or help me choose : Keep everything in memory and reuse the meshes without freeing them ( But then a lot of memory would be taken when switching between several levels ) Create a sort of cache in order to keep in memory only the few last geometries (a mix between freeing all and keeping in memory). In the game you often play the same level several times so it's not that stupid IMHO. Have a better geometry data management. As I did with particles, create a pool where the software can pick up Vectors and Materials instead of creating and deleting new ones each time. For particles it saved me a hell lot of memory alloc/dealloc ( hundred of thousands were allocated/freed at each game ). The thing is that I create myself the pointClouds geometries so I have control for giving them materials and vectors of my own and putting them back in the pool on dispose. However models are using an internal way that's blurry to me at this time. Advantage of this technic as I experienced with the particles is that it's really convenient and transparent to use. Once the background work is done every geometry and/or object created would use the global vector/material/euler/quaternion pools
score: 2
tagged with: memory-management
answer count: 0
type: Question
downvote count: 0

http://stackoverflow.com/q/29888529
tagged with: protractor
score: 1
has body: I know that question was asked in the past in some different forms, but still didn't find the exact answer. I need to find an element inside a repeater and click it. the repeater is a list of apps and I need to find specific app with attribute 'displayName' that equals to specific variable ("appName1" for example). This is the repeater: appName... this is just a part. I need to find app in userApps that it's displayName equals "appName1" for example and click it.
upvote count: 1
answer count: 1
tagged with: javascript
tagged with: end-to-end
favorite count: 0
tagged with: angularjs-ng-repeat
type: AnsweredQuestion
downvote count: 0
has title: protractor click specific element in repeater by binding
type: Question
has answer: http://stackoverflow.com/a/29893015
accepted answer: http://stackoverflow.com/a/29893015
tagged with: testing

http://stackoverflow.com/q/29911486
downvote count: 0
tagged with: xrm
tagged with: javascript
has comment: http://stackoverflow.com/comment/47945016
score: 1
has comment: http://stackoverflow.com/comment/47945722
has comment: http://stackoverflow.com/comment/47948754
favorite count: 0
answer count: 0
has title: Why needs manual refresh for users having role other than administrator role
type: UnansweredQuestion
upvote count: 1
tagged with: dynamics-crm
has comment: http://stackoverflow.com/comment/47945003
type: Question
has body: I have two users one AA with role administrator and other BB with role Other than administrator. DONE following test on same browser - Same Opportunity record - just login users are different For AA >> I close the opp - reopen - CLOSE OPPORTUNITY button appears again - click on CLOSE button work fine For BB >> I close the opp - reopen - CLOSE OPPORTUNITY button appears again - click on CLOSE button but not working. I debugg my js code behind CLOSE OPP button - Xrm.Page.data.getIsValid() return true for user AA I debugg my js code behind CLOSE OPP button - Xrm.Page.data.getIsValid() return false for user BB In case of user BB, if i manually refresh form then every thing works normal. function closeOpportunity(){ ------------------- if (!Xrm.Page.data.getIsValid()) return; ------------------- OpenPopup(); } When I reopen my opportunity then Close Opp button appears in the commandbar/ribbon, when i click Close Opp button it calls a function where Xrm.Page.data.getIsValid() return different value for login user AA and login user BB. Following line of code return true for user AA and return false for user BB Xrm.Page.data.getIsValid() Why? If i refresh my webpage by clicking on refresh icon in the browser window then Xrm.Page.data.getIsValid() also return true for user BB Please help

http://stackoverflow.com/q/29929411
linked to: http://stackoverflow.com/q/22232735
has answer: http://stackoverflow.com/a/29994607
has answer: http://stackoverflow.com/a/45501022
downvote count: 0
has answer: http://stackoverflow.com/a/30071466
favorite count: 0
tagged with: electron
has answer: http://stackoverflow.com/a/49306267
answer count: 9
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/30071466
has answer: http://stackoverflow.com/a/60225620
tagged with: css
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/30031865
accepted answer: http://stackoverflow.com/a/29994607
has answer: http://stackoverflow.com/a/30074928
has title: Disable pinch zoom in webkit (or electron)
has answer: http://stackoverflow.com/a/51403988
type: Question
score: 37
upvote count: 37
tagged with: javascript
tagged with: webkit
has body: Is there any way to disable pinch zoom in an electron app? I can't get it to work from inside the web-view with normal javascript methods as described here: https://stackoverflow.com/a/23510108/665261 It seems the --disable-pinch flag is not supported by electron. I have experimented with various methods using: event.preventDefault() on javascript touchmove/mousemove events meta viewport tags in HTML -webkit-text-size-adjust in CSS flags/config for electron Is there any method either for webkit in general, or electron in particular?
has answer: http://stackoverflow.com/a/62672826

http://stackoverflow.com/a/29879283
has comment: http://stackoverflow.com/comment/47884555
answers question: http://stackoverflow.com/q/29879131
score: 0
has body: If your post content is HTML you will need to change to ng-bind-html: &lt;p ng-bind-html="e.post | to_trusted"&gt;&lt;/p&gt; Also you will need a filter to sanitize: app.filter('to_trusted', ['$sce', function ($sce) { return function (text) { return $sce.trustAsHtml(text); }; }])
type: Answer
has comment: http://stackoverflow.com/comment/47884024

http://stackoverflow.com/q/29848488
has title: Will the script work?
has comment: http://stackoverflow.com/comment/47822916
tagged with: javascript
tagged with: jquery
score: -1
has answer: http://stackoverflow.com/a/29848624
downvote count: 2
has answer: http://stackoverflow.com/a/29848580
upvote count: 1
favorite count: 0
has body: Will this code work? I need to hide h2 with .hide class after clicking #idAnchor link. New users: .... More users
has comment: http://stackoverflow.com/comment/47822913
has answer: http://stackoverflow.com/a/29848573
answer count: 4
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29848579
has comment: http://stackoverflow.com/comment/47824755
accepted answer: http://stackoverflow.com/a/29848579
type: Question
possible better answer: http://stackoverflow.com/a/29848573
has comment: http://stackoverflow.com/comment/47824349

http://stackoverflow.com/comment/47859003
type: Comment
comment on: http://stackoverflow.com/a/29867037
has text: @patatopeelings +1 for the effort , I'll go through ur answer , a huge thank you !
type: AnswerComment
score: 0

http://stackoverflow.com/comment/48016282
type: AnswerComment
has text: @SpringheeledJack No, you don't.
type: Comment
comment on: http://stackoverflow.com/a/29947618
score: 0

http://stackoverflow.com/comment/48046788
score: 0
type: Comment
type: QuestionComment
has text: IMO json is a better solution for scalability of your application.
comment on: http://stackoverflow.com/q/29963009

http://stackoverflow.com/q/29996030
has title: Create correct path by concatenating LTR with RTL strings
has answer: http://stackoverflow.com/a/29996234
tagged with: javascript
score: 0
tagged with: filesystemobject
linked to: http://stackoverflow.com/q/29988144
answer count: 1
accepted answer: http://stackoverflow.com/a/29996234
has body: I'm facing a problem in creating correct path by concatenating Arabic folder name with English folder name, the concatenate function seems to work fine if I print the path using document.write(path) which show the correct path but if I pass it to fso.CopyFile(..) I got exception about incorrect path. function wrap_dir(dir, str) { if (dir === 'rtl') return '\u202B' + str + '\u202C'; return '\u202A' + str + '\u202C'; } function Copy(){ var a = 'english' var b = 'أ.ب-000082-13' var c = '000004-ر خ-2014.xml' var strPath = wrap_dir('ltr', '\\\\') + wrap_dir('ltr', a) + wrap_dir('ltr', '\\') + wrap_dir('rtl', b) + wrap_dir('ltr', '\\') + wrap_dir('ltr', c); // "‪english‬‪\‬‫أ.ب-000082-13‬‪\‬‪000004-ر خ-2014.xml‬" var fso = new ActiveXObject("Scripting.FileSystemObject"); fso.CopyFile(strPath, to, 1); } The strPath variable is "‪\\english‬‪\‬‫أ.ب-000082-13‬‪\‬‪000004-ر خ-2014.xml‬" which is correct path. To make sure that the path is correct I passed that path as a hard code to fso.CopyFile and it worked fine.
tagged with: internationalization
type: AnsweredQuestion
type: Question

http://stackoverflow.com/comment/47868896
type: Comment
type: QuestionComment
has text: Do you subscribe to the users? All the Meteor.calls are async. So use callback handlers. And don't expose the Meteor methods to the client.
score: 0
comment on: http://stackoverflow.com/q/29870127

http://stackoverflow.com/q/29947983
downvote count: 0
favorite count: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/38038212
upvote count: 3
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/48017028
has comment: http://stackoverflow.com/comment/48017172
has answer: http://stackoverflow.com/a/29948075
score: 3
has comment: http://stackoverflow.com/comment/63516160
tagged with: javascript
has title: How do I gracefully load a specific localization file dynamically in AngularJS?
has comment: http://stackoverflow.com/comment/48017398
type: Question
has comment: http://stackoverflow.com/comment/48017084
answer count: 2
has body: Currently, I have a system which has language codes such as en, de, jp and so on. I need to provide localisation for 8 languages, so it works if I manually add in the script file here: &lt;script src='/js/locale/angular-locale_de.js'&gt;&lt;/script&gt;. But I need to be able to load it dynamically in the header. I tried using a jQuery hack using ("head").append() but on Chrome throws an error says ASYNC request deprecated.
linked to: http://stackoverflow.com/q/23656231

http://stackoverflow.com/a/29965601
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/48064861
has comment: http://stackoverflow.com/comment/48077690
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29959115
has body: Change you HTML to @Html.LabelFor(model => model.FechaHasta, new { @class = "col-sm-2 control-label" }) @Html.EditorFor(model => model.FechaHasta, new { htmlAttributes = new { @class = "form-control" } }) @Html.ValidationMessageFor(model => model.FechaHasta) and add CSS like so .form-group.has-feedback > .form-control-feedback { display: none; } .form-group.has-success.has-feedback > .form-control-feedback.glyphicon-ok { display: block; } .form-group.has-warning.has-feedback > .form-control-feedback.glyphicon-warning-sign { display: block; } .form-group.has-error.has-feedback > .form-control-feedback.glyphicon-remove { display: block; } You might have to play around with the HTML a bit - I wasn't sure that .icon was for and I removed it. Also, wasn't sure what your styling for the .help-block was. Anyway what happens is that adding the classes .has-warning, .has-error, or .has-success to the form-group (via your validation script) shows the appropriate icon.
score: 1
answers question: http://stackoverflow.com/q/29959115

http://stackoverflow.com/a/29951652
has body: You have two questions here, so I will try to address both 1) How to append to the DOM using jQuery, instead of an alert: in the success callback function, instead of alerting the response, you can simply call $('body').append("&lt;div&gt;"+response+"&lt;/div&gt;") 2) "Real time" Gold Balance You should use websockets. Racthet is a good websocket PHP library to help you with this: http://socketo.me/
has comment: http://stackoverflow.com/comment/48025378
type: Answer
answers question: http://stackoverflow.com/q/29951417
score: 0

http://stackoverflow.com/comment/48113237
type: QuestionComment
score: 1
has text: There's a plugin for Sublime Text that provides some snippets and autocompletion: https://packagecontrol.io/packages/D3.js%20Snippets
comment on: http://stackoverflow.com/q/29996839
type: Comment

postback
tag name: postback
type: Tag
tags question: http://stackoverflow.com/q/29856267

http://stackoverflow.com/comment/47841685
comment on: http://stackoverflow.com/q/29857625
type: Comment
type: QuestionComment
score: 0
has text: @vihan1086 - `$(window).load(function(){` worked! Put it in an answer and I'll give you some rep.

http://stackoverflow.com/q/29926821
upvote count: 21
has answer: http://stackoverflow.com/a/29927083
has body: Is possible to inject a controller into another controller that is part of the same module? example: var app = angular.module('myAppModule', []) .controller('controllerOne', ['$scope', function($scope){ $scope.helloWorld = function(){ return 'Hello World'; } }]) .controller('controllerTwo', ['$scope', 'controllerOne', function($scope, controllerOne){ console.log(controllerOne.helloWorld()); }]) I keep getting unknown provider on controllerOne. I don't see how that's possible since they coexist in the same module. Any help would be much appreciated.
type: Question
accepted answer: http://stackoverflow.com/a/29927130
type: AnsweredQuestion
tagged with: dependency-injection
score: 21
possible better answer: http://stackoverflow.com/a/29927083
tagged with: angularjs-controller
has comment: http://stackoverflow.com/comment/47977185
tagged with: angularjs-scope
linked to: http://stackoverflow.com/q/9293423
has title: AngularJS: Inject controller inside another controller from the same module
linked to: http://stackoverflow.com/q/21919962
downvote count: 0
linked to: http://stackoverflow.com/q/45206840
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/29927114
has answer: http://stackoverflow.com/a/29927130
answer count: 4
has answer: http://stackoverflow.com/a/29927233
tagged with: angularjs
has comment: http://stackoverflow.com/comment/47975420

http://stackoverflow.com/q/29994850
has title: Change AJAX url with a variable inside success function?
score: -1
has body: I have an AJAX call that I need to loop over to achieve pagination. I want to grab a value during each run from the success function, stick it back in the URL that AJAX is pulling and then run the next loop. How can I change the AJAX url based on something I can find in the success data? EDIT: Sorry for the lack of example. Here's my function as is now... for (var i=0; i &lt; 8; i++) { $.ajax({ 'url': 'https://someurl.com?paramone=xxx, timeout: 8000, 'success': function(data) { //do something with data } I'd like to change paramone's value each time through the loop
type: Question
has comment: http://stackoverflow.com/comment/48109507
upvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/48184956
type: UnansweredQuestion
downvote count: 1
has answer: http://stackoverflow.com/a/29994895

http://stackoverflow.com/a/29880422
has body: Use the absolute path. Your absolute path is the actual location on the server. An easy way to find it is look at the path you're connecting to with ftp. It might look something like this /home/username/public_html/Core/js.php
score: 0
answers question: http://stackoverflow.com/q/29880282
type: Answer
has comment: http://stackoverflow.com/comment/47885137
has comment: http://stackoverflow.com/comment/47885011
has comment: http://stackoverflow.com/comment/47885185

http://stackoverflow.com/comment/48277378
comment on: http://stackoverflow.com/a/30079577
score: 0
type: Comment
has text: Excellent Idea but did not yield results.
type: AnswerComment

http://stackoverflow.com/comment/48053757
score: 0
comment on: http://stackoverflow.com/q/29966811
type: Comment
type: QuestionComment
has text: I'm not surprised, it is long-winded and non-trivial. You might want to just look at the [Naive Approach](http://perfectionkills.com/how-ecmascript-5-still-does-not-allow-to-subclass-an-array/#naive_approach) which seems to be equivalent to what you're attempting to achieve

http://stackoverflow.com/q/29856581
has comment: http://stackoverflow.com/comment/47865894
tagged with: jquery
has comment: http://stackoverflow.com/comment/47875677
type: UnansweredQuestion
has body: I use a big European map as SVG on a page on my Wordpress website. When I insert it as &lt;img src="mysvg"&gt; all things work properly, but I can't use jQuery with the svg paths. jQuery works fine when I insert the &lt;svg&gt; tag directly, but because it's quite huge, about 386 lines of code, my wordpress crashes when I publish the page. How can I fix this issue? Is there a way to have a shorter path coordinates?
has title: Large SVG picture causes page to crash
tagged with: http://stackoverflow.com/tag/svg
answer count: 0
score: 0
tagged with: wordpress
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/47852735
has comment: http://stackoverflow.com/comment/47839442

http://stackoverflow.com/comment/47855368
type: Comment
comment on: http://stackoverflow.com/a/29864992
score: 0
type: AnswerComment
has text: ok, Are you getting "carousel started" on the console and no errors printing there? Also can you try adding this as one of the settings `infinite: true`

http://stackoverflow.com/comment/86025017
has text: This is the current status of iOS for the record: https://webkit.org/blog/6784/new-video-policies-for-ios/
comment on: http://stackoverflow.com/a/29919305
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/48027098
type: AnswerComment
comment on: http://stackoverflow.com/a/29907618
type: Comment
has text: Ah maybe `Services.appShell.hiddenDOMWindow` is only solution pre FF36 then huh?
score: 0

http://stackoverflow.com/comment/47917316
type: AnswerComment
comment on: http://stackoverflow.com/a/29896135
score: 0
type: Comment
has text: Yes its slidingUp my model-header element by adding inline style"display:none". I am not able to trace it. Is there any way we can trace ELement changes via javascript? Is they anyfirebug trick so we can watch this element. Because I am not adding so. Main thing is, it first open the ModelBox properly then close the model-header element.

http://stackoverflow.com/a/30116206
upvote count: 1
answers question: http://stackoverflow.com/q/29973440
score: 1
downvote count: 0
has body: I think you will need to use the additional options: timeline: { groupByRowLabel: false } Because, if you go to the g-page: https://google-developers.appspot.com/chart/interactive/docs/gallery/timeline#BarsOneRow in the Bars in One Row section they show how Presidents DON'T overlap, so you can't use it in this case, but for the method you are using it, timelines do overlap so they must be in their own row. It would probably be hard to read overlapping titles anyhow. Side note: I noticed what google is doing. It's assigning the colors left to right, then wrapping. The titles however, are not wrapping, they just go left to right. Here is a fiddle I made: https://jsfiddle.net/camp185/2Lopnnt3/2/ to show how wrapping of colors working...added more colors.
has comment: http://stackoverflow.com/comment/48371789
type: Answer

http://stackoverflow.com/comment/47827098
comment on: http://stackoverflow.com/q/29849959
has text: It would, thanks for clearing that up @AlvaroMontoro
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29912800
answer count: 1
tagged with: facebook-javascript-sdk
has answer: http://stackoverflow.com/a/29912850
type: UnansweredQuestion
tagged with: facebook
score: -1
has body: I am trying to create event via my website.I am not getting any response while post event. Below is my code <fb:name uid='loggedinuser' useyou='false'></fb:name> <fb:name uid='loggedinuser' useyou='false'></fb:name> <!-- USE 'Asynchronous Loading' version, for IE8 to work http://developers.facebook.com/docs/reference/javascript/FB.init/ <script type="text/javascript" src="<%=path%>/js/socialNetwork.js"> --> I am getting the response.id as invalid. So because of that i think event is not created on my FB wall.. Can someone please help me on this.
has title: Post Facebook event via javascript SDK, not getting any response
downvote count: 1
type: Question
upvote count: 0
tagged with: javascript
favorite count: 0

http://stackoverflow.com/q/29897612
tagged with: codeigniter
has comment: http://stackoverflow.com/comment/47918164
type: Question
has body: var PId = 12; var catId = 3; var Param = 'productid='+PId+'&amp;CatId='+catId; var encriptedCode = '&lt;?php echo $this-&gt;encrypt-&gt;encode( .... need to pass the Param .... );?&gt;'; I am trying to pass the javascript value into php method, whatever i am trying it's not working. Any one help me to detect where i am wrong. using this code in time of ajax call
tagged with: encoding
tagged with: javascript
has title: passing javascript value into php methods
has comment: http://stackoverflow.com/comment/47918080
score: 0
answer count: 3
has comment: http://stackoverflow.com/comment/47917845
has answer: http://stackoverflow.com/a/29897705
has comment: http://stackoverflow.com/comment/47917914
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29897861
tagged with: php
has answer: http://stackoverflow.com/a/29898020

http://stackoverflow.com/comment/47953404
has text: That may be the case. I saw people **use k-means to predict data**. Assuming you are right... What can I do to make a prediction on that value?
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29913327
type: Comment

http://stackoverflow.com/q/29876578
has body: I have C# page with 2 functions - 1 to get data from my MSSQL database, and the second one to insert data into it. I want to know how to use AJAX (or any other way?) to call this functions from JS file. For one of the functions i only need to get data back, for the other one i need to send data from the JS to the C# functions..
tagged with: c#
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29876655
downvote count: 3
score: -3
type: Question
linked to: http://stackoverflow.com/q/10653637
upvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: ajax
accepted answer: http://stackoverflow.com/a/29876655
has comment: http://stackoverflow.com/comment/47877448
has comment: http://stackoverflow.com/comment/47877462
has title: How can i call c# functions from JS?

http://stackoverflow.com/a/29875854
upvote count: 1
has comment: http://stackoverflow.com/comment/47940243
answers question: http://stackoverflow.com/q/29875532
has comment: http://stackoverflow.com/comment/47881068
has body: If you send it as get, you need to put formula into request. This expression: req.send(data2); doesn't make sense when you send GET request, as GET request cannot contain any payload except in request string. So you have to add payload to your url. Something like this: var url = "Validator/?" + data2; req.open("GET", url, true); req.onreadystatechange = inserter2; req.send(); Hope that helps.
downvote count: 0
type: Answer
score: 1

http://stackoverflow.com/comment/47939109
has text: @user3818928: Alternatively, you can use a boolean flag (`var allfine = true`), set that to `false` when any of the properties is wrong, and then check the flag afterwards.
score: 1
comment on: http://stackoverflow.com/a/29908291
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/47935547
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29900398
has text: Try cloning the original path clone(), set a very low opacity, and add a large strokeWidth and adding the click handler to that ?
score: 0

http://stackoverflow.com/comment/47991007
score: 0
type: Comment
has text: thanks for your effort...but this time nothing is added to the database..and no error message in earlier stages
type: AnswerComment
comment on: http://stackoverflow.com/a/29934405

http://stackoverflow.com/comment/47910581
type: Comment
type: QuestionComment
has text: u can use stateChangeSuccess event
comment on: http://stackoverflow.com/q/29892919
score: 0

http://stackoverflow.com/q/29866583
type: Question
answer count: 2
downvote count: 2
score: -2
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29866919
has answer: http://stackoverflow.com/a/29866657
has title: Dynamically show text depending on form result
favorite count: 0
upvote count: 0
has body: I've got a simple form, which looks like this: Team 1 &lt;input type='button' value='-' class='qtyminus' field='quantity' /&gt; &lt;input type='text' name='quantity' value='0' class='qty' readonly /&gt; &lt;input type='button' value='+' class='qtyplus' field='quantity' /&gt; Team 2 &lt;input type='button' value='-' class='qtyminus' field='quantity2' /&gt; &lt;input type='text' name='quantity2' value='0' class='qty' readonly /&gt; &lt;input type='button' value='+' class='qtyplus' field='quantity2' /&gt; When one of Teams has set number 3 I want to appear that team's name dynamically below. Something like "Team1/Team 2 is the winner!". And when I change the number next to the name of team, I want the text "Team1/Team2 is the winner!" to disappear.
type: UnansweredQuestion

http://stackoverflow.com/a/29876199
has comment: http://stackoverflow.com/comment/66361735
answers question: http://stackoverflow.com/q/29875869
score: 12
downvote count: 0
has body: I figured out a new solution. Do note that I am using ES6 modules so I am requiring the class. You could also define a new React class instead. var components = { example: React.createFactory( require('./ExampleComponent') ) }; var type = "example"; newComponent() { return components[type]({ attribute: "value" }); }
type: Answer
upvote count: 12

http://stackoverflow.com/comment/48037404
comment on: http://stackoverflow.com/a/29957631
score: 0
has text: And how is that better or simpler than what the OP already has?
type: AnswerComment
type: Comment

http://stackoverflow.com/a/29931153
has body: In handlebars, the expression cannot contain other expressions. You'd better prepare your data before sending to Handlebars, like you did to the name: var data = { users: [ { person: { firstName: "Garry", lastName: "Finch" }, job: { title: "Front End", position: "Team Lead" }, twitter: "gazraa" } ] }; This way, you can create a helper, like you did to the person's name, and concat both values. Handlebars.registerHelper('fullJob', function(job) { return job.title + " " + job.position; });
type: Answer
score: 0
answers question: http://stackoverflow.com/q/29929744

http://stackoverflow.com/comment/47919891
has text: My recommendation would be to get rid of the ng-show set it to style='display:none' then use .show() and .hide().
type: Comment
comment on: http://stackoverflow.com/q/29897555
type: QuestionComment
score: 1

http://stackoverflow.com/q/29858896
type: AnsweredQuestion
score: 1
upvote count: 1
has title: Passing arguments that are just getting created
accepted answer: http://stackoverflow.com/a/29858997
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/47844678
tagged with: express
tagged with: anonymous-function
tagged with: function
answer count: 1
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/29858997
has comment: http://stackoverflow.com/comment/47843788
has comment: http://stackoverflow.com/comment/47843865
has body: I am making a NodeJS/Express listener and have inputs which are being created as my connectListener is being made: app.get('/server/:args', function(req, res) { res.sendFile(__dirname + '/index.html'); // ... var args = req.param("args"); var client = net.connect({port : 50505}, connectListener(args, client)); }); Then I have my connectListener function: function connectListener(args, client) { console.log("Connected to server."); console.log(args); client.write(args); // .... } However, I get an error that the arguments are undefined: TypeError: Cannot read property 'write' of undefined at connectListener (C:\Users\ES\workspace_luna\WptHash\server-src\index.js:39:8) at C:\Users\ES\workspace_luna\WptHash\server-src\index.js:33:43 at Layer.handle [as handle_request] (C:\Users\ES\workspace_luna\WptHash\server-src\node_modules\express\lib\router\layer.js:82:5) at next (C:\Users\ES\workspace_luna\WptHash\server-src\node_modules\express\lib\router\route.js:100:13) at Route.dispatch (C:\Users\ES\workspace_luna\WptHash\server-src\node_modules\express\lib\router\route.js:81:3) at Layer.handle [as handle_request] (C:\Users\ES\workspace_luna\WptHash\server-src\node_modules\express\lib\router\layer.js:82:5) at C:\Users\ES\workspace_luna\WptHash\server-src\node_modules\express\lib\router\index.js:235:24 at param (C:\Users\ES\workspace_luna\WptHash\server-src\node_modules\express\lib\router\index.js:332:14) at param (C:\Users\ES\workspace_luna\WptHash\server-src\node_modules\express\lib\router\index.js:348:14) at Function.proto.process_params (C:\Users\ES\workspace_luna\WptHash\server-src\node_modules\express\lib\router\index.js:392:3) Error: Can't set headers after they are sent. at SendStream.headersAlreadySent (C:\Users\ES\workspace_luna\WptHash\server-src\node_modules\express\node_modules\send\index.js:313:13) at SendStream.send (C:\Users\ES\workspace_luna\WptHash\server-src\node_modules\express\node_modules\send\index.js:494:17) at onstat (C:\Users\ES\workspace_luna\WptHash…
tagged with: node.js

http://stackoverflow.com/q/29931582
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29931659
has answer: http://stackoverflow.com/a/29931984
type: UnansweredQuestion
has title: show content not defined
type: Question
score: 0
answer count: 2
has body: I'm trying to implement a show more & show less. When executing this code I get and error "Show content not defined" can't pick up. What am I missing? heading Show content goes here hide
upvote count: 1
downvote count: 1
tagged with: javascript

http://stackoverflow.com/a/30004837
downvote count: 0
score: 1
has body: Instead of having 1 video element and changing the src, use 2 video elements that are layered on top of each other using z-index. When you want to switch, pause the current video element, wait for the second video element to load (listen for the loadeddata/canplay/canplaythrough events). Then swap z-indexes so the next video element is on top and then play the second video element.
has comment: http://stackoverflow.com/comment/48385727
type: AcceptedAnswer
upvote count: 1
accepted answer of: http://stackoverflow.com/q/30001141
answers question: http://stackoverflow.com/q/30001141
type: Answer

http://stackoverflow.com/a/29905814
answers question: http://stackoverflow.com/q/29904828
score: 0
has body: I haven't tested this but it should get you the background color from inside the iframe. window.parent.document.getElementById('framed-lead-form').style.backgroundColor
type: Answer

http://stackoverflow.com/a/29925710
answers question: http://stackoverflow.com/q/29925679
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/47993879
type: Answer
has comment: http://stackoverflow.com/comment/47974546
score: 1
has comment: http://stackoverflow.com/comment/48042383
upvote count: 1
has body: If it's inline scripts, put all code in external js file and use that. If you are including lot of js files(even though its just fine to do so), use a build tool like Grunt to concatenate all the js files if you dont want too many of them. They will put all the code in one js file which you can include at the end.
accepted answer of: http://stackoverflow.com/q/29925679

http://stackoverflow.com/a/29936169
score: 0
answers question: http://stackoverflow.com/q/29935094
type: Answer
has body: simple. HTML &lt;input type="button" value="Open Windows" onclick="openWin()"&gt; JS for (var i =0; i&lt;2; i++){ window.open("http://www.google.com/"); } } You should also know that window.open is sometimes blocked by popup blockers and/or ad-filters.So you need to change permission to allow the popup blocker. And additional information : This approach also places a dependency on JavaScript being enabled. Not typically a good idea, but sometimes necessary.

http://stackoverflow.com/a/29905585
score: 0
answers question: http://stackoverflow.com/q/29905394
type: Answer
has body: Yeah that looks fine. The watcher will call onSuccess when the GPS has been successfully polled, and returns data. I would save the Longitude and Latitude in the global scope, and then you can perform what ever kind of logic you want on it.
has comment: http://stackoverflow.com/comment/47970011

http://stackoverflow.com/q/29934274
type: UnansweredQuestion
upvote count: 1
has answer: http://stackoverflow.com/a/29934306
downvote count: 1
type: Question
answer count: 2
tagged with: javascript
score: 0
has title: How to calculate a constant tax rate?
has answer: http://stackoverflow.com/a/29934310
favorite count: 0
has body: This is the problem that I need to resolve. Create a basic webpage that includes an input form. JavaScript is to be embedded into your HTML document. The input form should include: Field for user name input Field for order quantity input Read only field for item price – set to a value of 5.31 Read only field for order total cost “submit button” that does NOT use any type of form button element User should be able to input their name and order quantity, then click “submit”. When “submit” is clicked, form will calculate an order total, including sales tax of 8.25%. Once calculated, the order total form field is to be updated with a total, including dollar sign and two decimal places. An alert box should also be triggered stating the users name and a message indicating the order total including sales tax. Be SURE to test with your own sample data to verity your calculations are correct. I did the html and javascript but I can't calculate the const TAXRATE OF 8.25. The Item cost 5.31 and when the tax is included in the total, is huge amount calculated. Thanks for your help in advance. Please check my script here: Lesson #2 - Sample Page Name Widget order quantity Widget cost Order Total Process Order

http://stackoverflow.com/comment/47983351
has text: I'm guessing you have to use a custom cell to show multiple pieces of information
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29917173
score: 0

http://stackoverflow.com/q/29850717
has comment: http://stackoverflow.com/comment/47829697
has comment: http://stackoverflow.com/comment/47828725
has comment: http://stackoverflow.com/comment/47827913
has comment: http://stackoverflow.com/comment/47827896
has comment: http://stackoverflow.com/comment/47828250
score: 2
accepted answer: http://stackoverflow.com/a/29851319
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47828410
has comment: http://stackoverflow.com/comment/47828604
has body: I am trying to determine the actual height of the browser in relationship to the screen height in jQuery. For some reason, the readings are far from accurate and I'd like to know why. Basically the issue I'm having is that The window.innerHeight and window.outerHeight are always exactly the same even though the tabs bar is being shown and there is an obvious (visual) difference between the 2... Each of the readings above are always smaller than screen.height and screen.availHeight. I was under the impression that this should not be the case if the browser is maximized vs full screen vs sized vs minimized? My requirement is to change the class of an element on the window.scroll event when that element reaches the top of the browser viewport. However, I am also mandated to change to a different class if the browser window is sized instead of maximized or full screen. Here's the code that performs this operation however, like I mentioned above, the "maximized" if statement is never true... why? function SetFloatingDivCheck(ContainerName, StartingClassName, FixedClassNameSized, FixedClassNameMaximized) { $(document).ready(function () { var ElemY = $('#' + ContainerName).offset().top - parseFloat($('#' + ContainerName).css('margin-top').replace(/auto/, 0)); $(window).scroll(function () { var YPosition = $(window).scrollTop(); if (YPosition &gt;= ElemY) { $('#' + ContainerName).removeClass(StartingClassName); //the following alert/debug shows this: 1050, 949, 949, 1010 when fired. //alert("screen.height = " + screen.height.toString() + "\nwindow.innerHeight = " + window.innerHeight.toString() + "\nwindow.outerHeight = " + window.innerHeight.toString() + "\n screen.availHeight = " + screen.availHeight.toString()); if (screen.height == window.outerHeight || screen.availHeight == window.outerHeight) { $('#' + ContainerName).addClass(FixedClassNameMaximized); } else { $('#' + ContainerName).addClass(FixedClassNameSized); } } else { $('#' + ContainerName).removeClass(FixedClas…
has comment: http://stackoverflow.com/comment/47828007
has comment: http://stackoverflow.com/comment/47828190
type: Question
has comment: http://stackoverflow.com/comment/47828037
has comment: http://stackoverflow.com/comment/47828644
has comment: http://stackoverflow.com/comment/47828113
has comment: http://stackoverflow.com/comment/47828087
has comment: http://stackoverflow.com/comment/47827782
has comment: http://stackoverflow.com/comment/47828141
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47827957
has title: jQuery browser height is not accurate
has answer: http://stackoverflow.com/a/29851319
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/47828404
favorite count: 0
has comment: http://stackoverflow.com/comment/47827849
upvote count: 2
has comment: http://stackoverflow.com/comment/47828706

http://stackoverflow.com/comment/47880731
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29878310
has text: So, now your code isn't working?
type: Comment

http://stackoverflow.com/q/29974320
type: UnansweredQuestion
has title: Delay div visibility until font has finished loading
has body: How can I determine if a font has finished loading? I can use the ideas from this question to delay displaying the div in question, but how can i know when the font is available? I wish to delay displaying a div until the font used has finished loading. The current effect is that the words display in font A, then abruptly change into font B. jsFiddle demo (of the undesirable effect)
has comment: http://stackoverflow.com/comment/48069107
linked to: http://stackoverflow.com/q/12312323
downvote count: 0
has answer: http://stackoverflow.com/a/29974394
score: 1
tagged with: jquery
favorite count: 0
type: Question
tagged with: http://stackoverflow.com/tag/html
tagged with: css
linked to: http://stackoverflow.com/q/22095529
tagged with: fonts
upvote count: 1
answer count: 1
tagged with: javascript

http://stackoverflow.com/a/29971602
answers question: http://stackoverflow.com/q/29971024
has comment: http://stackoverflow.com/comment/48065003
accepted answer of: http://stackoverflow.com/q/29971024
downvote count: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/48064408
upvote count: 2
type: Answer
score: 2
has body: The problem is that the DOM isn't fully loaded when your code is being called. You can delay it by doing the following mainController=function($scope){ angular.element(document).ready(function () { var opts={valueNames: ['id'] } $scope.theList=new List('theList', opts); }); }

http://stackoverflow.com/comment/47960340
score: 2
has text: Please show your current attempts, if any.
comment on: http://stackoverflow.com/q/29919596
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/48094206
type: AnswerComment
has text: @TrueBlueAussie No I didn't talk about your first answer, but about your edit.
type: Comment
comment on: http://stackoverflow.com/a/29984891
score: 0

http://stackoverflow.com/a/29861490
score: 3
has comment: http://stackoverflow.com/comment/47858928
answers question: http://stackoverflow.com/q/29861416
upvote count: 3
has body: This style is not used because it's faster to work with since more typing is needed to access the variables, consider constants.const1 instead of just typing const1. However, I like the style for at least these reasons: The variables are 'scoped'(so there's less possibility of a global collision) They are semantically encapsulated where they belong - which gives an explanation into which group they belong - It's easier for another dev who picks this up to make meaning of what those variables are They are easier to work with - If you want to capture all the properties of a group - e.g consider the object is department, you just iterate over the department which has all the relevant info you need The DOM objects might be a little unnecessary to be put within an object, as for the rest I fully agree into wrapping them in an object like that.
type: Answer
downvote count: 0

http://stackoverflow.com/comment/48014522
has text: I dont think you want to apply the filter every time it changes, would change the users input before he actually had finished typing the value.
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29946539

http://stackoverflow.com/q/29869700
tagged with: javascript
has comment: http://stackoverflow.com/comment/47878633
has comment: http://stackoverflow.com/comment/47886693
tagged with: chaining
has comment: http://stackoverflow.com/comment/47881475
has title: Angularjs chaining promises: propagation of notify vs resolve
tagged with: promise
tagged with: angularjs
linked to: http://stackoverflow.com/q/23803743
has comment: http://stackoverflow.com/comment/47864767
has comment: http://stackoverflow.com/comment/47865386
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47881390
has comment: http://stackoverflow.com/comment/47881503
has comment: http://stackoverflow.com/comment/47865099
answer count: 0
score: 0
has comment: http://stackoverflow.com/comment/47911028
has comment: http://stackoverflow.com/comment/47881448
has comment: http://stackoverflow.com/comment/47896429
type: Question
has body: I am trying to chain 3 promises. I find that if I resolve promise1, I get the result in the promise2's success callback and I can control what and if I need to send anything to promise3. But if I issue a notify in promise1, not matter what I do in promise2, the promise3's notifyCallback ALWAYS get triggered immediately. How can I prevent it and make it conditional based on some business rules in promise2 ? Here is a simple example in jsfiddle: http://jsfiddle.net/deepfiddle/rxv8322s/ If you issue .notify() instead of .resolve() (uncomment/comment the line in promise1), you will see what promise3 gets notified immediately. Here is the relevant code: var myApp = angular.module('myApp', []); myApp.controller('myCtrl', function($scope, $q, $timeout) { console.log("--app controller"); var p0 = $q.when(); p0 .then( //Promise: p1 function(result) { console.log("p1", result); var deferred = $q.defer(); $timeout(function() { console.log("in timeout of p1"); //Note1: Propagation of resolve can be controlled but not notify // Uncomment notify instead to see the difference on the console deferred.resolve("p1 resolved by timeout 2000"); //deferred.notify("p1 notified by timeout 2000"); }, 2000); return deferred.promise; } ) .then(//Promise: p2 function(result) { console.log("p2-onsuccess:", result); var deferred = $q.defer(); $timeout(function() { console.log("in timeout of p2"); deferred.resolve("p2 resolved by timeout 2000"); }, 2000); return deferred.promise; }, null, function(result) { //Note2: Unable to prevent propagation of p1.notify() to p3 console.log("p2-onnotify:", result); var deferred = $q.defer(); $timeout(function() { console.log("in timeout of p2"); deferred.notify("p2 notified by timeout 2000"); }, 2000); return deferred.promise; } ) .then(//Promise:p3 function(result) { console.log("p3-onsuccess:", result); }, null, function(result) { console.log("p3-onnotify:", result); } ) });
has comment: http://stackoverflow.com/comment/47896524
linked to: http://stackoverflow.com/q/16335597

http://stackoverflow.com/comment/47989603
type: AnswerComment
comment on: http://stackoverflow.com/a/29933598
type: Comment
score: 3
has text: replace setTimeout to $timeout would make more sense

http://stackoverflow.com/q/29928807
answer count: 2
has title: D3 Line Graph with JSON Data in ISO 8601 Format
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/29929622
favorite count: 0
upvote count: 2
tagged with: d3.js
possible better answer: http://stackoverflow.com/a/29929551
has answer: http://stackoverflow.com/a/29929551
type: AnsweredQuestion
score: 2
accepted answer: http://stackoverflow.com/a/29929622
tagged with: http://stackoverflow.com/tag/json
type: Question
has body: I am trying to graph the JSON data. I am new to js and d3. I'm able to format the ISO 8601 dates on the x-axis, but I cannot get the line to show up. The y-axis and x-axis are showing up just fine. I keep getting an error that says: "Error: Invalid value for attribute d="MNaN,-708.1292215027511LNaN." I THINK the issue has to do with binding my data points to the axis. I'd like to use the date at x-axis and Processor as my y-axis. Please let me know if you have any suggestions that will help my line ("path") show up. Any explanations about how to deal with ISO 8601 dates would also be very helpful. Thanks!! &lt;script&gt; //JSON data for graph var data = [ { "date": "2015-04-01T00:00:00", "Logon": "1535.000000", "ServerExport": "704.000000", "Processor": "15.268909", "AdminLogon": "1731.000000" }, { "date": "2015-04-01T00:10:00", "Logon": "1995.000000", "ServerExport": "630.000000", "Processor": "15.585726", "AdminLogon": "1951.000000" }, { "date": "2015-04-01T00:20:00", "Logon": "1946.500000", "ServerExport": "653.500000", "Processor": "10.585794", "AdminLogon": "1903.500000" }, { "date": "2015-04-01T00:30:00", "Logon": "1851.500000", "ServerExport": "650.500000", "Processor": "5.999048", "AdminLogon": "1830.000000" }, { "date": "2015-04-01T00:40:00", "Logon": "1732.500000", "ServerExport": "685.000000", "Processor": "10.097523", "AdminLogon": "1864.000000" }, { "date": "2015-04-01T00:50:00", "Logon": "1622.000000", "ServerExport": "664.500000", "Processor": "7.387592", "AdminLogon": "1757.000000" }, { "date": "2015-04-01T01:00:00", "Logon": "995.000000", "ServerExport": "508.500000", "Processor": "8.683075", "AdminLogon": "1438.000000" }, { "metricDate": "2015-04-01T01:10:00", "Logon": "1416.666666", "ServerExport": "723.000000", "Processor": "12.205153", "AdminLogon": "1721.500000" }, { "date": "2015-04-01T01:20:00", "Logon": "1245.500000", "ServerExport": "631.500000", "Processor": "14.483815", "AdminLogon": "1661.500000" }, { "date": "2015-04-01T01:30:00", "Logo…

http://stackoverflow.com/q/29935376
accepted answer: http://stackoverflow.com/a/29935509
has body: Why I can use ng-bind outside of ng-app and ng-controller when using $rootScope.variable? faraWorkspaceApp.run(function ($rootScope, $location, $state) { $rootScope.$on('$stateChangeSuccess', function (e, toState, toParams , fromState, fromParams) { $rootScope.pageTitle = toState.pageTitle; }); }); &lt;span ng-bind="pageTitle"&gt;&lt;/span&gt; &lt;div ng-app&gt; &lt;/div&gt;
tagged with: ng-app
has title: Why I can use `ng-bind` outside of `ng-app`?
tagged with: javascript
tagged with: ng-bind
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29935509
has comment: http://stackoverflow.com/comment/47993359
tagged with: angularjs
answer count: 1
has comment: http://stackoverflow.com/comment/47993477
has comment: http://stackoverflow.com/comment/47994345
score: 0

http://stackoverflow.com/a/29998422
score: 3
upvote count: 3
has comment: http://stackoverflow.com/comment/48116662
has comment: http://stackoverflow.com/comment/48116685
downvote count: 0
has comment: http://stackoverflow.com/comment/48116620
type: Answer
answers question: http://stackoverflow.com/q/29998384
has body: What I would do is: $('#spanid').addClass('check'); and add css; .check:after { content: '(what ever the code for the check mark is)'; }

http://stackoverflow.com/comment/47996734
comment on: http://stackoverflow.com/a/29926280
type: AnswerComment
has text: Ok tried that code and still not working. This new code is now on the webpage for you to see.
score: 0
type: Comment

http://stackoverflow.com/q/29918117
has body: i have a problem that i don't know how to compare the quantity of user input with the quantity in the database so that if the user put the quantity over the quantity in the database it will come one alert that notice the user that the product have out of stock on that quantity.Below is my code: <?php $con = mysql_connect('localhost', 'root', '') or die (mysql_error()); mysql_select_db('warda',$con) or die(mysql_error()); $page_title= 'View Your Shooping Cart'; if(isset($_POST['submit'])) { foreach( $_POST['qty'] as $key => $value) { if (is_numeric ($value)) { if(($value == 0) AND (is_numeric($value))) { unset($_SESSION['cart'][$key]); } elseif(is_numeric($value)AND($value>0)) { $_SESSION['cart'][$key]=$value; } } else { print ' '; echo ' '; exit(); } } } $empty = TRUE; if(isset($_SESSION['cart'])) { foreach($_SESSION['cart'] as $key=>$value) { if(isset($key)) { $empty=FALSE; } } } //echo $empty.'nilai';` if(!$empty) { $query ='SELECT * FROM product WHERE code IN (';//coding dalam database foreach($_SESSION['cart'] as $key => $value) { $query.="'".$key."'".','; } $query = substr($query,0,-1).')'; $result = mysql_query($query) or die("error"); echo " "; echo' Code Name Price Quantity Total '; echo' '; $total = 0 ; while($row_Recordset1 = mysql_fetch_array($result, MYSQL_ASSOC)) { $subtotal = $_SESSION['cart'] [$row_Recordset1['code']]*$row_Recordset1['price']; $price = $row_Recordset1['price']; $total+=$subtotal; echo" {$row_Recordset1['code']} {$row_Recordset1['name']} ` "; echo "RM " . number_format($price,2); echo" ` Continue Shopping <?php $today = date("d-m-Y"); mysql_close(); } else { echo 'YOUR CART IS EMPTY'; } ?>
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47957446
tagged with: php
has comment: http://stackoverflow.com/comment/47958142
answer count: 0
has comment: http://stackoverflow.com/comment/47957683
type: UnansweredQuestion
score: 0
has comment: http://stackoverflow.com/comment/47965248
has comment: http://stackoverflow.com/comment/47959919
type: Question
has comment: http://stackoverflow.com/comment/47961156
has comment: http://stackoverflow.com/comment/47961164
tagged with: javascript
has title: Compare the input user quantity value with the quantity value from database
has comment: http://stackoverflow.com/comment/47957319
has comment: http://stackoverflow.com/comment/47960729
tagged with: arrays
has comment: http://stackoverflow.com/comment/47957207
has comment: http://stackoverflow.com/comment/47961360
has comment: http://stackoverflow.com/comment/47957962

http://stackoverflow.com/q/29997163
tagged with: gnome-shell-extensions
score: 2
downvote count: 0
tagged with: gjs
tagged with: gnome-shell
type: Question
upvote count: 2
has title: Draw on background of Gnome Shell panel
tagged with: gnome
tagged with: javascript
has body: I want to visualize some data on the background of the Gnome Shell top panel, behind all of the other elements. Like in this mockup: https://i.sstatic.net/tv1aH.jpg Playing around with other extensions and reading through the St API docs [2] I found no obvious way to do something like this. The only elements in Main.panel that have insert functions (e.g. _insert_child_at_index) are _leftBox and _rightBox, but that's not what I want since I want my visualization to be behind the other elements, not next to them. Ideally, I'd like to dynamically add/remove and absolutely position elements anywhere inside Main.panel (or behind it if that's possible), without affecting any of the existing elements.
favorite count: 0
has comment: http://stackoverflow.com/comment/103749095
answer count: 0
type: UnansweredQuestion

http://stackoverflow.com/a/29928387
type: Answer
has comment: http://stackoverflow.com/comment/48010622
answers question: http://stackoverflow.com/q/29928206
has body: The usual pattern for this would be to supply a link with text such as "Printable Version". You would then simply link to the PDF in a non-suprising way for the user. If you want to persist with the CSS print layout, I have had some success with the CSS paged media specification. Here is a sample CSS file - note that only a tiny amount is in a print style... body { font-family: Georgia, serif; font-size: 12pt; } h2 { string-set: title content(); } img { max-width: 100%; } .on-new-page { display: block; page-break-before: always; } .keep-together { page-break-before: avoid; } .keep-intact { page-break-inside: avoid; } .contents a::after { content: leader('.') target-counter(attr(href), page); } @page { margin: 2.54cm; size: portrait; } @page :left { margin-right: 3.18cm; @bottom-left { content: counter(page); } @top-left { content: string(title); } } @page :right { margin-left: 3.18cm; @bottom-right { content: counter(page); } @top-right { content: string(title); } } @page :first { margin-top: 10cm; } @media print { .dont-print { display: none; } } You can check out my example page and do a print preview to see the effects this has. It varies by browser, but you can see there is much more control now than there used to be over print layouts.
score: 0

http://stackoverflow.com/comment/47844600
comment on: http://stackoverflow.com/q/29859210
score: 0
has text: Try `.then(client.incrAsync.bind(client, config.channel_name + ":ad_hits", "vdvd"))`
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29928717
has comment: http://stackoverflow.com/comment/47979520
has body: I have a php script which return a JSON, and a js function which parse this JSON. In my php I did a htmlspecialchars but when I display value in my webpage &amp;#039; isn't replace by ' same for &amp;quot; any idea ?
favorite count: 0
has comment: http://stackoverflow.com/comment/47979567
has comment: http://stackoverflow.com/comment/47980500
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47979926
tagged with: php
upvote count: 4
has title: My webpage display &#039; and not '
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29928772
downvote count: 0
accepted answer: http://stackoverflow.com/a/29928826
has comment: http://stackoverflow.com/comment/47980183
type: Question
possible better answer: http://stackoverflow.com/a/29928961
has answer: http://stackoverflow.com/a/29928826
tagged with: javascript
has answer: http://stackoverflow.com/a/29928961
score: 4
answer count: 3

http://stackoverflow.com/comment/48029863
comment on: http://stackoverflow.com/q/29954546
type: Comment
type: QuestionComment
has text: There seems to be [documentation](https://code.visualstudio.com/Docs/nodejs) ?
score: 1

http://stackoverflow.com/comment/47871258
comment on: http://stackoverflow.com/a/29872764
has text: Interesting answer. I'm trying to get this thing into coffeescript now so it can work on rails but its not working there. That's probably topic for a different question.
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/comment/47973144
comment on: http://stackoverflow.com/a/29925275
score: 0
type: Comment
has text: You would do that inside the function, `json` would be the returned data, and you can see it by logging it to the console, as in `console.log(json)`
type: AnswerComment

http://stackoverflow.com/comment/48066087
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29971322
has text: Yeah--that's what I meant--working 'almost' correctly. Bizarre issue, there's clearly no obvious issue with the code... maybe for SnG's try setting it as 'padding', with all four values defined in a string

http://stackoverflow.com/a/38884058
score: 7
has comment: http://stackoverflow.com/comment/65178784
answers question: http://stackoverflow.com/q/29889781
upvote count: 7
type: Answer
has body: I was able to fix this by modifying line 6203 of jspdf.debug.js (on version 1.2.61) to this: while (j &lt; tableRow.cells.length &amp;&amp; headers[j] != undefined) { Which was originally: while (j &lt; tableRow.cells.length) { Alternatively, I could make it go away by adding another td to the tr it was processing (it only had one td, which apparently caused the problem). I'm thinking I'll try to submit it as a bug fix.
downvote count: 0

http://stackoverflow.com/q/29923587
has title: Chrome cancelling a XMLHttpRequest (and firing off a successful one right after)?
has comment: http://stackoverflow.com/comment/47969671
has body: I'm trying to create a very basic client-side router using page.js. The idea being that when you visit a route, if you try and use a render method, then the render method will find the view you pass to it (by retrieving it from the server if necessary), then interpolate the view using lodash templates and finally display it to the user. However, I'm experiencing a weird phenomenon. Despite the fact the below example works absolutely perfectly, I am seeing this in my Chrome network log: (The image above is quite small. Here is the link: https://i.sstatic.net/qyhP6.png) Now, I am firing off a request to /templates/index.html and I can verify that both of these requests are representing a XHR to the exact same location (that is, they both are pointing at /templates/index.html). Here is my router code (yes, I appreciate it needs refactoring): var page = require('page') , home = require('./home') , lodashTemplates = require('lodash.template'); module.exports = function() { // refactor var routeContainer = document.querySelector('[data-container]'); // TODO: Refactor this to somewhere else var render = (function() { var viewCache = new Map(); return function render(viewName, locals, done) { if(viewCache.get(viewName) === undefined) { // cache miss - try and get the template var request = new XMLHttpRequest(); request.open('GET', '/templates/' + encodeURIComponent(viewName) + '.html'); request.onreadystatechange = function() { if(request.readyState === 4) { switch(request.status) { case 200: viewCache.set(viewName, lodashTemplates(request.response)); // once we have cached the view, invoke ourselves.. // this could probably be coded better render(viewName, locals, done); return; case 404: case 500: throw new Error('unable to retrieve view from server: '+viewName); } } }; request.send(); return; } // Do this elsewhere.. var view = viewCache.get(viewName); var interpolated = view(locals); routeContainer.innerHTML = interpolated; }; }()); var thisContext = { render: render };…
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47968941
has comment: http://stackoverflow.com/comment/47969092
has comment: http://stackoverflow.com/comment/47969724
accepted answer: http://stackoverflow.com/a/29924300
type: Question
has comment: http://stackoverflow.com/comment/47969598
has comment: http://stackoverflow.com/comment/47969573
tagged with: javascript
linked to: http://stackoverflow.com/q/12761255
has comment: http://stackoverflow.com/comment/47969035
score: 0
has comment: http://stackoverflow.com/comment/47969716
answer count: 1
has comment: http://stackoverflow.com/comment/47969617
has comment: http://stackoverflow.com/comment/47969731
has comment: http://stackoverflow.com/comment/47969129
has answer: http://stackoverflow.com/a/29924300

http://stackoverflow.com/a/29906674
answers question: http://stackoverflow.com/q/29906113
type: Answer
accepted answer of: http://stackoverflow.com/q/29906113
has comment: http://stackoverflow.com/comment/47936041
has body: The way you defined your data and json vars is causing subsequent requests to fail. Since you defined them up front, all requests will re-use them, meaning by the time you JSON.parse data for the second request, data will contain two valid json strings, thus making one invalid json string. To fix this, define data and json farther down in the callback. var express = require('express'); var app = express(); var http = require("http"); //var data = ""; //var json; console.log( "__dirname", __dirname ); app.use( express.static( __dirname + '/') ); var options = { host:"openexchangerates.org", path:"/api/latest.json?app_id=&lt;get free ID from openexchangerates.org&gt;" }; app.get("/", function( req, res ) { res.sendFile('index.html', { root: __dirname }); }) app.get("/getfx", function(req, res) { console.log("Route: getFx"); getFx(res); }) function getFx(res) { console.log("http getFx"); http.get(options, function (response) { var data = ""; var json; response.on("data", function (chunk) { //console.log("data:\n"+chunk); data += chunk; }); response.on("end", function () { console.log("http response end:"); json = JSON.parse(data); res.json(json); }); response.on("error", function (e) { console.log("error:\n" + e.message); }); }) } app.listen(3000);
score: 3
downvote count: 0
type: AcceptedAnswer
upvote count: 3

http://stackoverflow.com/q/29861083
has answer: http://stackoverflow.com/a/29861211
has answer: http://stackoverflow.com/a/29861145
answer count: 2
tagged with: jquery
favorite count: 0
tagged with: ajax
tagged with: twitter-bootstrap
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/29861145
type: AnsweredQuestion
score: 2
upvote count: 3
downvote count: 1
has title: jquery validation plugin ajax submit not working
type: Question
has body: I use jquery validation plugin to do validation in a bootstrap modal form, when i send the form ,the jquery validation plugin is not working also the form cannot send out. bootstrap modal form &lt;div class="modal fade" id="form-content" 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-hidden="true"&gt; &amp;times; &lt;/button&gt; &lt;h3&gt;send message&lt;/h3&gt; &lt;/div&gt; &lt;div class="modal-body"&gt; &lt;form class="contact"&gt; &lt;fieldset&gt; &lt;div class="modal-body"&gt; &lt;ul class="nav nav-list"&gt; &lt;div class="form-group"&gt; &lt;label for="topic" class="control-label "&gt;topic:&lt;/label&gt; &lt;input class="form-control" type="text" name="topic"&gt; &lt;span class="help-block"&gt;&lt;/span&gt; &lt;/div&gt; &lt;div class="form-group"&gt; &lt;label for="ruser" class="control-label "&gt;ruser: &lt;/label&gt; &lt;input class="form-control" type="text" name="ruser"&gt; &lt;span class="help-block"&gt;&lt;/span&gt; &lt;/div&gt; &lt;div class="form-group"&gt; &lt;label for="content" class="control-label "&gt;content:&lt;/label&gt; &lt;textarea class="form-control" name="content" rows="3"&gt;&lt;/textarea&gt; &lt;span class="help-block"&gt;&lt;/span&gt; &lt;/div&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/fieldset&gt; &lt;/form&gt; &lt;/div&gt; &lt;div class="modal-footer"&gt; &lt;button class="btn btn-success" type="submit"&gt;send&lt;/button&gt; &lt;a href="#" class="btn" data-dismiss="modal"&gt;close&lt;/a&gt; &lt;/div&gt; &lt;/div&gt;&lt;!-- /.modal-content --&gt; &lt;/div&gt;&lt;!-- /.modal --&gt; &lt;/div&gt; &lt;button class="btn btn-success btn-lg" data-toggle="modal" data-target="#form-content"&gt; send message &lt;/button&gt; javascript $(document).ready(function(){ $('form').validate({ rules: { topic: { required: true }, ruser: { required: true }, content: {…
tagged with: javascript
possible better answer: http://stackoverflow.com/a/29861211

http://stackoverflow.com/comment/47855481
comment on: http://stackoverflow.com/a/29865226
has text: checked this one http://stackoverflow.com/questions/29864706/angular-ng-repeat-not-working/29864820?noredirect=1#comment47854849_29864820
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/47839511
type: Comment
type: QuestionComment
has text: When I select Feature Requests, it hides the tickets that meet the requirements of the if statement, But if I select Incidents after selecting Feature Requests, they remain hidden. I want them to swap back.The idea is to only display incidents when the incident option is selected, and only new features when the new features option is selected.
comment on: http://stackoverflow.com/q/29856612
score: 0

http://stackoverflow.com/comment/47995405
type: Comment
comment on: http://stackoverflow.com/q/29936860
type: QuestionComment
has text: If I were you, I would simply stick 2 textboxes, remove their right/left border, to give the impression it is a single textbox, and allow the right textbox to be written but not the left textbox.
score: 3

http://stackoverflow.com/comment/48283591
has text: (1) - Click on "more information" and tell us what it is shown in "Unexpected server response" section (2) - have you tried with other browsers ? it is the same issue ?
type: Comment
comment on: http://stackoverflow.com/q/29954361
score: 0
type: QuestionComment

animsition
tag name: animsition
tags question: http://stackoverflow.com/q/29859134
type: Tag

http://stackoverflow.com/a/29870481
has body: This does not look like a typo. jQuery itself is contained in a file starting with the prefix "jquery". I assume that the same pattern is used in UI5/OpenUI5 for jQuery related stuff. The same for the function, jQuery internally uses the $ as alias for the variable jQuery. Obviously the developers decided not to use the alias but the variable. So UI5/OpenUI5 just makes use of the proven patterns.
type: Answer
has comment: http://stackoverflow.com/comment/47907742
has comment: http://stackoverflow.com/comment/47885854
upvote count: 3
has comment: http://stackoverflow.com/comment/47902300
answers question: http://stackoverflow.com/q/29868613
has comment: http://stackoverflow.com/comment/47874993
downvote count: 0
score: 3

http://stackoverflow.com/q/29983222
has answer: http://stackoverflow.com/a/29983232
has title: How can I get a file when I know the partial name?
answer count: 1
downvote count: 0
score: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/48085919
type: UnansweredQuestion
tagged with: filenames
has body: I need to getJSON a file in jQuery, but I don't know the full filename, because it's uploaded by a 3rd party that adds a random string to the URL. *lessons.json* is renamed to *lessons[123456789].json* Is there a way I can find that file and get it with getJSON?
upvote count: 1
type: Question
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/a/29962838
type: Answer
has body: This is the final componet, thanks guys: import React from "react"; class StatusBarCompaniesView extends React.Component { mixins: [ClickAwayable] constructor(props) { super(props) this.state = {dropdown: false, selectedOption: 0} this.handleClick = this.handleClick.bind(this) } handleClick() { this.setState({ dropdown: !this.state.dropdown }); } componentWillMount() { this._closeMenuIfClickedOutside = function(event) { if (!this.state.dropdown) { return; } var menuElem = this.refs.selectMenuContainer.getDOMNode(); var eventOccuredOutsideMenu = this.clickedOutsideElement(menuElem, event); // Hide dropdown menu if click occurred outside of menu if (eventOccuredOutsideMenu) { this.setState({ dropdown: false }, this._unbindCloseMenuIfClickedOutside); } }.bind(this); this._bindCloseMenuIfClickedOutside = function() { document.addEventListener('click', this._closeMenuIfClickedOutside); }; this._unbindCloseMenuIfClickedOutside = function() { document.removeEventListener('click', this._closeMenuIfClickedOutside); }; } clickedOutsideElement(element, event) { var eventTarget = (event.target) ? event.target : event.srcElement; while (eventTarget != null) { if (eventTarget === element) return false; eventTarget = eventTarget.offsetParent; } return true; } clickSelectOption(playload){ console.log(playload); this.state.selectedOption = playload console.log(this.state.selectedOption) } render() { var me = this; var company_items = [ { payload: '0', imageurl: 'images/avatar.png', text: 'Burger Apps, SL' }, { payload: '1', imageurl: 'images/avatar-apple.png', text: 'Apple Computer Inc' }, { payload: '2', imageurl: 'images/avatar-hp.png', text: 'Hewlett Packard' }, { payload: '3', imageurl: 'images/avatar-apple.png', text: 'Eyects Systems' } ]; var cx = require('classnames'); var dropdown = cx ({ 'aui-profit-statusbar-companies-dropdown-container' : true, 'dropdown' : this.state.dropdown }); var cx = require('classnames'); var selected = cx ({ 'aui-profit-statusbar-companies-contain…
upvote count: 1
answers question: http://stackoverflow.com/q/29961119
score: 1
downvote count: 0

http://stackoverflow.com/comment/47898347
comment on: http://stackoverflow.com/q/29887235
score: 0
type: Comment
type: QuestionComment
has text: requiredOffset = (screenHeight - divHeight) * 0.5;

http://stackoverflow.com/a/29875391
downvote count: 0
has body: You can use outerHTML: var path = $("#b")[0].outerHTML; // &lt;path id="b" d="M150 0 L75 200 L225 200 Z"&gt;&lt;/path&gt; Then combine that with hover: $("#b").hover(function() { console.log($(this)[0].outerHTML); }); Working Example As pointed out, this won't work in IE because it doesn't follow specification. You can workaround this by cloning the &lt;path&gt; element, appending it to the HTML body to make it part of the DOM, then grabbing the rendered HTML from there. Note: This won't be an exact representation of the HTML because it's out of context. For example, it contains the xmlns, but since it's a jQuery object you can modify it how you like: $("#b").hover(function() { // Create a clone of the &lt;path&gt; var clone = $(this).clone(); // Append it to the &lt;body&gt; clone.appendTo("body"); // Wrap it in a containing &lt;div&gt; ... you'll see why in a minute clone.wrap("&lt;div&gt;"); // Now we grab the innerHTML of that containing &lt;div&gt; - outerHTML won't work console.log(clone.parent().html()); // Prints: &lt;path xmlns="http://www.w3.org/2000/svg" id="b" d="M 150 0 L 75 200 L 225 200 Z" /&gt; // Now remove our temporary element again... clone.parent().remove(); });
type: Answer
has comment: http://stackoverflow.com/comment/47899709
has comment: http://stackoverflow.com/comment/47905269
score: 5
upvote count: 5
answers question: http://stackoverflow.com/q/29875350

http://stackoverflow.com/comment/47972631
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29925214
has text: how can i make this?
score: 0

http://stackoverflow.com/q/29969328
has comment: http://stackoverflow.com/comment/48058285
linked to: http://stackoverflow.com/q/3303029
type: Question
answer count: 2
has body: I use ajax $.get to read a file at local server. However, the web crashed since my file was too large(> 1GB). How can I solve the problem? If there's other solutions or alternatives? $.get("./data/TRACKING_LOG/GENERAL_REPORT/" + file, function(data){ console.log(data); });
has comment: http://stackoverflow.com/comment/48058381
upvote count: 0
tagged with: javascript
score: -1
tagged with: ajax
has answer: http://stackoverflow.com/a/29969401
has comment: http://stackoverflow.com/comment/48058340
has title: How to read a large file(>1GB) in javascript?
has answer: http://stackoverflow.com/a/29969619
favorite count: 0
has comment: http://stackoverflow.com/comment/80762805
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/48058288
has comment: http://stackoverflow.com/comment/48058550
has comment: http://stackoverflow.com/comment/48058481
linked to: http://stackoverflow.com/q/44493340
has comment: http://stackoverflow.com/comment/48059156
has comment: http://stackoverflow.com/comment/48058631
downvote count: 1

http://stackoverflow.com/comment/48789251
comment on: http://stackoverflow.com/q/29937410
score: 0
type: QuestionComment
type: Comment
has text: is gps active on your phone ? , can you please post some HTML 5 and JavaScript code you are using to get altitude ?

http://stackoverflow.com/comment/48627503
comment on: http://stackoverflow.com/q/29992594
has text: Your question does not make any sense because your orthographic camera parameters are in pixels. Read http://stackoverflow.com/questions/17558085/three-js-orthographic-camera/17567292#17567292.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29879501
type: AnsweredQuestion
tagged with: substr
type: Question
possible better answer: http://stackoverflow.com/a/29879693
has answer: http://stackoverflow.com/a/29879693
has answer: http://stackoverflow.com/a/29879774
tagged with: arrays
linked to: http://stackoverflow.com/q/1527803
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29879740
answer count: 6
has title: Take random letters out from a string
has comment: http://stackoverflow.com/comment/47883485
score: 0
has answer: http://stackoverflow.com/a/29879735
has answer: http://stackoverflow.com/a/29879768
tagged with: jquery
linked to: http://stackoverflow.com/q/20817618
has body: I want to remove 3 RANDOM letters from a string. I can use something like substr() or slice() function but it won't let me take the random letters out. Here is the demo of what I have right now. http://jsfiddle.net/euuhyfr4/ Any help would be appreciated!
has answer: http://stackoverflow.com/a/29880013
has answer: http://stackoverflow.com/a/29879740

http://stackoverflow.com/a/29943330
has comment: http://stackoverflow.com/comment/48007901
answers question: http://stackoverflow.com/q/29943131
has comment: http://stackoverflow.com/comment/48009317
score: 1
has comment: http://stackoverflow.com/comment/48007491
has comment: http://stackoverflow.com/comment/48007781
has comment: http://stackoverflow.com/comment/48007965
upvote count: 1
has comment: http://stackoverflow.com/comment/48007650
has comment: http://stackoverflow.com/comment/48007707
has comment: http://stackoverflow.com/comment/48007352
downvote count: 0
has comment: http://stackoverflow.com/comment/48007533
has body: EDIT 2 From the comments you've posted it seems like it may be more difficult to put all the pieces together than I anticipated so here is what you need to do in order to get the result you want: Wire up an event on the server side for your button click Within that function assign the values of your datepickers to 3 separate variables Using the example code below for C#, compare leavedate and joindate to birthdate and determine if leavedate and joindate occur before or after birthdate Continue with whatever else your application does EDIT: Here is another MSDN article on how to wire up a button click. So if you put all the pieces together you will get your desired result of validating dates on a button click. Comparing dates, especially in the way you want to is relatively straightforward. To do it server-side (in C#), here is a MSDN article and example: using System; public class Example { public static void Main() { DateTime date1 = new DateTime(2009, 8, 1, 0, 0, 0); DateTime date2 = new DateTime(2009, 8, 1, 12, 0, 0); int result = DateTime.Compare(date1, date2); string relationship; if (result &lt; 0) relationship = "is earlier than"; else if (result == 0) relationship = "is the same time as"; else relationship = "is later than"; Console.WriteLine("{0} {1} {2}", date1, relationship, date2); } } // The example displays the following output: // 8/1/2009 12:00:00 AM is earlier than 8/1/2009 12:00:00 PM To do it client-side (in Javascript), here is a, here is a W3Schools article and example: var today, someday, text; today = new Date(); someday = new Date(); someday.setFullYear(2100, 0, 14); if (someday &gt; today) { text = "Today is before January 14, 2100."; } else { text = "Today is after January 14, 2100."; } document.getElementById("demo").innerHTML = text;
type: Answer

http://stackoverflow.com/a/63704753
upvote count: 1
answers question: http://stackoverflow.com/q/29944160
score: 1
downvote count: 0
type: Answer
has body: u can add "left" just like this: $('.owl-carousel').owlCarousel({ stagePadding: 40, loop:false, margin:2, nav:false, items:2, left: -30 })

http://stackoverflow.com/comment/48112310
type: QuestionComment
has text: Sounds like you have other pages that have the desired formatting. If you have a "known good" page I suggest you compare the markup and CSS for any differences between the two pages and make corrections from there.
type: Comment
comment on: http://stackoverflow.com/q/29996362
score: 0

http://stackoverflow.com/q/29871293
has comment: http://stackoverflow.com/comment/47867585
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/47868139
has answer: http://stackoverflow.com/a/29872091
has comment: http://stackoverflow.com/comment/47867677
has body: I have created an order form and have automatically filled in some of the fields with the current users information that has been stored in the database. However, I realise that people will some times want to order somewhere new and may change the details just for that particular order. at the moment some of form field code is: Email : <input type="text" value="<?php echo $info[email]?>" name="email" id="email"> Is there a way for me to clear the value of a field when I am echoing the value? I know how to clear a form normally using javascript and reset() function on the form with button, but obviously that will only clear the values of the fields that the user has entered themselves not the ones output by PHP code. Any nudge in the right direction would be appreciated :).
linked to: http://stackoverflow.com/q/6653556
has comment: http://stackoverflow.com/comment/47867535
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/29872115
linked to: http://stackoverflow.com/q/10754874
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29872115
tagged with: forms
type: Question
has comment: http://stackoverflow.com/comment/47867599
has title: Clear form that has been automatically filled in with PHP echo code
accepted answer: http://stackoverflow.com/a/29872091
tagged with: javascript
linked to: http://stackoverflow.com/q/3786694

http://stackoverflow.com/q/29959602
has answer: http://stackoverflow.com/a/29969547
has title: MongoError: topology was destroyed sailsjs
tagged with: node.js
favorite count: 0
downvote count: 0
possible better answer: http://stackoverflow.com/a/29973775
type: AnsweredQuestion
tagged with: sails.js
has answer: http://stackoverflow.com/a/29969446
score: 7
type: Question
has body: When I try to create this error shows up: Error (E_UNKNOWN) :: Encountered an unexpected error MongoError: topology was destroyed at Server.insert (/Users/oscargallon/Documents/developer/sails/reyesmagoswebpae/node_modules/sails-mongo/node_modules/mongodb/node_modules/mongodb-core/lib/topologies/server.js:797:49) here's my model module.exports = { attributes: { name: { type: 'string', required: true }, email: { type: 'String', required: true }, description: { type: 'string', required: true }, phonenumber: { type: 'string', required: true }, mobile: { type: 'string', required: true } } };
tagged with: mongodb
has answer: http://stackoverflow.com/a/29973775
accepted answer: http://stackoverflow.com/a/29969547
tagged with: javascript
has comment: http://stackoverflow.com/comment/49085626
answer count: 3
upvote count: 7

http://stackoverflow.com/q/29895570
has comment: http://stackoverflow.com/comment/47915615
has comment: http://stackoverflow.com/comment/47913839
upvote count: 2
has comment: http://stackoverflow.com/comment/47915098
tagged with: iphone
has comment: http://stackoverflow.com/comment/47914194
has comment: http://stackoverflow.com/comment/47914295
has comment: http://stackoverflow.com/comment/47945872
answer count: 1
tagged with: objective-c
has title: Dynamically replace .h and .m file in ios project(bundle path)
favorite count: 0
has comment: http://stackoverflow.com/comment/47914106
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47917544
has comment: http://stackoverflow.com/comment/47917133
has comment: http://stackoverflow.com/comment/47915357
has comment: http://stackoverflow.com/comment/47963026
has comment: http://stackoverflow.com/comment/47914290
score: 1
has comment: http://stackoverflow.com/comment/47946016
has comment: http://stackoverflow.com/comment/47944255
has comment: http://stackoverflow.com/comment/47915867
has comment: http://stackoverflow.com/comment/47913966
downvote count: 1
has comment: http://stackoverflow.com/comment/47914566
type: Question
has body: I have using calculation.h and calculation.m files for some calculation in my project. Those calculations will come some changes while application in store. So I can only change those calculation and update to next version. So do we have any logic or concept to change calculation at run time or we can replace or add calculation.h and calculation.m files in bundle path at runtime. I tried API for calculation changes. So please suggest me any other methods. Do we can allocate and initialize files which have in "NSDocument Directory"?.(instead of access in bundle path) Do we have jsscript concept for calculations changes or any other method? Thanks for advance.
has comment: http://stackoverflow.com/comment/47967402
has answer: http://stackoverflow.com/a/31465142
has comment: http://stackoverflow.com/comment/47914415
has comment: http://stackoverflow.com/comment/47914264
has comment: http://stackoverflow.com/comment/47962886
has comment: http://stackoverflow.com/comment/47914177
tagged with: ios
tagged with: javascript

http://stackoverflow.com/a/30002865
has comment: http://stackoverflow.com/comment/48124762
has comment: http://stackoverflow.com/comment/48125375
downvote count: 0
has comment: http://stackoverflow.com/comment/48124340
answers question: http://stackoverflow.com/q/30002398
type: Answer
has body: I don't really understand your question but performance wise if you have deep hierarchy tree in SVG, you should consider using html5 canvas instead since it's much more performance efficient. It feels from your question that's the main issue. Maybe it's not the best solution for you but I think you should read up on what best suits you. See https://msdn.microsoft.com/en-us/hh552482.aspx?f=255&amp;MSPPError=-2147217396 and http://www.sitepoint.com/7-reasons-to-consider-svgs-instead-of-canvas/ for pros and cons between SVG and canvas. Microsoft Virtual Academy also has a chapter for this as well. Hope it helps!
has comment: http://stackoverflow.com/comment/48125141
has comment: http://stackoverflow.com/comment/48168898
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/48125986
has comment: http://stackoverflow.com/comment/48170314

http://stackoverflow.com/q/29850638
tagged with: javascript
linked to: http://stackoverflow.com/q/24595373
upvote count: 2
tagged with: jquery
has body: What I'm trying to do is to display a process bar when a user clicks on submit. the gifs works if I just open it in my web browser but when I add a reference to it in my HTML code it doesn't work. My dialog appears with the GIF but the gif doesn't move. Here is my code: Please wait while your request is processed. $(document).ready(function () { // Hide the "busy" Gif at load: if ($('#progressDialog').dialog('isOpen')) { $('#progressDialog').dialog('close'); } // Handle the form submit event, and make the Ajax request: $("#myform").on("submit", function (event) { // Show the "busy" Gif: $("#progressDialog").dialog({ autoOpen: false, modal: true, bgiframe: true }); $('#progressDialog').dialog('open'); }); });
favorite count: 0
has comment: http://stackoverflow.com/comment/47827429
has comment: http://stackoverflow.com/comment/47827474
has comment: http://stackoverflow.com/comment/47827355
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
score: 2
downvote count: 0
answer count: 0
has title: GIF not moving when referenced in my HTML code
type: Question
tagged with: http://stackoverflow.com/tag/gif

http://stackoverflow.com/q/29901443
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/48221008
tagged with: progress-bar
score: 0
has comment: http://stackoverflow.com/comment/47939287
answer count: 0
type: UnansweredQuestion
has body: Currently, I have a jQuery indeterminate progress bar showing on page load, but freezes while loading page content, then resumes after content is loaded. Content on the page: 13 dynamic google charts are loaded from information provided by a JSON feed. The progress bar is using the standard jQuery animated gif. Here is the code that calls the progress bar: $("#progressbar").progressbar({ value: false }); It is just a basic progress bar, but I have a feeling that with everything going on on the page, it freezes functionality of everything else, including drop down menus. What is causing the progress bar to freeze until everything on the page is loaded?
has title: JQuery progress bar freezing
type: Question
tagged with: jquery-ui

http://stackoverflow.com/comment/47983856
has text: Thanks, this seems like a good solution, however I need to have a way to exclude "#" on every page in my domain i.e http://example/node/234#, because I have facebook style chat (iflychat) and that's its anchor.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29930382

http://stackoverflow.com/comment/47866147
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29870213
has text: This was a stylistic thing though, surely? I wanted to name it because it made sense internally. Is there a *functional* reason why I shouldn't (as per the answer I have accepted?)

http://stackoverflow.com/comment/47971870
has text: there is also a missing parenthesis somewhere in there. but thanks for the explanation
type: AnswerComment
comment on: http://stackoverflow.com/a/29920280
score: 0
type: Comment

http://stackoverflow.com/comment/48049547
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29964717
has text: @Jamiec - You are right. I'm sure `$('#btnStudios button').map().get()` is jQuery, but I am assuming.
type: Comment

http://stackoverflow.com/q/29947721
has comment: http://stackoverflow.com/comment/48016511
upvote count: 0
has body: I was wondering how to change a specific child of an element. In this case I want to change the first a of ul. I tried this: [HTML AND JQUERY] 1 2 3 4 5 6 7 8 Text
accepted answer: http://stackoverflow.com/a/29947795
tagged with: javascript
tagged with: jquery
downvote count: 4
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/48016469
favorite count: 0
score: -4
has answer: http://stackoverflow.com/a/29947795
has comment: http://stackoverflow.com/comment/48016381
tagged with: css
has comment: http://stackoverflow.com/comment/48016495
type: AnsweredQuestion
has title: jQuery - Childs
type: Question

http://stackoverflow.com/q/29999120
has comment: http://stackoverflow.com/comment/48342614
upvote count: 6
has answer: http://stackoverflow.com/a/30271764
has body: I am working on a project that is using jQuery DataTables empowered theme (Smart Admin). I find the tool a great client side solution specially to filter results without coming back to the server. The table fields we show are only part of which there is in the database due to the fact there is not enough space. The issue is that the export feature then only includes these limited columns. I red that if we have a hidden column that too will get exported (ex: csv, xls, pdf) etc. I tried to hie a field and that didn't work out for me. I be obliged if you could point out to what I am doing wrong. I referenced the following article: Data Table Example - Hidden Columns There were no console errors and the rest of the functionality (filtering, exporting works well). How ever my concern is that we might be having an bug, didn't update to latest. I think we have v1.10. # @fn setup: -&gt; {{{ # @brief Sets up DataTable plugin with the help of the @$_tableId provided. setupDataTables: -&gt; self = @ @setupCheckboxes() if @$_bulkControls.length &gt; 0 @$_dataTables = $(@$_tables).dataTable "columnDefs": [ { "targets": [1, 2, 3, 4], "visible": false } ], "sDom": "&lt;'dt-toolbar'&lt;'col-xs-12 col-sm-6'f&gt;&lt;'col-sm-6 col-xs-6 hidden-xs'T&gt;r&gt;t&lt;'dt-toolbar-footer'&lt;'col-sm-6 col-xs-12 hidden-xs'i&gt;&lt;'col-sm-6 col-xs-12'p&gt;&gt;" "oTableTools": { "aButtons": [ "copy", { "sExtends": "csv", "sTitle": @generateDocumentName() }, { "sExtends": "xls", "sTitle": @generateDocumentName() }, { "sExtends": "pdf", "sTitle": @generateDocumentName(), "sPdfMessage": "SmartAdmin PDF Export", "sPdfSize": "letter" }, { "sExtends": "print", "sMessage": "Generated by SmartAdmin &lt;i&gt;(press Esc to close)&lt;/i&gt;" } ], "sSwfPath": "&lt;%= asset_path('copy_csv_xls_pdf.swf') %&gt;" }, "autoWidth" : true, "preDrawCallback" : -&gt; # Initialize the responsive datatables helper once. if !self.$_responsiveHelperDatatableTabletools self.$_responsiveHelperDatatableTabletools = new Respo…
has comment: http://stackoverflow.com/comment/48176846
tagged with: ruby-on-rails
answer count: 1
has title: jQuery DataTable - Hide Column Issue
downvote count: 0
tagged with: javascript
type: UnansweredQuestion
tagged with: jquery
score: 6
favorite count: 0
type: Question
tagged with: datatables

http://stackoverflow.com/q/29860883
score: 0
answer count: 2
has body: We are given: the number of sides of a regular polygon one side defined by coordinates (x1, y1) and (x2, y2) I have to find out the remaining coordinates. How can I do this?
accepted answer: http://stackoverflow.com/a/29861765
favorite count: 0
has title: Given one side of a regular polygon, find the remaining sides
tagged with: geometry
tagged with: turtle-graphics
upvote count: 1
possible better answer: http://stackoverflow.com/a/29873420
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29873420
tagged with: math
has comment: http://stackoverflow.com/comment/47847584
downvote count: 1
has answer: http://stackoverflow.com/a/29861765
type: Question
tagged with: algorithm
tagged with: javascript

http://stackoverflow.com/comment/47937005
comment on: http://stackoverflow.com/q/29907226
score: 0
type: Comment
type: QuestionComment
has text: jquery ui has a nice modal option. http://jqueryui.com/dialog/ You can add your confirmation logic to it.

http://stackoverflow.com/comment/48020873
has text: @mattytommo - just trying to keep up m8! You and Jon Skeet will be getting integer overflow exceptions next time you log in.
score: 1
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29934310

find
tags question: http://stackoverflow.com/q/29962570
type: Tag
tag name: find
tags question: http://stackoverflow.com/q/29960543

http://stackoverflow.com/comment/48058335
comment on: http://stackoverflow.com/q/29968518
type: Comment
has text: @Musa can give a brief explanation on this with a sample code?
score: 0
type: QuestionComment

http://stackoverflow.com/comment/47891379
has text: but `new Object()` doesn't allow me to provide my functionality. it would have to be `new MyLibrary()` and therefore i introduce unnecessary name in the global namespace. is there any way to avoid it?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29883469

http://stackoverflow.com/q/29854492
has comment: http://stackoverflow.com/comment/47835079
downvote count: 0
tagged with: javascript
tagged with: express
linked to: http://stackoverflow.com/q/29813108
has title: How do I get emoticons working in express?
duplicate of: http://stackoverflow.com/q/29813108
has comment: http://stackoverflow.com/comment/47835204
favorite count: 0
answer count: 0
type: UnansweredQuestion
upvote count: 1
tagged with: node.js
has body: bodyParser.json crashes when provided with an emoji. It seems like it cannot handle the utf8b4 charset. I have searched all over for a json parser that can handle emojis, but it seems like all the modules that deal with this kind of thing are browser related or do not fit the scope of what I am trying to achieve. There must be a way to get emojis working in Express, but I cannot find any information on it at all. How do I get emoticons working in express?
score: 1
tagged with: http://stackoverflow.com/tag/json
type: Question

http://stackoverflow.com/comment/47836267
type: QuestionComment
has text: `var d = document.createElement('div'); d.innerHTML = m; d.childNodes[0].src;` Of course, you could at that point just append `d.childNodes[0]` to the head.
comment on: http://stackoverflow.com/q/29855050
score: 0
type: Comment

http://stackoverflow.com/comment/48037741
type: Comment
comment on: http://stackoverflow.com/q/29933274
score: 0
has text: We are working on creating a custom pop-up which will encase the string. We're planning on parsing it out for the title based on something like this but we can figure that out ourselves. Thanks a ton for the answer, mate.
type: QuestionComment

http://stackoverflow.com/comment/48044180
comment on: http://stackoverflow.com/a/29961132
score: 0
type: AnswerComment
type: Comment
has text: This is not a dropdown's source . copy your dropdown sourceand paste it here. This is input type="text" a textbox. find " " in your page source.

http://stackoverflow.com/comment/47905686
score: 0
type: QuestionComment
type: Comment
has text: Does it work with the standard brackets {{ thumbnail }} ??
comment on: http://stackoverflow.com/q/29891031

http://stackoverflow.com/comment/47838819
has text: if `update` runs slow it will still block RAF. Async code doesn't mean it's multithreaded. Consider using workers if you're having performance problems.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29856379
score: 1

http://stackoverflow.com/comment/47962192
score: 0
comment on: http://stackoverflow.com/q/29920404
has text: Maybe use a hidden input.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47885954
comment on: http://stackoverflow.com/a/29880781
score: 0
type: Comment
has text: @MatthewHarwood Hehe :) I'd be happy to modify it if I understood a little bit better where you take the other properties from, like "stuff/thing" that you wrote. Are they from `trends` ?
type: AnswerComment

http://stackoverflow.com/comment/47943167
type: QuestionComment
comment on: http://stackoverflow.com/q/29910387
score: 1
has text: `$('.radioSelection').removeClass('.radioSelection');` - but call this before you add the class to the existing (or better just cache the current radio button in a js variable)
type: Comment

http://stackoverflow.com/comment/47841326
type: Comment
has text: The OP knows what is happening. They are asking **why** it is happening.
comment on: http://stackoverflow.com/a/29857718
score: 0
type: AnswerComment

http://stackoverflow.com/q/29891505
has title: Hide menu when clicking outside of it
tagged with: menu
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/29891689
has answer: http://stackoverflow.com/a/29891689
type: Question
accepted answer: http://stackoverflow.com/a/29891548
tagged with: javascript
score: 0
answer count: 2
has body: I'd like to hide my menu when I click outside of it. I've tried many things but I must do something wrong and I've too little knowledge in Javascript to handle this. Here is the Html ABOUT FINISHES NEWS CONTACT LAMPE GRAS LAMPE MANTIS LAMPE IN THE TUBE CHAISE SURPIL by DCW éditions Facebook Pinterest En Fr Here is the script Thank you so much for your help !
has answer: http://stackoverflow.com/a/29891548
tagged with: click

http://stackoverflow.com/a/29919823
has comment: http://stackoverflow.com/comment/47961135
score: 1
has comment: http://stackoverflow.com/comment/47962423
has body: You have to angular to use the token interceptor. This can be done at the app config phase yourApp.config(function($httpProvider) { $httpProvider.interceptors.push("authorizationInterceptor"); }); I suggest you read the following series of articles. Though they are written targeting ASP.net MVC, concepts presented are universal http://bitoftech.net/2014/06/01/token-based-authentication-asp-net-web-api-2-owin-asp-net-identity/ Hope this helps
accepted answer of: http://stackoverflow.com/q/29919245
has comment: http://stackoverflow.com/comment/47961367
has comment: http://stackoverflow.com/comment/47962692
answers question: http://stackoverflow.com/q/29919245
upvote count: 1
type: AcceptedAnswer
downvote count: 0
type: Answer

http://stackoverflow.com/comment/47877421
comment on: http://stackoverflow.com/q/29876525
type: Comment
has text: @Archana you will need to use javascript for same and keep track of login attempts here..
type: QuestionComment
score: 0

http://stackoverflow.com/a/29896746
downvote count: 0
has body: i don't think its jQuery problem,because your code seems to be pure javascript code except for the part to get the value of input field, and to make sure try using the following code: function isEmailValid(value) { is_email = value.match(/^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i)!=null return is_email; } // Test without jQuery if( isEmailValid(document.getElementById("email").value) ){ // Valid }else{ // Not Valid } // Test with jQuery if( isEmailValid($("#email").val()) ){ // Valid }else{ // Not Valid }
type: Answer
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/29891539
accepted answer of: http://stackoverflow.com/q/29891539
type: AcceptedAnswer

http://stackoverflow.com/comment/79375719
score: 0
comment on: http://stackoverflow.com/a/29955488
has text: And of course, _.union(...) to just include all unique IDs.
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/47896142
type: AnswerComment
comment on: http://stackoverflow.com/a/29885992
type: Comment
has text: Also: http://stackoverflow.com/questions/9152908/node-js-memory-leak-hunting-without-v8-profiler
score: 0

http://stackoverflow.com/q/29988477
upvote count: 1
answer count: 1
tagged with: angularjs-directive
accepted answer: http://stackoverflow.com/a/29988905
has title: Material design ripple from jQuery to AngularJS
downvote count: 0
has body: I have some simple code for a material design ripple effect in CSS that can be used on every element needed just by applying an .ripple class on it (but it must have width and height). The code is the following: (function(window, $) { $(function() { $('.ripple').on('click', function(event) { event.preventDefault(); var $div = $(' '), btnOffset = $(this).offset(), xPos = event.pageX - btnOffset.left, yPos = event.pageY - btnOffset.top; $div.addClass('ripple-effect'); var $ripple = $(".ripple-effect"); $ripple.css("height", $(this).height()); $ripple.css("width", $(this).height()); $div.css({ top: yPos - ($ripple.height() / 2), left: xPos - ($ripple.width() / 2), background: $(this).data("ripple-color") }) .appendTo($(this)); window.setTimeout(function() { $div.remove(); }, 2000); }); }); })(window, jQuery); body { text-align: center; } button { position: relative; border: none; outline: none; cursor: pointer; background: #89669b; color: white; padding: 18px 60px; border-radius: 2px; font-size: 22px; } .fab { border-radius: 50%; margin: 0; padding: 20px; } .material { position: relative; color: white; margin: 20px auto; height: 400px; width: 500px; background: #f45673; } .ripple { overflow: hidden; } .ripple-effect { position: absolute; border-radius: 50%; width: 50px; height: 50px; background: white; animation: ripple-animation 2s; } @keyframes ripple-animation { from { transform: scale(1); opacity: 0.4; } to { transform: scale(100); opacity: 0; } } Material Design Ripple Material Design Buttons Just add the class ripple to anything and use the "data-ripple-color" property to set the ripple color Login Login My question is: can you change the JavaScript function code to AngularJS in the order not to use jQuery anymore and have the same result? The purpose is to use it in a main project. Thank you in advance.
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29988905
type: AnsweredQuestion
score: 1
tagged with: css
favorite count: 0
tagged with: angularjs
type: Question

http://stackoverflow.com/a/29886638
answers question: http://stackoverflow.com/q/29886600
score: 0
has body: It looks like you're resetting the value of $scope.total when it lands on the /total route. ng-init can be used to initialize the value of total outside of the controller
type: Answer

http://stackoverflow.com/comment/47842240
type: QuestionComment
has text: what does `.popuplateElement` do? is that async?
score: 0
comment on: http://stackoverflow.com/q/29857911
type: Comment

http://stackoverflow.com/a/41762634
answers question: http://stackoverflow.com/q/29894997
has body: I managed to solve most problems supporting overflow: auto and overflow: scroll on mobile Safari: without hanging the scroll view after touching at the beginning of list, then moving down and then up (mobile Safari runs its default bouncing behavior for the whole page in that case) support for fixed header / action bar on top without ugly overlapping of it by a scrollbar window.addEventListener('DOMContentLoaded', function () { var atTop = true; var atBottom = false; var body = document.getElementById('fixedBody'); body.addEventListener('touchmove', function(event){ event.preventDefault(); }); body.addEventListener('touchstart', function(event){ event.preventDefault(); }); body.addEventListener('touchend', function(event){ event.preventDefault(); }); var scrollingDiv = document.getElementById('scrollDiv'); if (scrollingDiv.scrollHeight <= scrollingDiv.clientHeight) { atBottom = true; } scrollingDiv.addEventListener('scroll', function(event){ if (event.target.scrollTop === 0) { atTop = true; } else { atTop = false; } if (event.target.scrollHeight - event.target.scrollTop === event.target.clientHeight) { atBottom = true; } else { atBottom = false; } }); var lastY = 0; var topLock = false; var bottomLock = false; scrollingDiv.addEventListener('touchmove', function(event){ event.stopPropagation(); var currentY = event.touches[0].clientY; if (currentY > lastY) { // moved down if (atTop) { event.preventDefault(); topLock = true; } if (bottomLock) { bottomLock = false; // TODO: Emulate finger remove and touch again here } } else if(currentY < lastY){ // moved top if (atBottom) { event.preventDefault(); bottomLock = true; } if (topLock) { topLock = false; // TODO: Emulate finger remove and touch again here } } lastY = currentY; }); scrollingDiv.addEventListener('touchstart', function(event){ lastY = event.touches[0].clientY; event.stopPropagation(); }); scrollingDiv.addEventListener('touchend', function(event){ event.stopPropagation(); }); }); Header First Second Third Anot…
score: 0
has comment: http://stackoverflow.com/comment/70718533
type: Answer

http://stackoverflow.com/q/29907609
favorite count: 0
has answer: http://stackoverflow.com/a/29908056
has answer: http://stackoverflow.com/a/29907770
has title: How to keep active class when changing pages
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion
score: 2
accepted answer: http://stackoverflow.com/a/29907780
linked to: http://stackoverflow.com/q/2010892
has body: I am trying to add an active class to nav item, depending what page your on. I am using this script: &lt;script type="text/javascript"&gt; $(document).ready(function () { $("#side-bar a").click(function () { var id = $(this); $(id).siblings().find(".active").removeClass("active"); $(id).addClass("active"); localStorage.setItem("selectedolditem", id); }); var selectedolditem = localStorage.getItem('selectedolditem'); if (selectedolditem !== null) { $(selectedolditem).siblings().find(".active").removeClass("active"); $(selectedolditem).addClass("active"); } }); &lt;/script&gt; See full jsfiddle here: https://jsfiddle.net/ebo7hLo9/ It adds the active class, but it loads a new page, it disappears. What am I doing wrong?
upvote count: 2
linked to: http://stackoverflow.com/q/2090551
type: Question
has answer: http://stackoverflow.com/a/29907780
tagged with: javascript
answer count: 3
possible better answer: http://stackoverflow.com/a/29907770
downvote count: 0
tagged with: jquery

http://stackoverflow.com/a/29885388
downvote count: 0
has body: I noticed your using hashes (#) in your hrefs. Try changing the hashes (#) in your a hrefs to Javascript:void(0). Javascript:void(0); Hashes(#) in href will have an effect your pushState/popState.
answers question: http://stackoverflow.com/q/29850174
type: Answer
score: 4
upvote count: 4

http://stackoverflow.com/comment/48803743
type: Comment
has text: Out of interest, have you tried the data with different chart types? I had a stacked bar chart which overloaded the browser as it was many many rectangles being drawn to visualize a years worth of data. Switching to an Area chart saw a great improvement in responsiveness.
type: AnswerComment
comment on: http://stackoverflow.com/a/30354044
score: 0

http://stackoverflow.com/a/34744846
has body: You can try this your link http://jsfiddle.net/54ema4k0/
upvote count: 22
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/29888624
score: 22

http://stackoverflow.com/comment/47941254
type: Comment
type: QuestionComment
score: 0
has text: You have `<input type="button" name="Previous" value=" << " onClick="doPrevious()">`/` > " onClick="doNext()">`. I don't see a `function doPrevious()` or `function doNext()` anywhere in your code.
comment on: http://stackoverflow.com/q/29909392

http://stackoverflow.com/comment/48096342
type: AnswerComment
comment on: http://stackoverflow.com/a/29987718
type: Comment
has text: but textboxes in GUI, or the fields of customerfile?
score: 0

http://stackoverflow.com/q/30001598
has answer: http://stackoverflow.com/a/30001625
upvote count: 1
has body: How to add new span tag on before or after existing span tag. I know the existing span tag id. oldtext some para text... need output like below textnewcontent some para text...
score: 1
has title: How to add new span tag on before or after existing span tag
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/30001639
favorite count: 0
type: UnansweredQuestion

http://stackoverflow.com/comment/47825677
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29849507
has text: Yes indeed it is ab-initio and I didn't know location is unneccessary for that condition. Thanks a lot.

http://stackoverflow.com/a/29900955
upvote count: 1
downvote count: 0
type: Answer
has body: You can't pause a loop in Javascript (in any useful manner). Divide the work into showing five items at a time, and use setTimeout to start the next part after a delay: var test = ['1','2','3','4','5','6','7','8','9','10','11','12','13']; var index = 0; showItems(); function showItems() { for (var i = 0; i &lt; 5 &amp;&amp; index &lt; test.length; i++, index++){ console.log(test[index]); } if (index &lt; test.length) { window.setTimeout(showItems, 5000); } }
score: 1
answers question: http://stackoverflow.com/q/29900628

http://stackoverflow.com/a/29847086
downvote count: 0
type: Answer
score: 3
has body: No they are not same: Object(X) or new Object(X) are same as Object.create(X.prototype) Object(X) will create object and run Constructor( ie. the newly created object inherits from the constructor's prototype). Object.create(X.prototype) is creating object with additionally running Constructor. Object(X) or new Object(X) are not as Object.create() Object.create() is creating object without running Constructor( ie. it will create an object that doesn't inherit from anything)
answers question: http://stackoverflow.com/q/29846754
upvote count: 3

http://stackoverflow.com/comment/47836032
score: 0
has text: @PaulFitzgerald If I just paste the query in my browser with desired keyword and correct api I can get the JSON data inside the browser. The javascript code just pasre the data. So does not really need to paste it. If you Still want I can but seems unnecessary.
comment on: http://stackoverflow.com/q/29854888
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29896175
score: 0
has body: use a JQ toggle class $('#slider').toggleClass('sliderthing'); that plus CSS to give it looks and stuff should work well
type: Answer
answers question: http://stackoverflow.com/q/29895399

http://stackoverflow.com/q/29880735
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29881259
tagged with: slick.js
score: 8
favorite count: 0
upvote count: 8
has body: I'm using Slick.js For some reason I can't seem to get the dots to show. This is what I have. HTML Markup Calling and options $(document).ready(function(){ $('.single-item').slick({ dots: true, infinite: true, speed: 500, }); }); Weirdly it groups the images into a slideshow. If I test whether it's working with autoplay the carousel works. The dots are just not showing, even though I call them. style.css CSS in a Fiddle here
has answer: http://stackoverflow.com/a/41602659
answer count: 4
type: AnsweredQuestion
type: Question
has title: Slick JS not showing dots
has answer: http://stackoverflow.com/a/47937651
accepted answer: http://stackoverflow.com/a/29881259
downvote count: 0
tagged with: javascript
possible better answer: http://stackoverflow.com/a/41602659
has answer: http://stackoverflow.com/a/49665803

http://stackoverflow.com/comment/47896820
type: AnswerComment
score: 0
type: Comment
has text: I reversed the order of the conditional statements and it worked. Thanks
comment on: http://stackoverflow.com/a/29886266

http://stackoverflow.com/comment/47905127
type: QuestionComment
has text: i found this http://www.directionsmag.com/site/latlong-converter/
comment on: http://stackoverflow.com/q/29890491
score: 0
type: Comment

http://stackoverflow.com/a/29890732
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29888585
has body: You can get Isotope instance like this $container.data('isotope') And this has property $filteredAtoms, which holds filtered items. So to get count, use this: var visibleItemsCount = $container.data('isotope').$filteredAtoms.length; For V2 var visibleItemsCount = $container.data('isotope').filteredItems.length; And after filtering, check for visible items. If has some, hide message, show otherwise. // Function to check if filters have some results function checkResults(){ var visibleItemsCount = $container.data('isotope').$filteredAtoms.length; if( visibleItemsCount > 0 ){ $('.no-results').hide(); } else{ $('.no-results').show(); } } // Isotope Steinlexikon $(function() { var $container = $('#lexikon-masonry'), $select = $('#lexikon-filter select'), filters = {}; var qsRegex; var SelectFilter = '*'; $container.isotope({ itemSelector: '.item', // Filter mit Suchfeld filter: function() { var $this = $(this); var SerRes = qsRegex ? $(this).text().match( qsRegex ) : true; var SelRes = SelectFilter == '' || $(this).is(SelectFilter); return SerRes && SelRes; } }); // use value of search field to filter var $quicksearch = $('#quicksearch').keyup( debounce( function() { qsRegex = new RegExp( $quicksearch.val(), 'gi' ); $container.isotope(); checkResults(); }, 200 ) ); // debounce so filtering doesn't happen every millisecond function debounce( fn, threshold ) { var timeout; return function debounced() { if ( timeout ) { clearTimeout( timeout ); } function delayed() { fn(); timeout = null; } timeout = setTimeout( delayed, threshold || 100 ); } } // Function to check if filters have some results function checkResults(){ var visibleItemsCount = $container.data('isotope').$filteredAtoms.length; console.log(filters); if( visibleItemsCount > 0 ){ $('.no-results').hide(); } else{ $('.no-results').show(); } } //fancybox $('.fancybox2').on('click', function(e){ e.preventDefault(); // Default action ausschalten $.fancybox({ //width: 500, //height: 400, autoSize: true, href: $(this).a…
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/47910712
has comment: http://stackoverflow.com/comment/47905910
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47907916
has comment: http://stackoverflow.com/comment/62703385
type: Answer
answers question: http://stackoverflow.com/q/29888585

http://stackoverflow.com/comment/48051648
comment on: http://stackoverflow.com/q/29964962
type: QuestionComment
has text: @ilter i declare it under the sortStudentNumbers function, `var student = studentNumbersArray.name;`
score: 0
type: Comment

http://stackoverflow.com/q/29859380
has answer: http://stackoverflow.com/a/29859470
tagged with: javascript
has body: I want create paging link for my grid.I pass maxPages(number) property to component but i cant use for in render method. What can i do ? var Pagination = React.createClass({ render: function(){ return( « {for (var i=0;i <10;i++;) { return( i + 1 ); } } » ); }});
duplicate of: http://stackoverflow.com/q/44057422
linked to: http://stackoverflow.com/q/22876978
favorite count: 0
has answer: http://stackoverflow.com/a/29859482
score: 51
downvote count: 0
type: Question
type: AnsweredQuestion
upvote count: 51
accepted answer: http://stackoverflow.com/a/29859470
has title: For loop in react render method
duplicate of: http://stackoverflow.com/q/22876978
tagged with: reactjs
answer count: 2
possible better answer: http://stackoverflow.com/a/29859482

http://stackoverflow.com/a/29889724
score: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/47905769
type: Answer
has comment: http://stackoverflow.com/comment/47907010
upvote count: 1
answers question: http://stackoverflow.com/q/29889163
has body: My guess is that they want you to update the data and render the template everytime there is an event that changes the DOM state. HTML: first second Javascript: (certain parts must be run after DOM is ready) var compile = _.template(document.getElementById('gridtemplate').innerHTML); var data = { rows: [ { columns: [1,2], background: '#fff' }, { columns: [3,4], background: '#ff0' } ] }; function render() { document.getElementById('container').innerHTML = compile(data); } render(); document.getElementById('highlight-choice').addEventListener('change', function() { _.each(data.rows, function(row) { row.background = '#fff'; }); data.rows[this.value].background = '#ff0'; render(); }); jsFiddle

http://stackoverflow.com/comment/47990957
has text: Where is `selected` class added?
type: Comment
score: 0
comment on: http://stackoverflow.com/q/29933753
type: QuestionComment

http://stackoverflow.com/a/29973821
type: Answer
answers question: http://stackoverflow.com/q/29973559
accepted answer of: http://stackoverflow.com/q/29973559
has body: HTML DECODE: function codeschutz_decode(s, delta) { var temp = ""; var temp, neu; for (var i = 0; i < s.length; i++) { alt = s.CharCodeAt(i); if (alt >= 65 && alt <= 90) { neu = alt - delta; if (neu < 65) { neu += 26; } } else if (alt >= 97 && alt <= 122) { neu = alt - delta; if (neu < 97) { neu += 26; } } else { neu = alt; } temp += String.formCharCode(neu); } return temp; } ENCODE: function codeschutz_encode(s, delta) { var temp = ""; var alt, neu; for(var i = 0; i < s.length; i++) { alt = s.charCodeAt(i); if(alt >= 65 && alt <= 90) { neu = alt + delta; if(neu > 90) { neu -= 26; } } else if (alt >= 97 && alt <= 122) { neu = alt + delta; if (neu > 122) { neu -= 26; }; } else { neu = alt; } temp += String.formCharCode(neu); } return temp; }
score: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/48067388

http://stackoverflow.com/a/29943613
type: Answer
has body: I guess first of all it would be good to extend your SQL query with the GROUP BY function or at least the ORDER function. After that you have to do a so called group change in your php code like in the following example code: $school = ''; foreach ($data as $row) { // here 's the group change if ($school != $row['school_name'])) { $school = $row['school_name']; // header output echo $row['school_name']; } // output of the other data echo $row['blah']; }
accepted answer of: http://stackoverflow.com/q/29943407
score: 0
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29943407

http://stackoverflow.com/q/29968226
answer count: 3
downvote count: 0
accepted answer: http://stackoverflow.com/a/29968282
favorite count: 0
has body: I have an MVC-project where I store data in a database and one of my views contains textboxes to edit this data. Because of the specifics I can't create the textboxes directly via TextBoxFor(), EditorFor() etc. but have to affect the value with JavaScript, so what i do is write the needed value in the javascript code at page loading, and this code is later on triggered to affect the textbox value. $("#textboxID").val("@HTML.Raw(Model.value)"); This workes fine until one of strings has got quotes in it. When i input it directly like $("#textboxID").val("@Model.value"); it will be HTML-encoded with the quotes written as &gt; &amp; quot; (without space of cource) What i found out is that the only way to output quotes correctly is by escaping them with backslash \ however i can't seem to find a helper to do that. Is there a solution? Am i doing anything wrong? For now, i found a workaround inspired by Filipe Borges suggestion @Html.Raw(Html.Encode(Model.Libelle).Replace("&amp;quot;", "\\\"")) It's very ugly, but at least it solves the problem, I appreciate anyone suggesting a better solution.
score: 2
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/29970386
upvote count: 2
has answer: http://stackoverflow.com/a/29970386
has title: JavaScript: how to set a value containing quotes inside a textbox
type: Question
has answer: http://stackoverflow.com/a/29968282
tagged with: javascript
has answer: http://stackoverflow.com/a/29968469
tagged with: asp.net-mvc-5

http://stackoverflow.com/a/29903717
score: 0
has body: If you get [Object object] by doing : var burbs = JSON.parse(data);//alerting this will definitely present [Object object] Then everything seems to be fine. You are parsing the data and this will be converted to a json object. If you want to view the response data use : var burbs = JSON.stringify(data);//converts the object to a string alert(burbs); Also probably you want to get the values by accessing the keys of each object within the object array: //lets imagine this is our response data, which can also be the response data you parsed with JSON.parse(data); var data = [{"1":"Halfway House"},{"2":"Noordwyk"},{"3":"Vorna Valley"}]; function iterate(data) { for(var i=0;i&lt;data.length;i++) { for(var i=0;i&lt;data.length;i++) { for(var key in data[i]) { var value = data[i][key]; $('#applicant-suburb').append('&lt;option value="'+key+'"&gt;'+value+'&lt;/option&gt;'); } } } }
type: Answer
answers question: http://stackoverflow.com/q/29901933

http://stackoverflow.com/comment/47929496
has text: oh, it did work before... i mustve changed something.
comment on: http://stackoverflow.com/q/29902837
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/48065797
score: 0
comment on: http://stackoverflow.com/q/29969371
type: Comment
type: QuestionComment
has text: You're never calling the callback with an error. On line 12 you call 'callback()', with no arguments, meaning that 'error' will be undefined. That is why it never reaches the part of the if that would handle an error.

http://stackoverflow.com/comment/48114974
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29992729
type: Comment
has text: Okay no problem, i updated my answer with a new paragraph, i think this addresses what you're asking.

http://stackoverflow.com/a/29919636
score: 0
has body: If it's compilation issue, then you can try something like this: //instead of link: compile: function (e) { e.trigger('create'); return { post: function(scope, element, attrs) { console.log(element.prop('offsetHeight')); scope.$watch(function() { return [element[0].clientHeight].join('x'); }, function(value) { var currentHeight = parseInt(value.split('x')); var currentMarginTop = ($window.innerHeight - currentHeight) / 2; element.css('margin-top', currentMarginTop + "px"); }); } } }
answers question: http://stackoverflow.com/q/29918537
type: Answer

http://stackoverflow.com/q/29980765
tagged with: css
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/48081220
accepted answer: http://stackoverflow.com/a/29982832
type: Question
has comment: http://stackoverflow.com/comment/48081374
has title: Element scrollHeight not updating after setting inner element's display to 'none'?
answer count: 1
has comment: http://stackoverflow.com/comment/48081249
tagged with: javascript
has comment: http://stackoverflow.com/comment/48084895
tagged with: jquery
score: 0
has comment: http://stackoverflow.com/comment/48081500
has body: I am trying to create a bootstrap type navbar using angularJS 1.3.14 for learning purposes. I have a navbar, and navmenu, navMenuToggle and navDropDown directives. The navMenu is a logical grouping for the toggle and dropdown menu. Brand Toggle Button First Link Second Link The problem is that when I 'expand' the navbar, and double click the toggle button, the navbar's height does not adjust back when the menu is closed. Here is a JS Fiddle (make the window < 798px): http://jsfiddle.net/5st3h30j/3/ The toggle() function in the navMenu contracts and expands the dropdown via setting the display to none or block and then it lets the navbar know via $scope.$parent.$parent.$broadcast('dropdownClosed') which then triggers the setting of the height to the new scroll height. navDropdown Controller: $scope.toggle = function () { if ($scope.open) { console.log('closing dropdown'); $scope.contract(); $scope.open = false; $scope.$parent.$parent.$broadcast('dropdownClosed'); } else { $scope.$parent.$parent.$broadcast('dropdownOpening'); $scope.expand(); $scope.open = true; $scope.$parent.$parent.$broadcast('dropdownOpened'); // broadcast from navbar's scope to reach all dropdowns } navbar: Controller: $scope.$on('dropdownClosed', function () { $scope.adjustHeight(); }); Link Function: scope.adjustHeight = function () { console.log('adjusting height'); var height = element.prop('scrollHeight'); element.css('-webkit-transition', 'height 0s'); element.css('height', height + "px"); navbarCtrl.expanded = true; } I dropped in console.logs and the dropdown is definately contracted before the height is adjusted. Note: I am aware this does not work for big screens. I will add some if-statements later. Better ways to do this are appreciated but I am also quite desperate to know why adjustHeight succeeds when expanding but not contracting.
has comment: http://stackoverflow.com/comment/48081290
has answer: http://stackoverflow.com/a/29982832
tagged with: angularjs

http://stackoverflow.com/comment/47831704
type: QuestionComment
has text: Well, you didn't say not to use `eval`, so you could use `eval` on the string produced by `join`, but that is best to avoid in general. However, your use case sounds like a special case, as you are recreating a built-in function.
score: 0
type: Comment
comment on: http://stackoverflow.com/q/29852735

http://stackoverflow.com/comment/48006057
comment on: http://stackoverflow.com/a/29921541
type: Comment
score: 0
type: AnswerComment
has text: You want to do it as your own! ;), this is a good iniative, I like it! :)

http://stackoverflow.com/q/29935094
tagged with: click
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/29936169
has comment: http://stackoverflow.com/comment/47992380
has answer: http://stackoverflow.com/a/29935155
type: UnansweredQuestion
has body: my main intention is to open windows separately not tabs in single click on all browsers so below is the code which work successfully with single click and opens single window, i need to open multiple window with same code. Please modify it to open multiple tabs. my popup Any method will be appreciated. thanks in advance
type: Question
has title: one click separate windows in javascript
has answer: http://stackoverflow.com/a/29935414
tagged with: javascript

http://stackoverflow.com/q/29873733
has body: I have fetched data from ajax like UPDATE var a = document.createElement('a'); a.setAttribute('id', tr_job_room); a.setAttribute('onclick', 'getGroupsData(this.id)'); var audioLength; var ul_ul_li_a = document.createElement('a'); ul_ul_li_a.setAttribute('class', 'dropdown-toggle'); ul_ul_li_a.setAttribute('href', '#'); ul_ul_li_a.innerHTML = "Audios"; ul_ul_li_a.setAttribute('id', tr_job_room); if (audioLength &gt; 0) { alert("audiolength"+audioLength); $(ul_ul_li_a).on('click', function () { alert(audioLength+"sdasds"); varid = this.id; audiosPlay(varid); scriptpanel(); getTxtData(); }); } and ajax is: // DISPLAY GROUPS DATA function getGroupsData(arg) { $.ajax( { type: "POST", url: '@Url.Action("getGroupsData")', dataType: "json", mtype: "post", data: { arg: arg }, async: true, success: function (data) { audioLengh = data.groups[0].audio.length; audioDisplay(arg, data.groups[0].audio.length, data.groups[0].audio); } }); } Is this the correct way to fetch data? I am not getting audioLength value in if block Any suggestion?
accepted answer: http://stackoverflow.com/a/29873963
has comment: http://stackoverflow.com/comment/47872352
has comment: http://stackoverflow.com/comment/47872615
has comment: http://stackoverflow.com/comment/47872430
type: Question
has comment: http://stackoverflow.com/comment/47873200
has title: Call ajax from dynamic generated tag and fetch value from ajax
downvote count: 0
has comment: http://stackoverflow.com/comment/47872528
tagged with: javascript
tagged with: jquery
tagged with: ajax
answer count: 1
score: 1
favorite count: 0
upvote count: 1
has comment: http://stackoverflow.com/comment/47872573
has comment: http://stackoverflow.com/comment/47872726
has answer: http://stackoverflow.com/a/29873963
has comment: http://stackoverflow.com/comment/47872503
type: AnsweredQuestion

http://stackoverflow.com/a/29972322
has comment: http://stackoverflow.com/comment/129530469
has comment: http://stackoverflow.com/comment/97304752
answers question: http://stackoverflow.com/q/29971898
has comment: http://stackoverflow.com/comment/93912637
has body: Why is it not accurate? Because you are using setTimeout() or setInterval(). They cannot be trusted, there are no accuracy guarantees for them. They are allowed to lag arbitrarily, and they do not keep a constant pace but tend to drift (as you have observed). How can I create an accurate timer? Use the Date object instead to get the (millisecond-)accurate, current time. Then base your logic on the current time value, instead of counting how often your callback has been executed. For a simple timer or clock, keep track of the time difference explicitly: var start = Date.now(); setInterval(function() { var delta = Date.now() - start; // milliseconds elapsed since start … output(Math.floor(delta / 1000)); // in seconds // alternatively just show wall clock time: output(new Date().toUTCString()); }, 1000); // update about every second Now, that has the problem of possibly jumping values. When the interval lags a bit and executes your callback after 990, 1993, 2996, 3999, 5002 milliseconds, you will see the second count 0, 1, 2, 3, 5 (!). So it would be advisable to update more often, like about every 100ms, to avoid such jumps. However, sometimes you really need a steady interval executing your callbacks without drifting. This requires a bit more advanced strategy (and code), though it pays out well (and registers less timeouts). Those are known as self-adjusting timers. Here the exact delay for each of the repeated timeouts is adapted to the actually elapsed time, compared to the expected intervals: var interval = 1000; // ms var expected = Date.now() + interval; setTimeout(step, interval); function step() { var dt = Date.now() - expected; // the drift (positive for overshooting) if (dt > interval) { // something really bad happened. Maybe the browser (tab) was inactive? // possibly special handling to avoid futile "catch up" run } … // do what is to be done expected += interval; setTimeout(step, Math.max(0, interval - dt)); // take into account drift }
has comment: http://stackoverflow.com/comment/122953054
has comment: http://stackoverflow.com/comment/75679308
has comment: http://stackoverflow.com/comment/75675544
has comment: http://stackoverflow.com/comment/59187623
has comment: http://stackoverflow.com/comment/76246274
has comment: http://stackoverflow.com/comment/65657548
has comment: http://stackoverflow.com/comment/59206935
upvote count: 268
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/86831163
downvote count: 0
has comment: http://stackoverflow.com/comment/93912983
has comment: http://stackoverflow.com/comment/86826904
has comment: http://stackoverflow.com/comment/122954415
has comment: http://stackoverflow.com/comment/97225776
has comment: http://stackoverflow.com/comment/97226281
score: 268
has comment: http://stackoverflow.com/comment/59174505
has comment: http://stackoverflow.com/comment/108834796
has comment: http://stackoverflow.com/comment/108833383
type: Answer
has comment: http://stackoverflow.com/comment/59167497
has comment: http://stackoverflow.com/comment/65657358
accepted answer of: http://stackoverflow.com/q/29971898
has comment: http://stackoverflow.com/comment/76257083

http://stackoverflow.com/q/30001920
tagged with: javascript
has comment: http://stackoverflow.com/comment/48122572
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/30002206
tagged with: ajax
has comment: http://stackoverflow.com/comment/48418362
has comment: http://stackoverflow.com/comment/48122422
has answer: http://stackoverflow.com/a/30099884
has comment: http://stackoverflow.com/comment/48408860
type: UnansweredQuestion
tagged with: php
upvote count: 27
has answer: http://stackoverflow.com/a/30072154
score: 25
tagged with: pdo
has comment: http://stackoverflow.com/comment/48250307
has answer: http://stackoverflow.com/a/30141696
has answer: http://stackoverflow.com/a/30184194
has comment: http://stackoverflow.com/comment/48122493
type: Question
answer count: 8
has title: AJAX function is not working by scroll
has answer: http://stackoverflow.com/a/30058196
has comment: http://stackoverflow.com/comment/48311216
has answer: http://stackoverflow.com/a/30189661
downvote count: 2
linked to: http://stackoverflow.com/q/13278559
has answer: http://stackoverflow.com/a/30002091
has body: Using AJAX for endless scroll. Content loads only first time, but does't load by scroll. What is wrong? jQuery: function loadFeed() { $.ajax({ url: 'loadmore.php', dataType: 'html', success: function (data) { $("#posts").append('&lt;div class="havanagila"&gt;&lt;/div&gt;'); $('#posts').html(data); } }); } loadFeed(); $(window).scroll(function () { var windowScroll = $(window).scrollTop(); var windowHeight = $(window).height(); var documentHeight = $(document).height(); if ((windowScroll + windowHeight) == documentHeight) { loadFeed(); } }); loadmore.php: &lt;?php session_start(); if ( isset( $_SESSION['login'] ) ) { $login = $_SESSION['login']; $id=$_SESSION['id']; $username="root"; $password="root"; $hostname = "localhost"; $dbname= "kotik"; function testdb_connect ($hostname, $username, $password){ $dbh = new PDO("mysql:host=$hostname;dbname=kotik", $username, $password); return $dbh; } try { $dbh = testdb_connect ($hostname, $username, $password); } catch(PDOException $e) { echo $e-&gt;getMessage(); } } ?&gt; &lt;?php $title_select_query= $dbh -&gt; prepare("SELECT title FROM books WHERE id = :id ORDER BY date DESC"); $title_select_query -&gt;execute(array(':id' =&gt; $id)); $title_select_query_result = $title_select_query-&gt;fetchColumn(); echo($title_select_query_result); $title_select_query_result = $title_select_query-&gt;fetchColumn(); echo($title_select_query_result); $title_select_query_result = $title_select_query-&gt;fetchColumn(); echo($title_select_query_result); $title_select_query_result = $title_select_query-&gt;fetchColumn(); echo($title_select_query_result); $title_select_query_result = $title_select_query-&gt;fetchColumn(); echo($title_select_query_result); ?&gt;

http://stackoverflow.com/comment/47849230
type: QuestionComment
score: 3
comment on: http://stackoverflow.com/q/29861597
has text: When learning math, you wouldn't understand much if you started with linear algebra. To understand jQuerys Extended Events, you probably need to have a good understanding of normal js, jQuery and events first. Maybe you have, I wouldn't know, but the link to the official documentation explains it quite well. Still, interesting if someone could put it in newbie-terms :)
type: Comment

http://stackoverflow.com/comment/47928702
comment on: http://stackoverflow.com/a/29895850
type: AnswerComment
score: 0
type: Comment
has text: Also, chaining *per se* doesn't slow things down. It's better to chain than to start several consecutive lines with `$(this)`.

html-parsing
tags question: http://stackoverflow.com/q/29944754
tags question: http://stackoverflow.com/q/29852143
tag name: html-parsing
type: Tag

http://stackoverflow.com/a/29977237
type: Answer
score: 2
accepted answer of: http://stackoverflow.com/q/29977149
type: AcceptedAnswer
downvote count: 0
has body: Your problem is you're appending, but then setting display to none every time rather than removing it, so you end up with duplicate elements of the same id, and only select the first one which is already hidden. Instead of setting display to none, remove it: var cleanAlert = setTimeout(function(){ $('#confrimedLuck').remove() }, 3000); Or if you prefer, you can keep it always present in the DOM while simply toggling its display property (most conveniently with jQuery, since you're already using it). // missing if(!result) { $(".confirmAlert").append('class="alert alert-danger" role="alert"&gt;Oh snap! Something went terribly wrong!&lt;/div&gt;'); } else { var confPop = $("#confrimedLuck").show().parent(); console.log("confPop BANG!"); } var cleanAlert = setTimeout(function(){ $('#confrimedLuck').hide() }, 3000); console.log("cleanAlert executed!");
answers question: http://stackoverflow.com/q/29977149
has comment: http://stackoverflow.com/comment/48074830
upvote count: 2

http://stackoverflow.com/q/29916979
has answer: http://stackoverflow.com/a/29917070
downvote count: 4
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47955229
favorite count: 0
tagged with: ajax
has title: How often should AJAX reload specific content on the page?
accepted answer: http://stackoverflow.com/a/29917070
score: -1
type: AnsweredQuestion
upvote count: 3
type: Question
has body: I'm constructing an app where users can insert their preferences in a table. It is possible to load an updated version of the table via AJAX. I would like to load these updated versions from time to time, so the users will see almost always the newest version of the table, without reloading the page by themself. My questions regarding that are: How often should the browser of the user request via AJAX a new version of the table? Is that a bad approach? Maybe users want to reload the page manually. Thank you for any answer in advance. Let me know how I can improve my question.
tagged with: settimeout
tagged with: reload

http://stackoverflow.com/a/29991939
answers question: http://stackoverflow.com/q/29991874
type: Answer
score: 1
upvote count: 1
has body: #(.*?)# or #([^#]+)# Simply use this and grab the group 1.See demo. https://regex101.com/r/uE3cC4/14 var re = /#(.*?)#/gm; var str = 'bazbarfoo#asad#'; 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. }
downvote count: 0

http://stackoverflow.com/comment/47999336
comment on: http://stackoverflow.com/q/29938445
score: 0
has text: It depends what you want to do with the data. If you want to build a new view with the passed variable you can just call the php page with params and the page will be refreshed. Or you can do a simple AJAX request to the php page and store the variables in a database or something.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29957791
tagged with: http://stackoverflow.com/tag/html
tagged with: css
favorite count: 0
score: 2
answer count: 0
upvote count: 2
type: UnansweredQuestion
has body: The carousel constantly moves and clones. When you mouse over/scroll, it removes every blue block before the red marked block. The red marked block is a reference point; when the red marked block switches, the previous block that it was just on, was the one that was cloned and appended to the bottom of the carousel. When I scroll my mouse so that it reaches the end point of my carousel, and mouseleave the carousel; it should add duplicate slides at the end of the carousel. Instead, it has a gap below the blue blocks. I'm trying to get it so no gap appears. I'm unsure how to clone immediately the correct one when I mouseleave the carousel after the user reaches the carousel's bottom. When I scroll up to the beginning of my carousel and mouseleave the carousel, the red marker box switches to it early; I'm trying to make it so that when the red box is 100% covered by the gray up arrow box, it switches to next one down, and the cycle repeats (like in the beginning when the carousel first started). Only difference is I need this happening correctly, after I scroll around on it. I've tried switching the "marker" so that whenever one scrolls, whatever blue block's offset top position was in the range between 35 (to account for the height of the top gray box) and the negative height of a blue block plus 35, that would be the new marker; and then when you mouseleave the carousel with the new marker in place, to create the new clones without seeing carousel content that cut off. I could not achieve this. Order doesn't matter as long as the unique six are the only ones in there when scrolling. For JSFiddle, I tried to resize the Result part of the window so four blocks fit in there just to replicate the problem. The code should scale the contents so only four should appear at a time; but I had some trouble with JSFiddle. You may resize the Result pane to fit the four blocks to better emulate the problem. For the JavaScript code in JSFiddle, jump down to line 223. Everything ab…
has title: Moving/self cloning carousel - Scrolling over interrupts the duplicate cloning/help on duplicating after scroll
type: Question
downvote count: 0
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/a/29895777
type: Answer
has comment: http://stackoverflow.com/comment/47923784
answers question: http://stackoverflow.com/q/29895590
has body: How about this: $('.finheader').click(function(e){ $('.finbody').slideUp(); $(this).next().slideDown(); console.log('Slide Down'); }); https://jsfiddle.net/28gug87k/
score: 0

http://stackoverflow.com/comment/47827495
type: Comment
type: QuestionComment
has text: `('#sick_day').val();` is not a function, but `$('#sick_day').val();` might well be.
score: 0
comment on: http://stackoverflow.com/q/29850690

http://stackoverflow.com/q/29873458
has comment: http://stackoverflow.com/comment/47872020
has comment: http://stackoverflow.com/comment/47871969
type: Question
has comment: http://stackoverflow.com/comment/47871929
has answer: http://stackoverflow.com/a/29873541
tagged with: javascript
has body: This may seem too trivial but I have tried all possible methods async=true (onreadystatechange) async=false (xmlhttp open) source http://www.w3schools.com/dom/dom_httprequest.asp 3.xmlhttp.open("GET","http://"+location.host+"/cd_catalog.xml",false) source Open XML and display data in div basically what I want is for javascript and xml in the same folder and use javascript to return values. The actual program I am working on: var xmlSolver = function MakeXmlSolver(){}; xmlSolver.GetAllAuthorsInStock()=function() { var author=xmlDoc.getElementsByTagName ("author").childNodes.nodeValue; return author; }; xmlSolver.GetAllBooksInStock()=function() { var title=xmlDoc.getElementsByTagName ("title").childNodes.nodeValue; } and the xml <?xml version='1.0'?> The Gorgias Plato 9.99 The Autobiography of Benjamin Franklin Benjamin Franklin 8.99 The Confidence Man Herman Melville 11.99 Oryx and Crake Margaret Atwood 11.99 The Republic Plato 7.99
has title: xml not retrived by javascript
score: 0
answer count: 1
linked to: http://stackoverflow.com/q/7004633
tagged with: http://stackoverflow.com/tag/xml
has comment: http://stackoverflow.com/comment/47871992
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47871959
has comment: http://stackoverflow.com/comment/47871945
has comment: http://stackoverflow.com/comment/47871958

http://stackoverflow.com/q/29936078
answer count: 0
score: 1
has comment: http://stackoverflow.com/comment/47997886
has comment: http://stackoverflow.com/comment/47994464
upvote count: 1
has comment: http://stackoverflow.com/comment/47996769
has comment: http://stackoverflow.com/comment/47997578
type: Question
tagged with: mongodb
tagged with: mongoose
tagged with: javascript
has comment: http://stackoverflow.com/comment/47995981
has title: Mongoose: Cannot call method 'push' of undefined, on nested Schema
downvote count: 0
favorite count: 0
has body: I set up my schema like so: var videoSchema = new Schema({ title: String, url: String, //Link to the video rating: { type: Number, default: 0}, description: String //a paragraph or two to go along with the video }); var tutorialPageSchema = new Schema({ title: String, //IE Peeking, Clutching, etc. tutorials: [videoSchema] }); var categorySchema = new Schema({ title: String, //intermediate, beginner, config, map knowledge, etc. pages: [tutorialPageSchema] }); exports.Video = mongoose.model('video', videoSchema); exports.TutorialPage = mongoose.model('tutorialPage', tutorialPageSchema); exports.Category = mongoose.model('category', categorySchema); Add the document like so: var newPage = new models.TutorialPage({ title: req.query.page.title, tutorials: [] }); parentCategory.pages.push(newPage); In return, it gives me a nice "TypeError: Cannot call method 'push' of undefined " Other times the question was asked, people didn't load the schemas in the correct order or conflated the Model with the Schema when setting the schema up, but that doesn't seem to be my problem. What gives?
type: UnansweredQuestion
tagged with: node.js
has comment: http://stackoverflow.com/comment/47996377

header
type: Tag
tag name: header
tags question: http://stackoverflow.com/q/29896314

http://stackoverflow.com/a/29862285
accepted answer of: http://stackoverflow.com/q/29862140
upvote count: 1
type: AcceptedAnswer
downvote count: 0
score: 1
has body: Instead of using progress_type[] as the names for your radio buttons, use progress_type[id], where you replace id with the index of that section of the form. Then when you're processing the parameters, you can use $_POST['progress_type'][$id] to get that block's selection.
type: Answer
answers question: http://stackoverflow.com/q/29862140

http://stackoverflow.com/q/29986905
has answer: http://stackoverflow.com/a/29990606
tagged with: gruntjs
has body: Im trying to use an array to use as files names in Grunt I have an array looks like this. var myElements = [ 'elementOne', 'elementTwo', 'elementThree' ] I would like to access the elements within the array above like this but it doesn't work. sass: { dist: { files: { myElements[0] : '/scss/elementOne.scss', myElements[1] : '/scss/elementTwo.scss', myElements[2] : '/scss/elementTwo.scss', } } }
score: 0
answer count: 2
has title: Access elements within an array inside a object in Grunt
has answer: http://stackoverflow.com/a/29987158
tagged with: javascript
type: UnansweredQuestion
type: Question
tagged with: sass

http://stackoverflow.com/comment/47933550
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/29895235
has text: @user5321531: Yes, but a class with only static methods needs no instantiations :-)
type: Comment

http://stackoverflow.com/a/29917072
has comment: http://stackoverflow.com/comment/47959066
has comment: http://stackoverflow.com/comment/47959674
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/47961217
score: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/47955981
has body: You just need to split the acronym into letters, and map each letter to an array of words. Here's the jsFiddle. function findWordsForAcronym(acronym) { var words = { 'a': [], 'b': [], 'c': [], 'd': [], 'e': ['Echo', 'Evening'], 'f': [], 'g': ['Ghost', 'Garden'], 'h': [], 'i': [], 'j': [], 'k': [], 'l': [], 'm': [], 'n': [], 'o': [], 'p': [], 'q': [], 'r': ['Rodent', 'Ronald'], 's': [], 't': [], 'u': [], 'v': [], 'w': [], 'z': [], 'y': [], 'z': [] }; return acronym.toLowerCase().split('').map( function(letter){ return words[letter][parseInt(Math.random()*words[letter].length)]; } ).join(' '); } findWordsForAcronym('REG'); // "Rodent Echo Garden"
has comment: http://stackoverflow.com/comment/47960446
answers question: http://stackoverflow.com/q/29916816

http://stackoverflow.com/comment/47959608
type: Comment
has text: Hope above link helps. and you mark it as answer if it solved your issue.
type: AnswerComment
comment on: http://stackoverflow.com/a/29918875
score: 0

http://stackoverflow.com/q/29931998
has answer: http://stackoverflow.com/a/29935105
tagged with: state
downvote count: 0
has body: I'm curious about the timing when I bind something to a promise. var that = this; function p(){ var promise = new Promise( function (yes, no) { /* .... */ /* .... */ }).then(function (val) { /* .... */ /* .... */ }.bind(this)); }.bind(this) Will the condition that === this allways return true, considering that the scope outside the promise is async and .then might be resolved way later in the lifecycle. In other words, will this have the same value as when the first function was called, or will it have the value as it is actually used in the .then part?
tagged with: javascript
has title: State of a bound parameter in a promise
tagged with: page-lifecycle
has comment: http://stackoverflow.com/comment/47986666
type: Question
has answer: http://stackoverflow.com/a/29934914
type: AnsweredQuestion
score: 3
favorite count: 0
upvote count: 3
answer count: 2
tagged with: lifecycle
accepted answer: http://stackoverflow.com/a/29934914
possible better answer: http://stackoverflow.com/a/29935105

http://stackoverflow.com/q/29918054
has title: Highcharts Y-axis title text length is more than chart's height
score: 0
tagged with: highcharts
answer count: 1
tagged with: jsp
tagged with: jquery
has body: I am working on highcharts. In my code, sometimes Y-axis title text is more than chart's height. Ex. I am create one chart. In this chart, height is 400px but my Y-axis title text is long so some part of the text is not display. so what can i do? see in jsfiddle
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47958376
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/47961014
has answer: http://stackoverflow.com/a/29938492

http://stackoverflow.com/comment/47890968
score: 0
type: Comment
comment on: http://stackoverflow.com/q/29883478
type: QuestionComment
has text: Try tu put this in JSfiddle

http://stackoverflow.com/a/30001586
answers question: http://stackoverflow.com/q/30001400
has body: Please check following: $(".deleteBtn").click(function () { $(this).parent().parent().fadeOut(); }); 0 X 1 X
score: 0
type: Answer

jsp
tags question: http://stackoverflow.com/q/29964621
tags question: http://stackoverflow.com/q/29876525
tags question: http://stackoverflow.com/q/29846632
tags question: http://stackoverflow.com/q/29966347
tags question: http://stackoverflow.com/q/29969792
tags question: http://stackoverflow.com/q/29878791
tags question: http://stackoverflow.com/q/29942173
tags question: http://stackoverflow.com/q/29880660
tags question: http://stackoverflow.com/q/29935032
type: Tag
tags question: http://stackoverflow.com/q/29980862
tags question: http://stackoverflow.com/q/29890318
tag name: jsp
tags question: http://stackoverflow.com/q/29940562
tags question: http://stackoverflow.com/q/29982289
tags question: http://stackoverflow.com/q/29982130
tags question: http://stackoverflow.com/q/29985600
tags question: http://stackoverflow.com/q/29918054
tags question: http://stackoverflow.com/q/29962989
tags question: http://stackoverflow.com/q/29926774
tags question: http://stackoverflow.com/q/29876316
tags question: http://stackoverflow.com/q/29912286
tags question: http://stackoverflow.com/q/29920404

http://stackoverflow.com/comment/47895487
score: 0
type: Comment
has text: Ah the missing "g"!! Thank you so much Marek. Just did this and it worked great.
type: AnswerComment
comment on: http://stackoverflow.com/a/29885382

http://stackoverflow.com/a/29981947
type: Answer
upvote count: 2
score: 2
answers question: http://stackoverflow.com/q/29981895
has body: You can use a function that returns another function function mod(a) { return function(b) { return b % a; } }
downvote count: 0

http://stackoverflow.com/comment/48016056
score: 0
type: AnswerComment
type: Comment
has text: check my updated answer...Make sure you are accessing the data that the service is returning correctly also..check the demo.
comment on: http://stackoverflow.com/a/29944912

http://stackoverflow.com/a/29904186
answers question: http://stackoverflow.com/q/29903920
score: 2
upvote count: 2
type: Answer
downvote count: 0
has body: This is the ternary operator - the semicolon goes on the end. done = $(this).hasClass('done') ? 1 : 0; is equivalent to if $(this).hasClass('done') done = 1; else done = 0;

http://stackoverflow.com/comment/47821551
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29847873
has text: That depends on what's changing the class, does the page reload or not ?

http://stackoverflow.com/a/29856170
has body: This is easier done with external event binding. function buttonClick() { //do stuff this.onclick = notButtonClick; //function reference to nBC } function notButtonClick() { //do more stuff this.onclick = buttonClick; //function reference to original function } var el = document.getElementById("numberonebutton"); //let for ES6 aficionados el.onclick = buttonClick; //again, function reference, no () Alternatively, you can bind events with addEventListener instead of onclick As per lemon, here is a good question and answer about the differences between addEventListener and on[event] :)
answers question: http://stackoverflow.com/q/29856105
type: Answer
has comment: http://stackoverflow.com/comment/47838365
downvote count: 1
upvote count: 5
has comment: http://stackoverflow.com/comment/47839542
score: 4

http://stackoverflow.com/a/29894167
accepted answer of: http://stackoverflow.com/q/29888916
score: 0
answers question: http://stackoverflow.com/q/29888916
has body: Thee js file for jquery that I included was corrupt .. I tried using the google cdn for jquery and it worked fine for me. Thanks for your time :)
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/comment/48006883
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29943081
type: AnswerComment
has text: I mean, it's one of the possibilities

http://stackoverflow.com/comment/48067550
comment on: http://stackoverflow.com/q/29973426
has text: You could try passing a "church" to search in the general area. However, they make their PLACES api just for this. I'm not sure how much they are pushing that.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/48117540
comment on: http://stackoverflow.com/a/29999150
type: Comment
has text: got it. However for this test case [1, 5, 3, 3, 7] it would get False and should be true what do you think ?
type: AnswerComment
score: 0

http://stackoverflow.com/a/29877394
accepted answer of: http://stackoverflow.com/q/29877248
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/29877248
type: Answer
has comment: http://stackoverflow.com/comment/47879188
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/47879240
has comment: http://stackoverflow.com/comment/47879435
has body: var myElem = Sizzle("#myElem"); var obj = { set myVar(text) { myElem.innerText = text; }, get myVar() { return myElem.innerText; } }; obj.myVar = "foo"; You can use setters and getters, but you'll need your bound variable to be within an object. EDIT: Technically speaking, even global variables belong to the window object, so this should work: var myElem = Sizzle("#myElem"); Object.defineProperty(window, 'myVar', { set: function(text) { myElem.innerText = text; }, get: function() { return myElem.innerText; } }); myVar = "foo"; // works assuming that we are using global scope // i.e. myVar isn't overridden in local scope window.myVar = "foo"; // will work regardless UPDATE: Question was changed, so here is the updated answer: class myClass { constructor(elem) { Object.defineProperty(this, 'text', { set: function(text) { elem.innerText = text; }, get: function() { return elem.innerText; } }); } }
has comment: http://stackoverflow.com/comment/47879349

http://stackoverflow.com/comment/47912751
score: 1
comment on: http://stackoverflow.com/a/29893787
has text: @kiran If you want to change the size of a div when the device width is smaller than 500px you should do it something like this: ATmedia screen and (max-width: 300px) { .myDiv { width: 25px; } } This will format the div width to 25px for all devices with a size of less than 500px.
type: AnswerComment
type: Comment

http://stackoverflow.com/a/29852363
score: 3
downvote count: 0
has body: It looks like your click listeners are firing both times when .open is applied. Using a :not selector in your .on('click', '.list-group li a') function seems to solve this $('body').on('click', '.list-group li a:not(.open)', function() { // .... } JSFiddle Link
upvote count: 3
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29852288
accepted answer of: http://stackoverflow.com/q/29852288
type: Answer

http://stackoverflow.com/comment/87782874
comment on: http://stackoverflow.com/q/29887226
score: 0
type: QuestionComment
type: Comment
has text: https://stackoverflow.com/questions/12991351/css-force-image-resize-and-keep-aspect-ratio

http://stackoverflow.com/q/29975948
has answer: http://stackoverflow.com/a/29976373
score: 1
has comment: http://stackoverflow.com/comment/48072237
type: Question
has comment: http://stackoverflow.com/comment/48071803
downvote count: 0
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29976473
has answer: http://stackoverflow.com/a/29976872
answer count: 3
tagged with: http://stackoverflow.com/tag/html
has body: I've struck a problem with a project i'm working on, the problem i'm facing is that a div that's been floated right will overlap all elements below (It seems to treat the div like it has no content) The div in question is an animated logo I've made in adobe edge animate. HTML -- All Sections CSS - .lefthead { padding-top:7px; float:left !important; } .lefthead img { max-height:77px; min-height:60px; } .righthead { padding-top:4px; float:right !important; } .righthead.col-sm-3 { max-height:70px; min-height:60px; } .clear { clear:both; } That's just a portion of the CSS as there is too much to paste. A live version of the website can be found here - http://www.mosesmartin.co.uk/digitalguys/home.php The website will work fine up until you lower the width below 500px. After that the 3 header divs will change so that 'lefthead'and the 'snippet' are 50% width and the 'righthead' is central below. I've tried using 'clear:both' but that won't seem to work (I might be using it wrong but i don't think i am) Any help is appreciated. Thank you
has title: Floated div overlapping unfloated div when below a certain width
favorite count: 0
accepted answer: http://stackoverflow.com/a/29976473
upvote count: 1
tagged with: css
possible better answer: http://stackoverflow.com/a/29976373
has comment: http://stackoverflow.com/comment/48073316
type: AnsweredQuestion

http://stackoverflow.com/q/29854792
tagged with: websocket
tagged with: javascript
has comment: http://stackoverflow.com/comment/47835749
has title: Create Temporary Webpage with Randomly Generated URL
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
has answer: http://stackoverflow.com/a/31019109
favorite count: 0
upvote count: 2
has body: Alright, so I'm trying to write a little app that creates a temporary webpage (kinda) and I can't figure out what it is that needs to happen for this to work exactly. Let me explain what I'm trying to do and that should help. Basically, I want to have app.com and when a user goes there there's a button like "Make temp page" or something. Click that and then it makes a random URL extension and puts the visitor there, so something like app.com/admin/xxyy12. Now the user can give the URL app.com/xxyy12 to someone and they can navigate there and send data back and forth between each other, my thinking was via WebSockets. So I want the person that made the link to be an admin of sorts and when they leave that "admin" page I want it and app.com/xxyy12 to self destruct basically, no one can go there and that route doesn't exist anymore. Is this possible and what technologies should I look into to accomplish this? I thought it would be cool to do this all in-browser with no server, which kills some security but I don't really care about that. I'm not really sure how to create these "temporary" pages either. I figured WebSockets would come in handy to send data between the person that created the link and the client visiting it, and I figured the main page app.com would need a socket to the user at app.com/admin/xxyy12 to determine when it disconnects. Also, I considered html parameters to basically make a "temporary" URL that would just read the param and then that would wire the client to the URL creator. There would also need to be a way of storing what active temporary pages exist. I recognize that this question is rather vague but I suppose I'm just looking for ideas of how to accomplish this and what technologies would be recommended. Thanks for any and all help.
tagged with: node.js
score: 2
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/29857640
accepted answer: http://stackoverflow.com/a/31019109
has answer: http://stackoverflow.com/a/29857640
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/47838127

http://stackoverflow.com/q/29982231
answer count: 0
type: UnansweredQuestion
score: 1
upvote count: 1
type: Question
tagged with: recursion
has title: Recursion function in XML using Javascript DOM
downvote count: 0
tagged with: javascript
has body: i am trying to make html page, that should shows all the nodes in xml file. there are other ways but i want to do it using javascript DOM through recursive function. i've tried this. suggest please. ** Adi the great **
favorite count: 0
tagged with: http://stackoverflow.com/tag/xml

http://stackoverflow.com/a/29998246
score: 3
downvote count: 0
answers question: http://stackoverflow.com/q/29998219
type: Answer
upvote count: 3
has body: The x in f1 is a new variable only accessible within f1 and has no effect on the first, global x. The example code in your question could essentially be written like the following for clarity: var globalX = "outside"; var f1 = function() { var localF1X = "inside f1"; }; f1(); console.log(globalX); // → outside var f2 = function() { globalX = "inside f2"; }; f2(); console.log(globalX); // → inside f2

http://stackoverflow.com/comment/48049002
type: Comment
comment on: http://stackoverflow.com/a/29963548
has text: Thanks it works. How can i add an image to the button?
score: 0
type: AnswerComment

http://stackoverflow.com/q/29967248
has title: Mocha test is not waiting for Publication/Subscription
accepted answer: http://stackoverflow.com/a/29967327
tagged with: velocity
has answer: http://stackoverflow.com/a/40741085
type: AnsweredQuestion
score: 1
possible better answer: http://stackoverflow.com/a/40741085
upvote count: 1
type: Question
tagged with: testing
has body: Stack Using Mocha + Velocity (0.5.3) for Meteor client-side integration tests. Let's assume that I have autopublish package installed. Problem If a document on the MongoDB was inserted from the server, the client-side mocha tests will not wait for the subscription to synchronise, causing the assertion to fail. Code example Server-side Accounts.onCreateUser hook: Accounts.onCreateUser(function (options, user) { Profiles.insert({ 'userId': user._id, 'profileName': options.username }); return user; }); Client-side Mocha Test: beforeEach(function (done) { Accounts.createUser({ 'username' : 'cucumber', 'email' : 'cucumber@cucumber.com', 'password' : 'cucumber' //encrypted automatically }); Meteor.loginWithPassword('cucumber@cucumber.com', 'cucumber'); Meteor.flush(); done(); }); describe("Profile", function () { it("is created already when user sign up", function(){ chai.assert.equal(Profiles.find({}).count(), 1); }); }); Question How could I make Mocha wait for my profile document to make its way to the client avoiding the Mocha timeout (created from the server)?
has answer: http://stackoverflow.com/a/29967327
tagged with: javascript
tagged with: mocha.js
answer count: 2
downvote count: 0
tagged with: meteor
favorite count: 0

http://stackoverflow.com/q/29919462
tagged with: wpf
score: 0
type: Question
tagged with: c#
has body: I can send one argument, but can't send an array. C# code: string[] mes = {"Bascketball Stadium", "New Address", "Ilya"}; this.MyWebBrowser.InvokeScript("DaveWriter", mes); JavaScript code: function DaveWriter(mes){ var arr = jQuery.makeArray(mes); document.getElementById('company').innerHTML = arr[0]; document.getElementById('address').innerHTML = arr[1]; } I recieve only the 1st element of the array. What should I change to recieve all elements?
answer count: 1
tagged with: javascript
type: UnansweredQuestion
has title: How can I pass array from wpf control to javascript function in webbrowser control?
has answer: http://stackoverflow.com/a/29919738

http://stackoverflow.com/q/30002316
has answer: http://stackoverflow.com/a/30002717
tagged with: url-routing
score: 2
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/30002388
has body: How to load content on page by clicking on menu links? For example, there is menu: Personal Contacts Question is in how change template HTML in page for each link?
tagged with: angularjs-controller
type: Question
tagged with: angularjs-routing
answer count: 2
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/48123233
has title: How to do load page in Angular JS?
favorite count: 0
has answer: http://stackoverflow.com/a/30002388
linked to: http://stackoverflow.com/q/29983236
tagged with: angularjs
upvote count: 2
possible better answer: http://stackoverflow.com/a/30002717

sweetalert
tags question: http://stackoverflow.com/q/29920784
tag name: sweetalert
type: Tag
tags question: http://stackoverflow.com/q/29945646

http://stackoverflow.com/q/29894081
linked to: http://stackoverflow.com/q/203198
has title: Issues with ajax and JavaScript function
tagged with: javascript
upvote count: 2
has body: I got this problem where my JS-functions won't work/run after i rebuild my HTML page with some new values from my XML-file. To not make this post too long i gathered the HTML/CSS in jsfiddle: http://jsfiddle.net/qua1ity/g91xpfhx/ (I'ts not fully functional since i don't know how to add xml/ajax stuff to jsfiddle) Basically, there is an image and a checkbox, when the checkbox is checked then the image gets the class "markedImg" which have a opacity value of 1. This doesn't work when i try to rebuild the html with values from an XML file. I do the request like this: function doRequest(target) { if (XMLHttpRequest) { request = new XMLHttpRequest(); } else if (ActiveXObject) { request = new ActiveXObject("Microsoft.XMLHTTP"); } else { return false; } request.open("GET", target, true); request.send(null); request.onreadystatechange = function () { if ((request.readyState === 4) && (request.status === 200)) { createHTML(request.responseXML); } }; } Sending "target" parameter from an addeventlistener categoryMenu.addEventListener("change", function () { if (categoryMenu.value === "Flower") { doRequest("categories/imgcat0.xml"); } if (categoryMenu.value === "Buttefly") { doRequest("categories/imgcat1.xml"); } }); And then i run the function "createHTML", which rebuilds the html using the values from XML files function createHTML (XMLcode) { var imgURL = XMLcode.getElementsByTagName("image"); var title = XMLcode.querySelector("title"); var html = ""; imgForm.innerHTML = ""; html += ' ' + title.firstChild.data + ' '; for (var i = 0; i < imgURL.length; i++) { html += ' '; html += ' '; html += ' '; html += ' '; html += ' '; } imgForm.innerHTML = html; } And so far everything works, but when i add the function to add the "markedImg" class, it doesn't run on the newly created HTML elements. Nothing happens with this function basically. The function itself works, which you can see in the jsfiddle example, but it's after you change the category and the "doRequest" functions runs th…
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/47911930
tagged with: http://stackoverflow.com/tag/html
score: 2
answer count: 0
downvote count: 0
type: UnansweredQuestion
duplicate of: http://stackoverflow.com/q/203198
has comment: http://stackoverflow.com/comment/47911743
type: Question
has comment: http://stackoverflow.com/comment/47913472

http://stackoverflow.com/comment/47976387
comment on: http://stackoverflow.com/q/29924608
score: 0
type: QuestionComment
type: Comment
has text: yea, that's what I imagine, but it should be a way to doing this without modifying all my test files.

http://stackoverflow.com/comment/48023475
has text: I am referring this example :-- https://github.com/floatinghotpot/cordova-plugin-sms/blob/master/test/index.html from author. This is not adding SMS.js file .
type: AnswerComment
type: Comment
score: 0
comment on: http://stackoverflow.com/a/29935633

http://stackoverflow.com/q/29998284
has body: I'm going crazy. So I have a click function that creates a new div with unique classes and everything. Inside all of them is a button (another click function labled .varibFixed) that hides and shows a div within the divs that are created with said click function. My goal is to have that button work for all the new divs that are created. My code is listed below but it just does not work for the newly created divs - only the first div. var interest = function () { $('.varibFixed').click(function () { for (var k = 1; k &lt; i; k++) { if ($(this).hasClass('fixed' + k)) { $('.Ffixed' + k).removeClass('interestOpt'); $('.Ffixed' + k).addClass('showInt'); $('.Fvariable' + k).removeClass('showInt'); $('.Fvariable' + k).addClass('interestOpt'); } else if ($(this).hasClass('variable' + k)) { $('.Fvariable' + k).removeClass('interestOpt'); $('.Fvariable' + k).addClass('showInt'); $('.Ffixed' + k).removeClass('showInt'); $('.Ffixed' + k).addClass('interestOpt'); } } }); };
has answer: http://stackoverflow.com/a/29998314
type: AnsweredQuestion
score: 3
upvote count: 3
type: Question
linked to: http://stackoverflow.com/q/203198
has title: Adding a jQuery Click function inside of a for loop
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/29998314
duplicate of: http://stackoverflow.com/q/203198
has comment: http://stackoverflow.com/comment/48116002
answer count: 1
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/48116087
tagged with: http://stackoverflow.com/tag/html
tagged with: css

http://stackoverflow.com/comment/47873622
type: QuestionComment
comment on: http://stackoverflow.com/q/29874454
score: 0
has text: what have you already tried?
type: Comment

http://stackoverflow.com/comment/48015456
has text: Is this ASP.Net MVC?
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29947072

http://stackoverflow.com/comment/48055819
comment on: http://stackoverflow.com/q/29966619
has text: Manish, see my solution below. You were on the right track. Thanks for your help. :-)
type: Comment
type: QuestionComment
score: 0

session
tags question: http://stackoverflow.com/q/29965394
tags question: http://stackoverflow.com/q/29956252
type: Tag
tags question: http://stackoverflow.com/q/29982565
tags question: http://stackoverflow.com/q/29883144
tag name: session

meteor-helper
tag name: meteor-helper
tags question: http://stackoverflow.com/q/29917173
type: Tag

http://stackoverflow.com/a/29977915
upvote count: 1
has comment: http://stackoverflow.com/comment/48077374
score: 0
downvote count: 1
type: Answer
answers question: http://stackoverflow.com/q/29977855
has body: I suspect you're looking for Sequelize.authenticate().complete(...) instead of Sequelize.authenticate.complete(...) Sequelize.authenticate is a function that returns a promise. It's not an object with a .complete() method. If you don't execute it, no promise will be returned. If no promise is returned, you can't run .complete() on the promise. Hope this helps you out. Here is some documentation on Promises from the Mozilla Development Network.

http://stackoverflow.com/comment/48152548
comment on: http://stackoverflow.com/a/29893015
score: 0
type: AnswerComment
has text: @user2880391 thanks for checking, what protractor version are you using? Try upgrading to the latest which would definitely support chaining element and element.all.
type: Comment

http://stackoverflow.com/a/29923177
upvote count: 1
accepted answer of: http://stackoverflow.com/q/29922695
answers question: http://stackoverflow.com/q/29922695
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 1
has body: It is a bit hard when not seeing the markup, but I think what you are after is $('table:lt(2) .collection-row td:gt(1):lt(5) input')

http://stackoverflow.com/q/29854109
has comment: http://stackoverflow.com/comment/47835657
tagged with: angularjs
has comment: http://stackoverflow.com/comment/47834564
has comment: http://stackoverflow.com/comment/47836262
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47835403
has comment: http://stackoverflow.com/comment/47834664
has body: I'm trying to understand why I need to write my function in a specific way for it to not throw an error. I'm not certain if this is an Angular thing, a Javascript thing, or a combination of both, but would love to get some help understanding this. I have created a directive that creates a popover when the user selects some text. I'm specifically targeting the mouseup event and I'm setting it up in the directive's link function. A simplified version of my directive looks like the following: (function() { 'use strict'; angular.module('myApp') .directive('myPopOver', myPopOver); myPopOver.$inject = [ '$http', '$rootScope', '$compile', '$controller' ]; function myPopOver( $http, $rootScope, $compile, $controller ) { return { restrict : 'A', link : postLink, scope : { popOverController : '=', popOverControllerAs : '=', evidenceCollection : '=', popOverTemplateUrl : '=', minStringLength : '=', enablePopOver : '=' } }; function postLink( $scope, iElement, iAttrs, controller ) { var MIN_LENGTH; MIN_LENGTH = $scope.minimumStringLength != null ? $scope.minimumStringLength : 5; return iElement.on('mouseup', handleMouseUpEvent); function handleMouseUpEvent( event ) { var selectedText, meetsLengthRequirements, canDisplayPopOver; if ( $scope.enablePopOver === undefined ) { canDisplayPopOver = true; } else { canDisplayPopOver = $scope.enablePopOver; } selectedText = window.getSelection(); meetsLengthRequirements = selectedText.toString().length &gt;= MIN_LENGTH; if ( !selectedText.isCollapsed &amp;&amp; !activePopOver &amp;&amp; meetsLengthRequirements &amp;&amp; canDisplayPopOver) { return onTextSelect(event, selectedText); } else { return clearPopOver(); } } } })(); This version above works. However, when I initially created the function that would handle the mouseup event, I wrote it as follows: function handleMouseUpEvent( event ) { var selectedText, meetsLengthRequirements; if ( $scope.enablePopOver === undefined ) { $scope.enablePopOver = true; } selectedText = window.getSel…
has answer: http://stackoverflow.com/a/29855090
type: Question
tagged with: angularjs-directive
has comment: http://stackoverflow.com/comment/47836156
has comment: http://stackoverflow.com/comment/47835355
tagged with: javascript
has comment: http://stackoverflow.com/comment/47836585
has title: Need help understanding why creating a reference to $scope in a directive link function works
tagged with: angularjs-scope
has comment: http://stackoverflow.com/comment/47835437
has comment: http://stackoverflow.com/comment/47835327
has comment: http://stackoverflow.com/comment/47835373
score: 0
answer count: 1
accepted answer: http://stackoverflow.com/a/29855090
has comment: http://stackoverflow.com/comment/47834601

http://stackoverflow.com/comment/48067786
comment on: http://stackoverflow.com/q/29973968
score: 0
type: Comment
type: QuestionComment
has text: Why did you fixed the code in your post, it was a typo? If not, let the original code for people to see what happened.

http://stackoverflow.com/comment/47841250
score: 6
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29857639
has text: @chris72205 do not use `async: false` learn how to deal with asynchronous events. http://stackoverflow.com/questions/14220321/how-to-return-the-response-from-an-asynchronous-call

http://stackoverflow.com/a/29865906
downvote count: 0
answers question: http://stackoverflow.com/q/29865858
upvote count: 2
type: Answer
has body: You can pass a data argument to .load(). $('#2').load(this.path+'/compile.php', { file: $("#selectID").val() }) .show().siblings('div').hide(); In the PHP script, use $_GET['file'] to get the selected filename.
score: 2
accepted answer of: http://stackoverflow.com/q/29865858
type: AcceptedAnswer

http://stackoverflow.com/comment/47840899
type: AnswerComment
type: Comment
has text: Looks like two names got dropped. There's 50 names in the list; you're only returning 48 (divisible by 16).
score: 1
comment on: http://stackoverflow.com/a/29857417

http://stackoverflow.com/comment/47843966
comment on: http://stackoverflow.com/a/29859009
has text: That is the exact video.js script I've been using on my pages. The videojs.com home page uses: . Both versions demonstrate the same behavior on both Chrome and IE 11.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/48082198
type: QuestionComment
score: 0
has text: You may want to consider using the `{[render}}` helper here, instead of an outlet.
comment on: http://stackoverflow.com/q/29971131
type: Comment

http://stackoverflow.com/q/29977262
type: AnsweredQuestion
score: 3
accepted answer: http://stackoverflow.com/a/29977263
tagged with: es6-promise
has title: Await more than one promise with Javascript / ECMAScript 6
has body: I would like to start a list of promises and execute a callback when all of then are done (without async/await).
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: promise
has answer: http://stackoverflow.com/a/29977263
upvote count: 3
possible better answer: http://stackoverflow.com/a/48652751
has answer: http://stackoverflow.com/a/48652751

http://stackoverflow.com/comment/47970264
comment on: http://stackoverflow.com/q/29923920
has text: Use "touchstart" and "touchend" with the Jquery bind method instead of mouseup and mousedown.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29985028
has comment: http://stackoverflow.com/comment/48089353
has comment: http://stackoverflow.com/comment/48089327
tagged with: javascript
has title: Array with an Object property has no length but the property exists
score: 0
tagged with: arrays
has comment: http://stackoverflow.com/comment/48089281
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/48089687
has body: If we have an empty array in JavaScript then add a property to it, the property does seem to exist but the array has 0 length. var arr = []; arr.property = '1234'; console.log(arr); // [] console.log(arr.property); // "1234" In NodeJs its slightly different console.log(arr); // [ property: '1234' ] Is this a valid condition for an array to be in? I spotted this whilst reading the unit tests for the JS App I work in and wonder if the test is correct to check for this kind of thing. Edit: My query was around whether or not its a valid condition rather than why the length isn't increased. I guess it is valid if it refers to the state of it in the spec.
linked to: http://stackoverflow.com/q/10563251
linked to: http://stackoverflow.com/q/29934583
tagged with: node.js
answer count: 0
duplicate of: http://stackoverflow.com/q/10563251
type: Question

http://stackoverflow.com/comment/48065075
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29971307
has text: Do you just want to make sure something has been selected?
score: 0

http://stackoverflow.com/a/29964055
answers question: http://stackoverflow.com/q/29961729
type: Answer
score: 0
has body: To help you understand my comment on the question I thought it best I'd give an example of what I meant. I didn't have enough time to fully go through the solution but wanted to give an example of what I'd call more readable code. I've added all variables at the top of the function. This will allow you to read and find items much quicker if you needed to alter them. I've also merged a lot of the string values that you had into an object, namely the li element. I've never used $.data() as an object before so wasn't really aware how I could use it to set the values in the updateSavedData() $('li'), although the console.log() does show the correct key / values. $(document).ready(function(){ var uID = 0; var testObject = []; var unorderedList = $("#listId"); var savedList = $("#savedData"); var TOL = 0; //TestObjectLength var textTemplate = "This is my [0] text!"; function addNewItem(){ uID++; testObject.push({id: uID, text: textTemplate.replace("[0]", uID)}); TOL = testObject.length-1; updateList(); } function updateList(){ var li = $('&lt;li&gt;', { id: testObject[TOL].id, data: testObject[TOL], text: testObject[TOL].text }); li.appendTo(unorderedList); updateSavedData(li.data()); } function updateSavedData(li){ console.log(JSON.stringify(li)); $('&lt;li&gt;', JSON.stringify(li)).appendTo(savedList); } addNewItem(); $("#add").on('click', addNewItem); }); Working Example http://jsbin.com/ralizazahe/1/edit?js,console,output Anyone that wants to progress on that please do as I'd also like to see how this could be progressed more. Update Taken it a step more and refactored to this $(document).ready(function(){ var $displayList = $("#listId"); var $savedList = $("#savedData"); var textTemplate = "This is my {0} text!"; var uID = 0; //Unique ID var data = { id: null, text: null }; //Gives a reference function init(){ uID++; data = { id: uID, text: textTemplate.replace("{0}", uID) }; } function addNewItem(){ init(); $('&lt;li&gt;', data).appendTo($displayList); updateSavedDa…

http://stackoverflow.com/a/29981233
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/48082740
has comment: http://stackoverflow.com/comment/48115290
has body: Try this solution :3 ... I hope this help. <c:forEach var="location" items="${locations}"> ${location.name} </c:forEach>
answers question: http://stackoverflow.com/q/29980862

http://stackoverflow.com/comment/48097475
type: AnswerComment
score: 0
type: Comment
has text: @Stefano Vollono: Do you have any questions for *me* about *my* answer, rather than about comments getting posted here? :)
comment on: http://stackoverflow.com/a/29988947

http://stackoverflow.com/q/29891348
downvote count: 0
tagged with: javascript
tagged with: jquery
score: 4
has answer: http://stackoverflow.com/a/29891488
has body: I have implemented several jQuery plugins for my current project. Since some plugins have functions with the same name, the one called in the last one defined. Here is the definition of my first plugin: $(function($) { $.fn.initPlugin1 = function(parameters) { var defaultParameters = {}; $(this).data('parameters', $.extend(defaultParameters, parameters)); return $(this); }; $.fn.function1 = function(){ console.log('Function 1.'); }; $.fn.callFunction = function(){ $(this).function1(); }; }); And here is the definition of my second plugin: $(function($) { $.fn.initPlugin2 = function(parameters) { var defaultParameters = {}; $(this).data('parameters', $.extend(defaultParameters, parameters)); return $(this); }; $.fn.function2 = function(){ console.log('Function 2.'); }; $.fn.callFunction = function(){ $(this).function2(); }; }); I have also this scenario : $("#div1").initPlugin1().callFunction(); $("#div2").initPlugin2().callFunction(); For this specific scenario the consoles shows: Function 2. Function 2. In fact, since the callFunction() is also defined in the second plugin, this is the one used. I would like some advise on what is the best way to solve this problem. Is it possible to create a thing similiar to a namespace ?
has comment: http://stackoverflow.com/comment/47906419
has comment: http://stackoverflow.com/comment/47906728
has comment: http://stackoverflow.com/comment/47906356
has answer: http://stackoverflow.com/a/29896645
has title: jQuery plugins functions overwrite
favorite count: 0
tagged with: overwrite
type: UnansweredQuestion
tagged with: plugins
type: Question
upvote count: 4
answer count: 2
tagged with: function

http://stackoverflow.com/comment/47841217
score: 0
type: Comment
type: QuestionComment
has text: @JorgeF that did it. I've never had a problem with this until now.
comment on: http://stackoverflow.com/q/29857639

http://stackoverflow.com/comment/75863983
comment on: http://stackoverflow.com/a/35925061
score: 0
type: AnswerComment
has text: @Aaron what we could do is use function default params `const B = (B = Object) => class extends B {` and then use `class F extends B() {` for a prettier usage, but uglier hack Kappa
type: Comment

http://stackoverflow.com/comment/47962150
score: 0
type: AnswerComment
has text: I am trying to add the code in my view, but I don´t know what is the best way..I am using MVC...Could you please help me in this implementation? Thanks!!!
type: Comment
comment on: http://stackoverflow.com/a/29899179

http://stackoverflow.com/a/29973742
has body: Reference to fundamentals of prototype inheritance and Object.create property arguments. Implemented based on your example function Book (){ this.width = 7; this.height = 10; this.pages = 100; this.tear_page = function(){ return --this.pages; } this.init = function() { return this } } Book.prototype = { open_book: function(){ return "Opened in page "+(this.pages/2) } } var bBook = Object.create(new Book(), {pages: { value: 50 } }).init(); console.log( new Book()) // { width: 7, height: 10, pages: 100, tear_page: [Function], init: [Function] } console.log( bBook ) //{} console.log( bBook.width ) //-&gt;7 console.log( bBook.height ) //-&gt; 10 console.log( bBook.pages ) // -&gt; 50 console.log( bBook.tear_page()) //-&gt; 49 console.log(bBook.open_book()) //-&gt; Opened in page 25
downvote count: 0
answers question: http://stackoverflow.com/q/29972754
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/48173345
type: Answer
has comment: http://stackoverflow.com/comment/48188018

http://stackoverflow.com/comment/47851814
type: Comment
has text: @Taplar yes I get both of them. I know what you mean but both of them coming after callback.
score: 0
comment on: http://stackoverflow.com/q/29863087
type: QuestionComment

http://stackoverflow.com/comment/47987593
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29932651
has text: Can you please share the html and the code for finding `inputElement`?

http://stackoverflow.com/a/29904400
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/48243952
upvote count: 1
has body: The drop variable stores the number of cards you are supposed to be riffling from either the left or right hand. However, there are two instances: if (drop &gt;= top.length) { cards = top; } and if (drop &gt;= bottom.length) { cards = bottom; } where drop can be greater than the number of remaining cards in the half of the pack so more cards will be subtracted from i than you have actually riffled. You can fix this by: if (drop &gt;= top.length) { drop = top.length; cards = top; top = []; } and if (drop &gt;= bottom.length) { drop = top.length; cards = bottom; bottom = []; } (You need to empty the arrays or you may end up adding the same cards twice). Other issues You have magic numbers in the code (26 and 52) these could be constants defined in the class and given appropriate names (i.e. PACK_SIZE = 52) which would mean that if you create a sub-class representing a different number of cards then it would still work. hand has two possible values which could be represented as a boolean but you assign it strings (again you could use constants LEFT_HAND = true, RIGHT_HAND = !LEFT_HAND). Pack appears to be a global variable - I would have thought it ought to be a member of the class. You do not need to name the functions as this is just polluting the global namespace: riffle : function riffle() { can just be an anonymous function riffle : function() {. Performance - you create additional arrays with each iteration and the cards are moved multiple times. This could be more efficient. Something like this: PACK_SIZE: 52, riffle : function() { var index_of_cards_riffled_from_top = 0; var index_of_cards_riffled_from_bottom = this.PACK_SIZE / 2; var riffled_cards = []; while ( index_of_cards_riffled_from_top &lt; this.PACK_SIZE / 2 || index_of_cards_riffled_from_bottom &lt; this.PACK_SIZE ) { var num_cards_to_riffle_top = Math.min( this.PACK_SIZE / 2 - index_of_cards_riffled_from_top, Math.floor( Math.random() * 3 ) + 1 ); var num_cards_to_riffle_bottom = Math.min( this.PACK_…
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29885020
answers question: http://stackoverflow.com/q/29885020
type: Answer
has comment: http://stackoverflow.com/comment/47996963

http://stackoverflow.com/comment/47943109
has text: thats the very reason why you should use $q, it chains the promises.. one after the other...
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/29909902
type: Comment

http://stackoverflow.com/a/29969444
answers question: http://stackoverflow.com/q/29969239
downvote count: 0
score: 1
has body: This should give you the type of effect you want. Basically you're storing your images in an array, then you're going to randomly pick an index, then display it. var yourImages = ["image1.png","image2.png","image3.png"]; var randomImage = Math.round(Math.random()*yourImages.length); function displayImage() { document.write(yourImages[randomImage]); } Here is an example that's more geared toward what you asked, after I read your question again. If the user clicks on the image, it'll change to a random one. JS: &lt;img id="currentImage" src="defaultImage.png" onclick="changePicture()"&gt; &lt;script&gt; function changePicture(){ var yourImages = ["image1.png","image2.png","image3.png"]; var randomImage = Math.round(Math.random()*yourImages.length); var setImg = document.getElementById("currentImage").src; setImg = yourImages[randomImage]; } &lt;/script&gt; jQuery: &lt;img id="currentImage" src="defaultImage.png"&gt; &lt;script&gt; $("#currentImage").click(function(){ var yourImages = ["image1.png","image2.png","image3.png"]; var randomImage = Math.round(Math.random()*yourImages.length); $("#currentImage").attr("src", yourImages[randomImage]); }); &lt;/script&gt;
upvote count: 1
type: Answer

http://stackoverflow.com/a/29999168
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/48117527
has body: Since one of the most important features of Dolphin browser is to force Desktop rendering on mobile devices, The Dolphin browser fakes its useragent string, so it is not possible to detect it by JavaScript in reliable way.
answers question: http://stackoverflow.com/q/29999106

http://stackoverflow.com/q/29872404
tagged with: ionic-framework
type: Question
tagged with: angularjs-directive
has comment: http://stackoverflow.com/comment/47869869
tagged with: javascript
has comment: http://stackoverflow.com/comment/47870595
has body: could you please tell me how to edit text of row in angular js.I make a demo in which I create a row dynamically when again I am editing it name of row.But my function not working why ? here is my code http://codepen.io/anon/pen/KpwzGP Follow this steps. click the bottom icon left bottom .It show pop up screen write anything and press **add*.It generate a row.when you click edit button it show again a pop up with fill values button when I again press "add" button it should edit or change the text of row . can we change the text of button also mean while case edit button name is "save" $scope.showPopup = function() { $scope.data = {} // An elaborate, custom popup var myPopup = $ionicPopup.show({ template: ' ', title: 'Enter Add Test case', subTitle: 'Add Test case name', scope: $scope, buttons: [ { text: 'Cancel' }, { text: 'Add', type: 'button-positive', onTap: function(e) { if (!$scope.data.testcase) { //don't allow the user to close unless he enters wifi password e.preventDefault(); } else { return $scope.data; } } }, ] }); myPopup.then(function(res) { console.log('Tapped!', res); if(typeof res!='undefined' && !$scope.iseditDone) { res.edit="ion-edit"; res.close="ion-close"; $scope.items.push(res) }else if($scope.iseditDone){ } console.log($scope.items); }); /* $timeout(function() { myPopup.close(); //close the popup after 3 seconds for some reason }, 3000);*/ }; $scope.addTestCase=function(){ $scope.showPopup(); } $scope.editRow=function(row){ //alert(row.testcase) $scope.data.testcase=row.testcase; // alert($scope.data.testcase) $scope.showPopup(); $scope.data.testcase=row.testcase; }
has answer: http://stackoverflow.com/a/29872635
downvote count: 0
accepted answer: http://stackoverflow.com/a/29872635
answer count: 1
favorite count: 0
tagged with: angularjs
type: AnsweredQuestion
score: 3
has comment: http://stackoverflow.com/comment/47870162
has comment: http://stackoverflow.com/comment/47869812
upvote count: 3
has title: how to edit text of row in angular js?
tagged with: angularjs-scope

http://stackoverflow.com/q/29948325
favorite count: 0
has answer: http://stackoverflow.com/a/29948447
has answer: http://stackoverflow.com/a/29948420
has body: I have a series of divs all of the same class with no IDs. I want to change the background of the div when it is clicked. I tested the function and it works fine. But when I access the element as this, it is not working. Question is how to get buttonpressed() to work only for the div clicked on? HTML Membership Certification Foundation Seminars Councils Javascript function buttonpressed() { var bgString = "url('navbuttonpressed.png')"; $(this).css('backgroundImage',bgString); }
has answer: http://stackoverflow.com/a/29948578
has comment: http://stackoverflow.com/comment/48017546
has answer: http://stackoverflow.com/a/29948416
type: UnansweredQuestion
score: -3
has answer: http://stackoverflow.com/a/29948679
downvote count: 4
has comment: http://stackoverflow.com/comment/48017607
has title: Using $(this) when selecting a div
answer count: 6
type: Question
upvote count: 1
has answer: http://stackoverflow.com/a/29948422
tagged with: this
tagged with: javascript
has comment: http://stackoverflow.com/comment/48017523
tagged with: jquery

http://stackoverflow.com/q/29863573
tagged with: javascript
linked to: http://stackoverflow.com/q/17736686
score: 0
upvote count: 1
answer count: 1
downvote count: 1
favorite count: 0
tagged with: requirejs
has body: All I want is a bundled version of dojo with is the require loader, domReady, and query and nothing else. I have tried many release.profiles and experimented changing the config. I tried these too: http://dojotoolkit.org/reference-guide/1.8/build/customBase.html http://jamesthom.as/blog/2012/08/03/finding-nano/ This and many other examples generate the whole folder of dojo and all its files next to the dojo.js file. For the past few weeks of experimentation I didn't even realise the dojo.js file was the built version. It's a bit difficult to know that since it's sitting next to all the other dojo files. Could it be my version of dojo? I'm using 1.8, with latest java 32 bit installed on my version of windows 7. Any help appreciated. thanks
tagged with: dojo
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29871252
has title: Why is Dojo build generating all it's dependencies next to the released dojo.js file?
type: Question
has answer: http://stackoverflow.com/a/29871252

http://stackoverflow.com/comment/47914408
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/29895906
has text: start here : http://stackoverflow.com/a/2445332/724913 . Once you have posted your login to the correct page and are redirected , you can open the next page as logged in.

http://stackoverflow.com/q/29926388
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/48025590
answer count: 0
tagged with: angular-material
has comment: http://stackoverflow.com/comment/49449729
has comment: http://stackoverflow.com/comment/48020722
type: Question
has comment: http://stackoverflow.com/comment/47995820
has body: I occasionally get garbage characters in the angular-material placeholders and I can't figure out the cause. Here's an example of the code in question: I have added the utf-8 meta tag to the index file and script imports and when inspecting the element it shows that the created by angular-material md-select directive just contains Location, as is expected. I am using Version 42.0.2311.90 (64-bit) of Google Chrome and this doesn't seem to affect other browsers. Has anyone else encountered an issue similar to this? Here is an example of what the characters look like. Here is an example of my inspector.
score: 0
has title: Garbage characters in angular-material placeholders in Google Chrome
tagged with: javascript
tagged with: angularjs

http://stackoverflow.com/q/29990223
upvote count: 2
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29990517
type: Question
has body: In angular the use of Track by to track selection by value instead of by reference is a nice feature if needed. But lets say I switch the array behind and the selected object id matches a new Id I want the select to change as well How do I force it to reevaluate? HTML: Update JS: $scope.collection = [{ id: 1, value: 0 }, { id: 2, value: 0 }, { id: 3, value: 0 }]; $scope.selectedObject = $scope.collection[0]; $scope.updateCollection = function () { var newColl = [{ id: 1, value: 100 }, { id: 2, value: 200 }, { id: 3, value: 300 }]; $scope.collection = newColl; Lets say I pick Id 2 and then update the selectedObject is still the old id:2 value:0, I want it to change straight into id:2 value:200. https://jsfiddle.net/IngoVals/p4ye3uaq/ P.S. Why doesn't the angular.copy work in the fiddle?
has title: Updating array used by ng-options, refresh selected object
tagged with: ng-options
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: angularjs
tagged with: angularjs-track-by
score: 2

http://stackoverflow.com/comment/47917650
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29897137
has text: @dsg My guess is not very different, but I'm not sure. Since the question :-)

http://stackoverflow.com/comment/47876649
type: AnswerComment
type: Comment
has text: Maybe you are confusing it with quantile.
comment on: http://stackoverflow.com/a/29875957
score: 0

http://stackoverflow.com/a/29965408
has comment: http://stackoverflow.com/comment/48050680
answers question: http://stackoverflow.com/q/29965326
has comment: http://stackoverflow.com/comment/48050625
has body: FB.getLoginStatus is async function so when you try getting fb_status outside it, you get undefined because FB.getLoginStatus didn't return any result yet
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/48050782

http://stackoverflow.com/comment/48223807
type: Comment
comment on: http://stackoverflow.com/a/29970480
type: AnswerComment
has text: Also make sure your server does not set any X-UA-Compatible response headers.
score: 0

http://stackoverflow.com/comment/48081062
type: AnswerComment
has text: Which router are you talking about? A router running in the browser or one that's running server side in node.js?
comment on: http://stackoverflow.com/a/29980575
type: Comment
score: 0

http://stackoverflow.com/a/29927723
accepted answer of: http://stackoverflow.com/q/29927638
score: 13
upvote count: 13
type: AcceptedAnswer
has body: The way you've written your code, it's not running onload, it's just running when the parser hits it. Because you wrote getLocation() rather than just getLocation, it executes the function. If you are certain there will be nothing else to be fired on load, you can do window.onload=getLocation;. If you want to make sure you play nicely with other code (including third-party frameworks/libraries) that might use the load event, you can do something like this: window.addEventListener('load', getLocation); Note that that code won't work in IE8. If you need to support IE8, check for addEventListener() and if it is not found, check for and use attachEvent() instead: if (window.addEventListener) { window.addEventListener('load', getLocation); } else if (window.attachEvent) { window.attachEvent('onload', getLocation); } else { window.onload = getLocation; }
type: Answer
answers question: http://stackoverflow.com/q/29927638
downvote count: 0

http://stackoverflow.com/a/29873187
answers question: http://stackoverflow.com/q/29871666
score: 2
downvote count: 0
has body: Yes, of course you can draw on the canvas from inside an object function... This code has a problem: var world_sprite=new Image(); world_sprite.src='someImage.png'; // This next line is executed too early! // The code attempts (fails) to drawImage world_sprite // because it has not fully loaded yet world = new Sprite(0, 0, 100, 100, 0.4, 0, 0, 0); world.draw(); The browser always loads images asynchronously. So in the above code, the line after world_sprite.src='someImage.png' is always executed before the image is fully loaded. You always need to give your new Images time to load by using their onload callback. var world_sprite=new Image(); world_sprite.onload=function(){ alert('I am displayed when world_sprite is fully loaded and ready to be used in `drawImage`); }; world_sprite.src='someImage.png'; So you would use onload in with your code like this: // Create your Sprite "class" function Sprite(spriteX, spriteY, spriteW, spriteH, scale, positionX, positionY, direction){ this.imagePath = world_sprite; this.spriteX = spriteX; this.spriteY = spriteY; this.spriteW = spriteW; this.spriteH = spriteH; this.scale = scale; this.positionX = positionX; this.positionY = positionY; this.direction = direction; this.speed = 5; this.noGravity = false; this.direction = 0; //Physics stuff this.velX = 0; this.velY = 0; this.friction = 0.98; }; Sprite.prototype.draw = function(){ context.drawImage(this.imagePath, this.spriteX, this.spriteY, this.spriteW, this.spriteH, this.positionX, this.positionY, this.spriteW * this.scale, this.spriteH * this.scale); }; // create and load world_sprite var world_sprite=new Image(); world_sprite.onload=function(){ // Only now is the world_sprite fully loaded and // ready to be used in drawImage. // So now create a new Sprite and do .draw() world = new Sprite(0, 0, 100, 100, 0.4, 0, 0, 0); world.draw(); }; world_sprite.src='someImage.png';
upvote count: 2
has comment: http://stackoverflow.com/comment/47871570
type: Answer

http://stackoverflow.com/q/29969830
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/48059289
type: Question
tagged with: graph
tagged with: charts
accepted answer: http://stackoverflow.com/a/29970071
has title: Highcharts, tooltip on hover listing datapoints that do not exist, is it an approximation?
tagged with: highcharts
answer count: 1
tagged with: javascript
score: 0
has body: When I create a stockchart, I noticed by accident that highcharts seems to show or create points that do not actually exist in the data set. Here is an jsfiddle that illustrates this: ( See added comment for the link, unable to just paste it because of idiotic rules on stackoverflow ) As you can see by hovering over the chart to show the tooltip, some of the data will show as having more than 2 decimals. In the data set there are no such data. All data has a maximum of 2 decimals. Of course I can do Highcharts.numberFormat(this.y, 2) but to me this highlights a bigger problem since I am interested in the actual reported datapoint, and not approximations. Is there a way to tell highcharts not to do this? I've tried to use type:'spline' to show data points as illustrated here: http://www.highcharts.com/demo/spline-irregular-time But couldn't get spline and stockchart to coexist. I would like a stockchart but with actual points dotted or similar.
has answer: http://stackoverflow.com/a/29970071

http://stackoverflow.com/q/29989854
has answer: http://stackoverflow.com/a/29989924
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29989929
type: Question
has body: I am iterating a JavaScript array object. I have written a function which iterates the array element. it works but above the result there is written 'undefined'. I don't want to see this, it would be great help to know how to solve this undefine word thing. var userlist = [{ "username": "Tom", "Current_latitude": 23.752805, "Current_longitude": 90.375433, "radius": 500 }, { "username": "Jane", "Current_latitude": 23.752805, "Current_longitude": 90.375433, "radius": 400 }, { "username": "Dave", "Current_latitude": 23.765138, "Current_longitude": 90.362601, "radius": 450 }, { "username": "Sarah", "Current_latitude": 23.792452, "Current_longitude": 90.416696, "radius": 600 }, { "username": "John", "Current_latitude": 23.863064, "Current_longitude": 90.400126, "radius": 640 } ]; var x = Tom(userlist); function Tom(user) { var text; for (var i = 0; i < user.length; i++) { text += " " + user[i].username + " "; }; //text+=" " document.getElementById("demo").innerHTML = text; } //document.getElementById("demo").innerHTML=userlist[0].username+" "+userlist[0].Current_latitude + " " + userlist[0].Current_latitude+"" + userlist[0].Current_longitude+" "+ userlist[0].radius; How to create A javaScript Object Array.
has title: Seeing "undefined" printed when iterating an array
tagged with: arrays
tagged with: javascript
score: 0
answer count: 2

http://stackoverflow.com/comment/47949515
type: QuestionComment
has text: You will not be able to get an accurate zip code but for country location IP is a valid option but not 100%. you can consider also the HTML5 Geolocation
comment on: http://stackoverflow.com/q/29913791
score: 0
type: Comment

http://stackoverflow.com/comment/47912754
type: AnswerComment
type: Comment
has text: Oops, `enumerate` is not a well-known symbol (@@enumerate) but an internal method. I would have to be `obj[Symbol.iterator] = function(){ return Reflect.enumerate(this) }`
comment on: http://stackoverflow.com/a/29891072
score: 0

http://stackoverflow.com/q/29888585
has comment: http://stackoverflow.com/comment/47901708
accepted answer: http://stackoverflow.com/a/29890732
has comment: http://stackoverflow.com/comment/47902121
type: AnsweredQuestion
score: 0
has answer: http://stackoverflow.com/a/68765176
has title: Isotope: Create warning if search and filter doesn't give back any result
has answer: http://stackoverflow.com/a/29890732
type: Question
possible better answer: http://stackoverflow.com/a/68765176
tagged with: javascript
tagged with: jquery-isotope
tagged with: jquery
linked to: http://stackoverflow.com/q/14596312
has body: I have written an extension for TYPO3. Now i have a problem. Can anyone tell me what i have to do if i want to display a custom warning text-message as soon as the searchstring or dropdown-filter doesn't give back any results? Something like: "Sorry - we can't find any entries with this search filters!" Currently my code is looking like this: // Isotope Steinlexikon $(function() { var $container = $('#lexikon-masonry'), $select = $('#lexikon-filter select'), filters = {}; var qsRegex; var SelectFilter = '*'; $container.isotope({ itemSelector: '.item', // Filter mit Suchfeld filter: function() { var $this = $(this); var SerRes = qsRegex ? $(this).text().match( qsRegex ) : true; var SelRes = $(this).is(SelectFilter); return SerRes && SelRes; } }); // use value of search field to filter var $quicksearch = $('#quicksearch').keyup( debounce( function() { qsRegex = new RegExp( $quicksearch.val(), 'gi' ); $container.isotope(); }, 200 ) ); // debounce so filtering doesn't happen every millisecond function debounce( fn, threshold ) { var timeout; return function debounced() { if ( timeout ) { clearTimeout( timeout ); } function delayed() { fn(); timeout = null; } timeout = setTimeout( delayed, threshold || 100 ); } } //fancybox $('.fancybox2').on('click', function(e){ e.preventDefault(); // Default action ausschalten $.fancybox({ //width: 500, //height: 400, autoSize: true, href: $(this).attr('href'), type: 'ajax' }); }); // Filter mit Select Form $select.change(function() { var $this = $(this); // store filter value in object // i.e. filters.color = 'red' var group = $this.attr('data-filter-group'); filters[ group ] = $this.find(':selected').attr('data-filter-value'); // console.log( $this.find(':selected') ) // convert object into array var isoFilters = []; for ( var prop in filters ) { isoFilters.push( filters[ prop ] ) } console.log(filters); SelectFilter = isoFilters.join(''); $container.isotope(); return false; }); }); #lexikon-masonry .item { margin: 5px; padding: 5px…
has comment: http://stackoverflow.com/comment/47900872
answer count: 2

http://stackoverflow.com/comment/47891451
type: Comment
type: QuestionComment
has text: Can include `html` , `js` at Question ?
score: 1
comment on: http://stackoverflow.com/q/29883720

http://stackoverflow.com/comment/47866270
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29870586
has text: @DavidWeldon I updated my question with my method call. I am seeing the error in my browser console. My terminal console says 'undefined'

http://stackoverflow.com/comment/48107052
type: AnswerComment
type: Comment
has text: @OfirBaruch - Your browser console may be showing you something incorrect. (Mine seems to.) If you open the file at `https://code.jquery.com/ui/1.8.18/jquery-ui.min.js` and look at line 14, col 5350, it is the code for the dialog buttons.
comment on: http://stackoverflow.com/a/29993294
score: 0

http://stackoverflow.com/comment/48089658
type: Comment
score: 1
has text: This is commonly done and very easy to do - Google it, most of us did.
type: QuestionComment
comment on: http://stackoverflow.com/q/29985161

http://stackoverflow.com/comment/47999754
type: QuestionComment
comment on: http://stackoverflow.com/q/29939299
score: 0
has text: please copy/paste the error message
type: Comment

http://stackoverflow.com/a/29918096
downvote count: 0
has body: The MIME type of your file might not be UTF-8. Try overriding it as suggested here and depicted below: xhr.open('GET', 'http://www.virtualmechanics.com/support/tutorials-spinner/Simple2.pdf', true); xhr.overrideMimeType('text/xml; charset=iso-8859-1'); xhr.send();
score: 4
answers question: http://stackoverflow.com/q/29917030
type: Answer
upvote count: 4

http://stackoverflow.com/q/29854522
has comment: http://stackoverflow.com/comment/47835367
favorite count: 0
tagged with: ajax
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47834966
has body: I m validating variables from html inputs in ajax javascript . What i m trying to do for sure is when client Click the Submit button which it variable is var sub another div from html file should appear but after completing to fill the required fields. But when i tried doing it i get no response means the html div that should appear HTML User name: Phone Number: Your Description Tigo Pesa Vodacom Mpesa AirTel Money and ajax javascript Jquery code var ajax = ajaxObj("POST", "function.php"); info.innerHTML = "Please wait ..."; ajax.onreadystatechange = function(){ if(ajaxReturn(ajax) == true){ if(ajax.responseText != "please wait"){ info.innerHTML = ajax.responseText; sb.style.display = "block"; }else if(ajax.responseText = "please wait"){ $(document).ready(function(){ $("#form").show(function(){ $("#form").slideUp(3840); $("#payment2").show(); }); }); } } } ajax.send("u="+u+"&n="+n+"&t="+t); } Problem is on else if(ajax.responseTex = "please wait") please if there is any way of doing this just show me
downvote count: 1
has comment: http://stackoverflow.com/comment/47835295
type: Question
has answer: http://stackoverflow.com/a/29854754
has comment: http://stackoverflow.com/comment/47835227
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/47835141
upvote count: 0
answer count: 1
tagged with: jquery
has title: html javascript ajax jquery

dialog
tag name: dialog
tags question: http://stackoverflow.com/q/29920893
tags question: http://stackoverflow.com/q/29970682
tags question: http://stackoverflow.com/q/29949366
type: Tag
tags question: http://stackoverflow.com/q/29930757

http://stackoverflow.com/a/29978090
answers question: http://stackoverflow.com/q/29977668
score: 6
has comment: http://stackoverflow.com/comment/48101856
has comment: http://stackoverflow.com/comment/65656815
has comment: http://stackoverflow.com/comment/48102193
accepted answer of: http://stackoverflow.com/q/29977668
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/48106668
has body: Answer You are using the wrong uri. You need api/titleEstimate/getTitleEstimate. That explains and will resolve your 404. Answer to Follow Up Question Everything else you're doing almost works. After you resolve the 404, you'll find that you aren't receiving the value FromUri, and you'll have a follow up question. So, you need to change your route config to this: config.Routes.MapHttpRoute( name: "Default", routeTemplate: "api/{controller}/{action}" ); Then you'll not only resolve your 404 but also receive the FromUri value that you're sending as query string parameters. Demo Here is a fiddle for evidence, which is calling into this controller, which is hosted LIVE here. The only thing I changed in the working version are the uri to resolve the 404 and the route config to make sure you receive the FromUri value. That's all. HTML Username: Submit Submit Fail JavaScript This will succeed. Note, we only need domain because we doing cross-site scripting here for the demo purpose. var domain = "https://cors-webapi.azurewebsites.net"; $("#submit").click(function () { var uri = domain + '/api/titleEstimate/getTitleEstimate'; var query = { "username": $("#user").val(), // other fields }; $.getJSON(uri, query) .done(function (data) { $('#product').text(data); }) .fail(function (jqXHR, textStatus, err) { $('#product').text('Error: ' + err); }); }); This will 404. $("#submit-fail").click(function () { var uri = domain + '/api/titleEstimate'; var query = { "username": $("#user").val(), // other fields }; $.getJSON(uri, query) .done(function (data) { $('#product').text(data); }) .fail(function (jqXHR, textStatus, err) { $('#product').text('Error: ' + err); }); }); Controller public class TitleEstimateController : ApiController { public class EstimateQuery { public string username { get; set; } } public IHttpActionResult GetTitleEstimate([FromUri] EstimateQuery query) { // All the values in "query" are null or zero // Do some stuff with query if there were anything to do if(query…
type: Answer
has comment: http://stackoverflow.com/comment/48110909
has comment: http://stackoverflow.com/comment/48105695
upvote count: 6

http://stackoverflow.com/comment/47914371
has text: what did you tried already? What is the login method (webpage, htaccess, ...)?
type: Comment
score: 1
type: QuestionComment
comment on: http://stackoverflow.com/q/29895906

http://stackoverflow.com/comment/64096014
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/30047862
type: Comment
has text: Works like a charm! I do however notice that sometimes `m.request` is not defined. Do you see that happening too, and if so do you know why this happens?

http://stackoverflow.com/a/29851593
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/48816588
score: 0
has body: What you probably want are url parameters.. Here's a function that uses regex to grab a param from the url function gup( name ){ name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]"); var regexS = "[\\?&]"+name+"=([^&#]*)"; var regex = new RegExp( regexS ); var results = regex.exec( window.location.href ); if( results == null ) return ""; else return results[1]; } I wouldn't sweat what's going on in there.. but to use it you'ld have a url (mysite.com/coolPage) if they go there with a parameter (mysite.com/coolPage?whosCool=ImCool) you can, in your javascript call gup("whosCool") and it'll return "ImCool" in your example, you'ld have mySite.com?state=oklahoma&gender=male in your javascript you can, on load: document.getElementById('state').value = gup('state');​​​​​​​​​​ document.getElementById('gender').value = gup('gender');​​​​​​​​​​ to build the url, when they make all of their selections you'll build the url with the parameters. var url = "mycoolSite.com/mypage?"; url += "state=" + document.getElementById('state').value; url += "gender=" + document.getElementById('gender').value; document.getElementById('outputURL').innerHTML = "Your url"; That's the pieces, you'll have to build it all together though
answers question: http://stackoverflow.com/q/29851298
type: Answer
accepted answer of: http://stackoverflow.com/q/29851298
has comment: http://stackoverflow.com/comment/47863044

http://stackoverflow.com/a/29938492
score: 0
type: Answer
has body: You can set width on title and adapt margin. yAxis: { title: { enabled: true, text: 'Custom with simple markupCustom with simple markupCustom with simple markupCustom with simple markup', margin: 40, style: { width: 200, fontWeight: 'normal' } } }, Example: http://jsfiddle.net/EUSVQ/12/
answers question: http://stackoverflow.com/q/29918054

http://stackoverflow.com/comment/48126928
comment on: http://stackoverflow.com/q/29999002
has text: I want to recreate this page with php and doing so is simple. What isn't simple is getting the bricks to remain at their set ratio when the page is resized.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47947975
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29910678
score: 0
has text: Can you show how you used that!! @gaurav.. :)

http://stackoverflow.com/q/29895937
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
accepted answer: http://stackoverflow.com/a/29896135
has comment: http://stackoverflow.com/comment/47914773
type: AnsweredQuestion
has title: Modal with iframe in it
has body: I am trying to open iframe within modal-body. I am adding src dynamically. But its adding url of main background page to the opened URL. What I have tried is? × Hi User, How are you?? Kangana Ranaut's interesting statements $('#myModal').on('show.bs.modal', function (e) { var heading = e.relatedTarget.dataset.newsSource, newsUrl = e.relatedTarget.dataset.url, $modal = $(this); $("#myModalLabel").html("News Source - " + heading); $('iframe').attr({src: newsUrl}); console.log(newsUrl); }); Its giving error on console that the requested url : http://localhost/desibazar/news/%27http%3A%2F%2Ftimesofindia.indiatimes.com%2Fentertainment%2Fhindi%2Fbollywood%2FKangana-Ranauts-interesting-statements%2Fphotostory%2F47070425.cms%27" is not found on server. Second issue is its adding css rule to modal-header as dom is completed. Show its not showing modal-header in my ModalBox.
tagged with: iframe
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/29896135
tagged with: jquery

http://stackoverflow.com/a/29913529
upvote count: 1
answers question: http://stackoverflow.com/q/29913099
downvote count: 0
has comment: http://stackoverflow.com/comment/47949133
type: Answer
has body: You can use Offline.on(event, handler, context) to know when connection goes online/offline. Like if connection goes offline Offline.on('up', function gotOnline(){ console.log("I am online"); }) Offline.on('down', function gotOffline(){ console.log("I am offline"); })
score: 1

http://stackoverflow.com/q/29989937
upvote count: 1
accepted answer: http://stackoverflow.com/a/29990088
type: Question
answer count: 2
tagged with: javascript
has title: NodeJS, websocket, and module.export
downvote count: 0
tagged with: websocket
favorite count: 0
has answer: http://stackoverflow.com/a/29990088
possible better answer: http://stackoverflow.com/a/29990140
has body: I have a server.js file. Inside, i defined my routes. // routes var mainRoutes = require('./routes/main.js')(app, express); var apiRoutes = require('./routes/api.js')(app, express); var socketRoutes = require('./routes/socket.js'); app.use('/', mainRoutes); app.use('/api', apiRoutes); // socket.io communication io.sockets.on('connection', socketRoutes); My socket.js file looks like that : module.exports = function (socket) { console.log('user connected'); socket.on('myEvent', function(data) { // whatever ... }); } Inside this function, i can catch events and send some. BUT i need to send a message to everyone at some point. Let say when i receive an 'myEvent' event. So basically, i would like to do : io.sockets.emit('messageForEveryone', "This is a test"); But here, i can only work on the 'socket' argument, which is for 1 person only i guess. I would like to pass io from server.js, to socket.js. I tried that (in server.js) : var socketRoutes = require('./routes/socket.js', io); And that (in socket.js) : module.exports = function (io, socket) Obviously, it's not working. I don't even understand where the socket argument is coming from. Question : How can i work on io object, when i'm inside the module.export of the sockets.js file ? I would really appreciate any help, i'm new to all of this. Thanks !
has answer: http://stackoverflow.com/a/29990140
tagged with: node.js
type: AnsweredQuestion
score: 1

http://stackoverflow.com/comment/48454564
has text: @Kaiido Tried , new `window` not opening at jsfiddle ?
score: 0
type: Comment
comment on: http://stackoverflow.com/a/30134616
type: AnswerComment

http://stackoverflow.com/q/29965326
has title: Javascript Function and show global vars
tagged with: facebook-javascript-sdk
has comment: http://stackoverflow.com/comment/48050610
linked to: http://stackoverflow.com/q/14220321
type: Question
answer count: 2
duplicate of: http://stackoverflow.com/q/14220321
has comment: http://stackoverflow.com/comment/48050490
has answer: http://stackoverflow.com/a/29965456
has body: I try do this : &lt;script&gt; FB.getLoginStatus(function(response) { if (response.status==='connected') { var fb_status="on"; } else { var fb_status="off"; } }); alert("ok"+fb_status); &lt;/script&gt; If i put alert inside function , this alert works , by other side , if i put this alert outside , no works i supose this it´s more or less the same as global vars in php but no have many experience in Javascript I only need the same i put in the example for detect in a var the result from function but as in the case i put as example , outside function , i try many things but no get results Regards and thank´s for the help to community
has comment: http://stackoverflow.com/comment/48051224
score: 0
has comment: http://stackoverflow.com/comment/48050529
linked to: http://stackoverflow.com/q/7522947
tagged with: javascript
type: UnansweredQuestion
tagged with: jquery
has answer: http://stackoverflow.com/a/29965408

http://stackoverflow.com/comment/48057056
score: 0
type: QuestionComment
type: Comment
has text: Instead of using ajax you should read the file data server side.
comment on: http://stackoverflow.com/q/29968518

http://stackoverflow.com/comment/48013801
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/29946353
has text: @Pointy Off-course :) It's not working otherwise I wouldn't post it :)
type: Comment

http://stackoverflow.com/comment/48021153
score: 0
comment on: http://stackoverflow.com/a/29950082
type: Comment
has text: Cool. I'd rather when I hit `Choose a state...` that it displayed all my results.
type: AnswerComment

http://stackoverflow.com/a/29971463
type: AcceptedAnswer
type: Answer
downvote count: 0
has body: This almost certainly doesn't follow best practices but I'm a noob with Angular. It does work though: http://plnkr.co/edit/oGNC3ZUZHDHrBrMyRKjW?p=preview var app = angular.module("CheckAllModule", []); app.controller("checkboxController", function($scope) { $scope.struct = ['First', 'Second']; $scope.checkAll = function(selected, chkArray) { for (var chk in chkArray) { chkArray[chk] = selected } }; }); I made some adjustments to your html to get this working: {{s}} item Subitem A Subitem B Subitem C Update I was thinking about how better to test x1 && x2 && x3 the conversion to an array was the first step but then you can do: x.indexOf(false) (Ideally you would use .reduce(function(a,b) { return a && b; }) but reduce is not yet well enough supported and to be fair, it's a bit more clunky) - strangely this is not working yet.
score: 3
has comment: http://stackoverflow.com/comment/48272378
accepted answer of: http://stackoverflow.com/q/29970372
upvote count: 3
answers question: http://stackoverflow.com/q/29970372

http://stackoverflow.com/comment/47829522
type: Comment
comment on: http://stackoverflow.com/q/29848997
type: QuestionComment
score: 0
has text: In your parent window, get a handle on your iframe and add an event listener to it. `$('iframe').contents().on('my_event', function() {console.log('Parent sees event')});`

http://stackoverflow.com/a/29872266
has body: This is like dealing with super in other languages. To access super data, use: this.constructor
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/29871362
type: Answer
upvote count: 1

http://stackoverflow.com/q/29943000
accepted answer: http://stackoverflow.com/a/29943045
score: 0
has title: JQuery Datepicker - displaying date in several fields
has answer: http://stackoverflow.com/a/29943081
tagged with: date
type: Question
tagged with: javascript
tagged with: jquery
answer count: 3
has answer: http://stackoverflow.com/a/29943045
has answer: http://stackoverflow.com/a/29943242
tagged with: datepicker
has body: I'm having a list with several activities, and I want the jQuery Datepicker to display the date in a field in each row. At the moment I'm able to display the date in the first row, but it seem like it only will display in one field with id="date" at a time. The field in each row look like this: &lt;td&gt;&lt;input id="date" name="date" /&gt;&lt;/td&gt; So, what I'm wondering: Is there a way I can display the date in every input field with id="date"?
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/29943081

http://stackoverflow.com/comment/47897165
comment on: http://stackoverflow.com/q/29886170
score: 0
type: Comment
type: QuestionComment
has text: where did you put jquery event key up,` ` in your code? are trying to achieve filter/search via event keyup or submit button

http://stackoverflow.com/q/29973533
linked to: http://stackoverflow.com/q/6215841
answer count: 2
linked to: http://stackoverflow.com/q/34918750
upvote count: 9
tagged with: chart.js
tagged with: javascript
type: UnansweredQuestion
has body: I'm not sure this is possible without doing something along the line of: Create links in HTML canvas but let's make sure. Is there a way to (relatively) simply turn Chart.js labels into links? The chart in question is the radar chart: http://www.chartjs.org/docs/#radar-chart (So far I've been using the legend for that, works fine with a little library modification, but now I should use the labels themselves.)
has comment: http://stackoverflow.com/comment/48067109
downvote count: 0
has answer: http://stackoverflow.com/a/69725331
favorite count: 0
has title: Chart.js turn labels into links
has answer: http://stackoverflow.com/a/74300906
score: 9
type: Question
has comment: http://stackoverflow.com/comment/48068034
has comment: http://stackoverflow.com/comment/48068224

http://stackoverflow.com/comment/47888668
comment on: http://stackoverflow.com/a/29882264
type: Comment
has text: Well, the *idiomatic* approach is not to use your own loops in any case. Writing manual loops works, of course, but it does not follow jQuery's spirit.
score: 0
type: AnswerComment

http://stackoverflow.com/q/29990924
type: Question
has comment: http://stackoverflow.com/comment/48101515
has comment: http://stackoverflow.com/comment/48101316
has answer: http://stackoverflow.com/a/29991035
tagged with: javascript
tagged with: keycode
score: 0
tagged with: keypress
answer count: 1
tagged with: calculator
accepted answer: http://stackoverflow.com/a/29991035
has comment: http://stackoverflow.com/comment/48101379
has title: Using keypress to target two different keys within same expression?
type: AnsweredQuestion
has body: I am building a calculator in vanilla JS and currently have this expression to handle the multiplication: if ((isShift == true &amp;&amp; event.keyCode == 56) || event.keyCode == 106){ calc.passMethod('multiply'); } So if someone holds Shift+8 it will multiply. How can I make it so that if someone also hits x that it will multiply? Here would be the function if it was for x: if (event.keyCode == 88 || event.keyCode == 106) Any help would be great! Thanks!

http://stackoverflow.com/comment/138602803
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/29918884
type: Comment
has text: Another point in the "TS **is** a superset of JS" column: if I use a different "compiler" (e.g. preset-typescript), I can plop literally any valid JS code into a .ts file and it will transpile back to JS without incident. So you _can_ "just copy JavaScript and rename to TypeScript" or "compile the same code in TS" if you use Microsoft's preset-typescript instead of Microsoft's tsc. Further, by conceptually casting everything in the aforesaid valid JS code to `any`, I'd argue that any valid JS program is also ""well typed"" TS, too, even if one of TS's compilers complains by default.

http://stackoverflow.com/comment/48110599
comment on: http://stackoverflow.com/a/29995324
type: Comment
has text: setInterval has no meaning in this context, since the page is refreshed, the timer will only ever be called once...
score: 0
type: AnswerComment

http://stackoverflow.com/comment/48045102
score: 0
type: Comment
has text: Thank you this solves my issue :) May I ask what the parent actually is in this case? Also I never id'd my Flickable because I read somewhere that due to an implementation detail you should only refer to it as a parent. I must have misunderstood that. Thanks again!
type: AnswerComment
comment on: http://stackoverflow.com/a/29960388

angularfire
tags question: http://stackoverflow.com/q/29900260
tag name: angularfire
type: Tag
tags question: http://stackoverflow.com/q/29885489
tags question: http://stackoverflow.com/q/29933225

http://stackoverflow.com/comment/47859398
comment on: http://stackoverflow.com/a/29862039
has text: Great idea to use futures here! I'm definitely give it a try.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/29871144
has comment: http://stackoverflow.com/comment/47867730
has comment: http://stackoverflow.com/comment/47867454
has answer: http://stackoverflow.com/a/29871530
type: UnansweredQuestion
has body: I know I can focus and select an HTML selectbox drop-down with jquery: &lt;script&gt; $('#otherbox').on('change', function() { $("#selbox").focus(); $("#selbox").select(); }); &lt;/script&gt; But this only focuses the selectbox but it doesn't open it, I still have to click on the select-element with the mouse to open it. How can I automatically open the selectbox by another event?
has title: Select and open a selectbox with jquery
linked to: http://stackoverflow.com/q/249192
type: Question
has comment: http://stackoverflow.com/comment/47867311
linked to: http://stackoverflow.com/q/19652085
tagged with: javascript
linked to: http://stackoverflow.com/q/2895608
score: 0
answer count: 1
tagged with: drop-down-menu
tagged with: jquery

http://stackoverflow.com/q/29858218
answer count: 1
has comment: http://stackoverflow.com/comment/47842697
favorite count: 0
type: UnansweredQuestion
downvote count: 0
score: 1
has body: I'm trying to make a call to the Yelp API from JavaScript, but getting an error. Below is my code. I believe I will have to use Oauth, but I don't know where should I put it in the header. function doAjax(){ var xhr = new XMLHttpRequest(); var url = "http://api.yelp.com/v2/searchterm=cream+puffs&amp;location=chicago"; xhr.onreadystatechange = function(){ if(xhr.readyState == 4 &amp;&amp; xhr.status == 200){ var some = JSON.parse(xhr.responseText); } } xhr.open('GET', url, true); xhr.send(); }
type: Question
tagged with: api
has comment: http://stackoverflow.com/comment/47842400
tagged with: yelp
has answer: http://stackoverflow.com/a/30253870
tagged with: javascript
tagged with: ajax
has comment: http://stackoverflow.com/comment/47842388
upvote count: 1
has title: Ajax Yelp API Call from Javascript

http://stackoverflow.com/q/29889781
has comment: http://stackoverflow.com/comment/48518494
has comment: http://stackoverflow.com/comment/61018157
downvote count: 0
has body: I am trying to generate pdf from html using JSPDF and html having one complex table, Added image below. You can see in this Fiddle, What i tried so far. pdf.fromHTML( source, // HTML string or DOM elem ref. margins.left, // x coord margins.top, { // y coord 'width': margins.width, // max width of content on PDF 'elementHandlers': specialElementHandlers }, function (dispose) { // dispose: object with X, Y of the last line add to the PDF // this allow the insertion of new lines after html pdf.save('Test.pdf'); }, margins); Problem is, when i try to generate pdf i am getting Uncaught TypeError: Cannot read property 'name' of undefined Is it possible to use JSPDF for this kind of complex table or will it only work for a simple table. EDIT: Solved this by different way, This is what i did I converted HTML Table into Canvas html2canvas.js You can get canvas as Base64 image using canvas.toDataURL("image/jpeg") Once i got Base64 image, Created empty PDF using JSPDF and using addImage feature of JSPDF, i manage to embed Base64 image inside PDF. If you need charts and images as part of PDF -> charts and images as part of PDF Credit goes to my brain.
has comment: http://stackoverflow.com/comment/110339995
has title: Generating PDF from complex html table using JSPDF
upvote count: 8
type: Question
tagged with: jspdf
has answer: http://stackoverflow.com/a/30818845
has comment: http://stackoverflow.com/comment/61018424
tagged with: javascript
has answer: http://stackoverflow.com/a/29890286
favorite count: 0
has comment: http://stackoverflow.com/comment/60972714
tagged with: http://stackoverflow.com/tag/pdf
tagged with: http://stackoverflow.com/tag/html
answer count: 4
score: 8
has answer: http://stackoverflow.com/a/34199450
has answer: http://stackoverflow.com/a/38884058
type: UnansweredQuestion

http://stackoverflow.com/comment/47975752
score: 0
has text: Edited the question above to add the Code.gs snippet that contains the HTMLService call and sets the sandbox mode.
comment on: http://stackoverflow.com/q/29922088
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29944056
score: 1
has body: You can do it like this. The brown div "slides" from the bottom to the top. I hope this is what you need. You've to use your background images instead of the colors of course. function onClick(){ document.getElementById("second").style.height = "0px"; } div{ position: absolute; height: 50px; width: 50px; } #first{ background-color: brown; } #second{ background-color: beige; transition: height 1s; } &lt;div id="first"&gt;&lt;/div&gt; &lt;div id="second" onclick="onClick()"&gt;&lt;/div&gt;
downvote count: 0
has comment: http://stackoverflow.com/comment/48010857
type: Answer
answers question: http://stackoverflow.com/q/29943770
upvote count: 1
has comment: http://stackoverflow.com/comment/48009985

http://stackoverflow.com/comment/48061210
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/29970083
type: Comment
has text: @BruceChecca i make it work for your code, although date should be in better format to be able for easy parsing.

http://stackoverflow.com/q/29849802
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
tagged with: undefined
has comment: http://stackoverflow.com/comment/47826698
has title: Getting undefined value from a global variable whilst assigning new value
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47826281
has comment: http://stackoverflow.com/comment/47826526
has body: This is my Javascript game, which is basically brick braker without the bricks. I'm currently getting a undefined error on line 188 (ball). It's been declared as a global variable and is then being assigned new values. My JS skills are elow average and have been scratching my head over this for a while. If any one can give me pointers on actually getting this thing running i would be very appreciative!! Thanks in advance. Pong Racker Your browser doesn't support HTML5. Please install a newer browser version : http://windows.microsoft.com/en-US/internet-explorer/products/ie/home?ocid=ie9_bow_Bing&WT.srch=1&mtag=SearBing <circle cx="100" cy="100" r=10 id="ball" stroke="black" stroke-width="2" fill="white" /> <rect id="pad" height="15px" width="150px" x="400" y="350" rx="10" ry="20"/>
has comment: http://stackoverflow.com/comment/47826974
has comment: http://stackoverflow.com/comment/47825867
type: Question
has answer: http://stackoverflow.com/a/29850332
tagged with: javascript
has comment: http://stackoverflow.com/comment/47826858

http://stackoverflow.com/comment/47966079
type: QuestionComment
type: Comment
has text: because i will append that style dynamically based on input
score: 0
comment on: http://stackoverflow.com/q/29922328

http://stackoverflow.com/q/29939266
has answer: http://stackoverflow.com/a/29939437
has answer: http://stackoverflow.com/a/29939375
accepted answer: http://stackoverflow.com/a/29939368
has title: Javascript, For loop: returned 'i' value is different from that is stored
type: AnsweredQuestion
tagged with: alert
has answer: http://stackoverflow.com/a/29939368
type: Question
tagged with: for-loop
tagged with: javascript
has body: In this loop the alert(i) alerts 12,and firebug displays 10 as the end result. for(var i=0;i&lt;=10;i=i+2){ document.write=i; } alert(i);
score: 0
possible better answer: http://stackoverflow.com/a/29939375
answer count: 3

http://stackoverflow.com/comment/48038860
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29943975
has text: That, in my view, would be the simpler part of the task. It all depends on how you structure your document; it `Other` is always the last choice .... use `$(':checkbox[id^="Offices_"]').last()` to select other ... or, if you gave it a `data-value="other"` attribute, you could use it to zero in on the right checkbox ......
score: 1

http://stackoverflow.com/comment/48046754
comment on: http://stackoverflow.com/a/29961520
score: 0
type: Comment
has text: then you have to add those manually - but sharedcount should cover all you need. i believe it even includes pinterest, for example.
type: AnswerComment

http://stackoverflow.com/a/29939822
answers question: http://stackoverflow.com/q/29939567
downvote count: 0
has comment: http://stackoverflow.com/comment/48003262
has comment: http://stackoverflow.com/comment/48001296
type: Answer
upvote count: 1
has body: You can use the forever function from async, and inside this call async.series
score: 1
has comment: http://stackoverflow.com/comment/48004154

http://stackoverflow.com/q/29869400
score: 0
has title: Input special character in search string when handled at server side
answer count: 1
tagged with: javascript
tagged with: xss
tagged with: security
tagged with: http://stackoverflow.com/tag/html
tagged with: regex
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29930571
type: Question
accepted answer: http://stackoverflow.com/a/29930571
has comment: http://stackoverflow.com/comment/47868092
has comment: http://stackoverflow.com/comment/47872491
has comment: http://stackoverflow.com/comment/47864008
has comment: http://stackoverflow.com/comment/47864132
has body: I'm testing a project I'm working on. Here I've put a filter on server side(Java) to redirect the page to Error page whenever I encounter any HTML tag like regex(URL Encoded is also checked) in query string. As per my skill set, it's working fine. But I'm very much sure it's not the end. There must be a way to still enter the vector to execute XSS script. Examples : &#60;hello&#62; redirects to error page %3Chello%3E converts to &#60;hello&#62; and redirected to error page %253Chello%253E converts to %3Chello%3E &amp; page works fine as no HTML tag is found.

http://stackoverflow.com/comment/48011142
comment on: http://stackoverflow.com/q/29903524
type: QuestionComment
type: Comment
score: 1
has text: I was going to say that if your code works "but (you) believe there is a better way" this belongs on codereview.stackexchange instead, but I ran your code and it is returning an empty array for me

http://stackoverflow.com/a/29916500
type: Answer
has comment: http://stackoverflow.com/comment/47954397
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/29916227
has body: The regex you are asking is pretty trivial and you should learn regexes by analyzing this one. The regex following your behaviour is: '/\d{4}-[a-zA-Z]{4}-\d{5}/' Explanations: 4 Numeric \d{4} means that you want exactly 4 occurences of "\d" which is a number 4 Alpha As num is not included in alpha, then you'll search for any occurence of letters that are exactly 4: [a-zA-Z]{4} 5 Numeric Same as 4 numbers but with a 5 instead of a 4 in the brackets (\d{5})
downvote count: 0

http://stackoverflow.com/comment/47840451
comment on: http://stackoverflow.com/q/29856201
score: 0
type: Comment
type: QuestionComment
has text: When you assign to `.style` you're adding an inline style, which takes precedence over CSS.

http://stackoverflow.com/comment/48065428
comment on: http://stackoverflow.com/q/29969349
score: 0
type: Comment
type: QuestionComment
has text: try this in Your mainactivity view.setLayerType(View.LAYER_TYPE_SOFTWARE, null);

http://stackoverflow.com/q/29962306
tagged with: google-maps-api-3
has answer: http://stackoverflow.com/a/29963988
score: 2
downvote count: 0
type: UnansweredQuestion
type: Question
has title: How to pass a javascript array to ASP.NET MVC model?
tagged with: c#
has answer: http://stackoverflow.com/a/29962459
tagged with: asp.net-mvc
has comment: http://stackoverflow.com/comment/48046509
has comment: http://stackoverflow.com/comment/48045069
upvote count: 2
answer count: 2
has body: I want to create a field object in ASP.NET MVC and store it to a database. The field should contain its coordinates which the user can select with the google maps api. And now, how can I pass the coordinates of the markers, which are stored in a javascript array, to the Model´s List? This is my Controller for this: using System; using System.Collections.Generic; using System.Data; using System.Data.Entity; using System.Linq; using System.Net; using System.Web; using System.Web.Mvc; using BL; using MvcAgrarTest.Models; namespace MvcAgrarTest.Controllers { public class FieldsController : Controller { private MvcAgrarContext db = new MvcAgrarContext(); // GET: Fields public ActionResult Index() { var field = db.CreateFieldViewModel.Include(f => f.FieldType); return View(field.ToList()); } // GET: Fields/Create public ActionResult Create() { var model = new CreateFieldViewModel(); ViewBag.FieldTypeId = new SelectList(db.FieldType, "FieldTypeId", "Name"); return View(model); } // POST: Fields/Create [HttpPost] [ValidateAntiForgeryToken] public ActionResult Create(CreateFieldViewModel model, CreateFieldViewModel field, string[] markers) { if (ModelState.IsValid) { PostCoordinates(markers); db.CreateFieldViewModel.Add(field); db.SaveChanges(); return RedirectToAction("Index"); } ViewBag.FieldTypeId = new SelectList(db.FieldType, "FieldTypeId", "Name", field.FieldTypeId); return Json(true); } protected override void Dispose(bool disposing) { if (disposing) { db.Dispose(); } base.Dispose(disposing); } } } Here my Create View with the Google Maps script: @model MvcAgrarTest.Models.CreateFieldViewModel @{ ViewBag.Title = "Create"; } Feld anlegen @using (Html.BeginForm()) { @Html.AntiForgeryToken() @Html.ValidationSummary(true, "", new { @class = "text-danger" }) @Html.LabelFor(model => model.Name, htmlAttributes: new { @class = "control-label col-md-2" }) @Html.EditorFor(model => model.Name, new { htmlAttributes = new { @placeholder = "Feldname", @class = "form-control" } }) @…
tagged with: javascript
tagged with: asp.net
favorite count: 0

http://stackoverflow.com/comment/48042687
type: Comment
score: 1
comment on: http://stackoverflow.com/q/29961083
type: QuestionComment
has text: try to create fiddle that will show your issues.

http://stackoverflow.com/a/29989906
has comment: http://stackoverflow.com/comment/48131082
type: AcceptedAnswer
score: 0
type: Answer
has body: datepicker-popup="d M yyyy" Plunker This works for '1 2 2015' but goes back to US date if you put a 0 before a day or a month '1 02 2015'.
accepted answer of: http://stackoverflow.com/q/29989305
answers question: http://stackoverflow.com/q/29989305

http://stackoverflow.com/q/29992780
has answer: http://stackoverflow.com/a/29992918
accepted answer: http://stackoverflow.com/a/29993002
has comment: http://stackoverflow.com/comment/48105415
has comment: http://stackoverflow.com/comment/48105039
has answer: http://stackoverflow.com/a/29992988
has comment: http://stackoverflow.com/comment/48105014
answer count: 4
has comment: http://stackoverflow.com/comment/48105167
type: AnsweredQuestion
tagged with: javascript
tagged with: jquery
has title: Attach ClickEvent to a button via JavaScript / JQuery / Bootstrap
type: Question
has answer: http://stackoverflow.com/a/29993002
has body: I'm making a small game that involves smurf and toadstools. I've been able to already make this. [Can't do direct image :/ Reputation = 6] http://gyazo.com/e9cab4b04e6735712cf67e69c689fb7b Each of the white / red and white / blue circles is a button in it's own seperate div. What I wan't to do now is "attach" a clickEvent handler to each of those buttons so that whenever a button get's pressed, the image switches to either blank or the red and white ones. The buttons are created with code as below: var circle = document.createElement('button'); column.appendChild(circle); and each button has it's own ID. So is there any simple and easy way to make each button respond to a click like mentioned above? The data I would need later is most importantly the ID of the clicked button. Since it's id has a reference to the row and column it belongs in.
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29993145
tagged with: twitter-bootstrap
score: 0
possible better answer: http://stackoverflow.com/a/29992918

http://stackoverflow.com/comment/48118091
type: QuestionComment
comment on: http://stackoverflow.com/q/29995960
score: 0
has text: Have you created a text index? If yes, how? If no: do this now!
type: Comment

http://stackoverflow.com/q/29898854
has comment: http://stackoverflow.com/comment/47921052
answer count: 1
tagged with: page-loading-message
has comment: http://stackoverflow.com/comment/47922169
tagged with: ajax
accepted answer: http://stackoverflow.com/a/29899045
has comment: http://stackoverflow.com/comment/47922643
tagged with: pageload
type: AnsweredQuestion
score: 0
has comment: http://stackoverflow.com/comment/47920422
type: Question
linked to: http://stackoverflow.com/q/68485
has comment: http://stackoverflow.com/comment/47920830
has comment: http://stackoverflow.com/comment/47920514
has answer: http://stackoverflow.com/a/29899045
has body: I have multiples Synchronous AJAX requests and it takes 3 seconds to load my page . What i want to do is to display a loading page ( with a gif ) and when the page is loaded like when the Ajax requests are completed it fades out. I followed an example from smallenvelop.com but the gif image looks freezed and just until the end that it displays the animation . how can i overcome this ? like even if the synchronous ajax requests are running my page can display the animation ?
tagged with: javascript
tagged with: jquery
has title: Synchronous AJAX, page loading gif

http://stackoverflow.com/comment/48040220
type: Comment
type: AnswerComment
has text: Thanks a lot for your suggestion. Let me try this :)
comment on: http://stackoverflow.com/a/29937091
score: 0

http://stackoverflow.com/comment/47926097
type: Comment
score: 2
comment on: http://stackoverflow.com/q/29901736
has text: Do you actually have a measurable performance problem?
type: QuestionComment

http://stackoverflow.com/a/29992789
answers question: http://stackoverflow.com/q/29878525
has comment: http://stackoverflow.com/comment/48263722
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29878525
has comment: http://stackoverflow.com/comment/48269124
has comment: http://stackoverflow.com/comment/48240427
has comment: http://stackoverflow.com/comment/48233036
score: 7
has body: I couldn't let this go, so I've tested it quite extensively. In the end of the day, it works like it should. There is no need to stop, start or render it. The issue must be with your json-data, or the data in general (dates, ints). I created two examples in jsfiddle, demonstrating that it does indeed work with the type of data you seem to be expecting. I would advise you to log data.days, d.Day.id and finally disabledDays to console to check what they actually contain. If nothing else I hope you can have my fiddle examples as reference. A note about the code though. The first time you initialize the picker you can assign it to a variable: var myvar = $('#inputDatetime').pickadate({ format: 'dd. mmmm yyyy', formatSubmit: 'yyyy-mm-dd', min: dt, selectYears: 2, selectMonths: true }); And then, when you need to get this instance, you just do: var picker = myvar.pickadate('picker'); picker.set('disable', [1,7]); //disables all saturdays &amp; sundays No need to reinitialize it in other words. Also, a last note. Setting disabled dates doesn't clear previously set dates. You just keep adding to the collection of disabled dates, and when you use days you only have 1-7 to work with before everything is disabled.
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/48232995
has comment: http://stackoverflow.com/comment/60008844
has comment: http://stackoverflow.com/comment/48239381
has comment: http://stackoverflow.com/comment/48226751
has comment: http://stackoverflow.com/comment/48225383
upvote count: 7
type: Answer

http://stackoverflow.com/a/29977044
upvote count: 2
has comment: http://stackoverflow.com/comment/48074329
has comment: http://stackoverflow.com/comment/48074403
type: AcceptedAnswer
downvote count: 1
has comment: http://stackoverflow.com/comment/48074157
has comment: http://stackoverflow.com/comment/48074637
has comment: http://stackoverflow.com/comment/48074672
type: Answer
answers question: http://stackoverflow.com/q/29976485
accepted answer of: http://stackoverflow.com/q/29976485
has comment: http://stackoverflow.com/comment/48073719
score: 1
has comment: http://stackoverflow.com/comment/48074224
has body: This is the code provided by Boostrap on their Documentation, in your code I can see that there is far less attributes on the structure, probably the lack of one is messing with the functioning. Data-toggle and role are the more likely ones. Good luck. ;) Home Profile Messages Settings ... ... ... ...

http://stackoverflow.com/comment/47981240
comment on: http://stackoverflow.com/a/29918078
score: 0
type: AnswerComment
has text: It is the proper way to attach an event and it is not that much different than what the poster did. Also, it handles adding events for IE versions less than 9.
type: Comment

http://stackoverflow.com/q/29849285
has body: EDIT This question has been answered, but I've chosen to clarify it for future readers. I've studied the explanations given about the logical operator !(parameter) and the inequality operator !==. They do not though clarify in what way they differ from each other. Let's look at an example. !($.inArray(latlng, markers) == -1) and $.inArray(latlng, markers) !== -1 What is the difference between theese two expressions and are there any performance issues with either of the solutions making the other more preferable?
has answer: http://stackoverflow.com/a/29849438
downvote count: 2
linked to: http://stackoverflow.com/q/4535647
has comment: http://stackoverflow.com/comment/47824661
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/29849681
has answer: http://stackoverflow.com/a/29849467
has answer: http://stackoverflow.com/a/29849681
linked to: http://stackoverflow.com/q/1889260
upvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/29849467
tagged with: javascript
score: -1
answer count: 3
has title: What is the difference between a comparison operator and a logical operator?
has comment: http://stackoverflow.com/comment/47824662
favorite count: 0

http://stackoverflow.com/comment/48151129
comment on: http://stackoverflow.com/a/30006888
type: Comment
has text: The links I'm using are soundmanager2-nodebug-jsmin.js & connect.soundcloud.com/sdk.js. I haven't had any other issues yet. I have no idea why it wouldn't work on code pen.
score: 0
type: AnswerComment

http://stackoverflow.com/q/29942214
answer count: 1
favorite count: 0
accepted answer: http://stackoverflow.com/a/29942566
type: AnsweredQuestion
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/29942566
type: Question
tagged with: transform
tagged with: javascript
tagged with: rotatetransform
has title: Transform rotate in snap svg
upvote count: 1
has body: Here is a JS FIDDLE where I am trying to rotate one of the cogwheel, but it rotates by moving to a different point. I tried different values to rotate it from the center without any luck. Any help will be very appreciated. code var s = Snap("#main"); var orange = s.select("#orgBearing"); rotating(); function rotating() { orange.stop().animate({ transform: 'R360 126.7 126.7' }, 1000); } Would also love to see if this animation can be made to repeat indefinitely.

http://stackoverflow.com/comment/47856782
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29865907
has text: And what is the problem?

http://stackoverflow.com/comment/47866287
comment on: http://stackoverflow.com/a/29869834
type: AnswerComment
has text: Thanks! Very direct! To be clear, if I were to bind a text input for its value and also access its DOM element I would do both value.bind and ref on the template element, is this correct? Like so: ` `
score: 0
type: Comment

http://stackoverflow.com/a/29983581
answers question: http://stackoverflow.com/q/29983457
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 2
upvote count: 2
accepted answer of: http://stackoverflow.com/q/29983457
has body: You have done a basic mistake here, in the line app.post("/new", function(res, req){ The first argument(res) is actually the request object and the second(req) is the response object. email is present in the request object that is res here. Either change your code to new user({ _id : res.body.email, name: res.body.name, age : res.body.age }) Or I would suggest simply swap the arguments like this, and every thing should work: app.post("/new", function(req, res){... //See I swapped the variable, now it should work.

http://stackoverflow.com/q/29922728
has body: I have a web part page where I have added a Script Editor web part. I then pasted the following code in... Questionnaire: {{control.Title}} Yes No When I save and view the page, I just see "{{control.Title}}" When I check the Console in Chrome, I see an error saying that the module couldn't be loaded... Uncaught Error: [$injector:modulerr] I have checked and rechecked the spelling. Nothing is working. What am I missing?
score: 2
upvote count: 2
has answer: http://stackoverflow.com/a/29923296
type: AnsweredQuestion
tagged with: javascript
tagged with: sharepoint
type: Question
accepted answer: http://stackoverflow.com/a/29923296
answer count: 1
downvote count: 0
favorite count: 0
has title: AngularJS Error on SharePoint Online Webpart Page
tagged with: angularjs

http://stackoverflow.com/comment/47907975
comment on: http://stackoverflow.com/a/29892035
has text: Did you go through the demo??.. any error?? I have edited the code ..attached the click event to the anchor tags inside li elements and manually triggered it on select element's change event.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/29872098
tagged with: javascript
tagged with: dom-events
tagged with: keycode
has comment: http://stackoverflow.com/comment/47869317
accepted answer: http://stackoverflow.com/a/29872313
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/109818900
has comment: http://stackoverflow.com/comment/47869394
has comment: http://stackoverflow.com/comment/47869318
has body: I've read through related answers and articles on Stack Overflow, but still doesn't get it: On Chrome console if I add two listeners to output keyCode on keypress and keydown events I get different keycode when the key is lowercase. When uppercase however, the keyCode appears to be the same for the two events. Example: document.addEventListener('keypress', function(e){ console.log('keyPress', e.keyCode); }); document.addEventListener('keydown', function(e){ console.log('keyDown', e.keyCode); }); // Open your console // Typing 'a' in the result field outputs 'keyPress 97' 'keyDown 65' // on chrome 42 console. Activate uppercase, and then typing 'A' outputs 'keyPress 65' and 'keyDown 65' // Why ? So is this normal behaviour ?
has title: Keydown and keypress events gives different keyCode
type: Question
score: 0
has comment: http://stackoverflow.com/comment/47869502
tagged with: keydown
answer count: 1
has comment: http://stackoverflow.com/comment/47869459
has answer: http://stackoverflow.com/a/29872313
linked to: http://stackoverflow.com/q/1367700
has comment: http://stackoverflow.com/comment/47869565
tagged with: keypress
has comment: http://stackoverflow.com/comment/47869400

http://stackoverflow.com/comment/138561263
has text: Why the statement `request.form()`? Are we using forms to send data or JavaScript?
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29988302

http://stackoverflow.com/comment/47826236
score: 0
has text: @charlietfl I must be missing something - I can't see where in the question that criteria is specified.
comment on: http://stackoverflow.com/a/29849866
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/47912576
has text: @Alex yes, it is on-premise
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29893389

http://stackoverflow.com/comment/47949847
type: Comment
comment on: http://stackoverflow.com/a/29913684
has text: It works in this fiddle, so the problem must be somewhere else: http://jsfiddle.net/fzrpfeeo/
score: 0
type: AnswerComment

http://stackoverflow.com/q/29929037
has comment: http://stackoverflow.com/comment/47980279
type: AnsweredQuestion
has title: Scale div like an image
score: 1
has comment: http://stackoverflow.com/comment/47980303
type: Question
has answer: http://stackoverflow.com/a/29930698
has body: I am trying to scale content within a div based on it's width. As an example, I have a div: &lt;div id="container"&gt;&lt;/div&gt; I have styling such as: #container { margin: 0px auto; width: 810px; height: 800px; border: 1px solid #000; } This presents me with a div 810px wide and 800px tall, nicely centered on screen with an outline. Let's say I have a banner graphic at the top which should scale with the div, so I have it's width at 100%. Works great. I have a background graphic for the container div itself set to scale with the width as well, working great. What I need help with, is let's say I had a heading underneath the banner, but this font size needed to scale with everything else, based on the width of the container. How would I accomplish this? I am also looking to add other elements such as buttons, which would need to scale. At the end of the day, imagine and image with a width of 100%, and how it scales proportionately, perfectly. This is how I need the container div and all its children to act, like an image. I hope this makes sense. I have looked at scaling text like in this link: http://jsfiddle.net/Aye4h/ This is the perfect behavior, but I need more than just text to scale.
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: scale
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47980170
tagged with: css
has comment: http://stackoverflow.com/comment/47981785
accepted answer: http://stackoverflow.com/a/29930698
upvote count: 2
has comment: http://stackoverflow.com/comment/47983522
downvote count: 1

http://stackoverflow.com/a/30003213
type: AcceptedAnswer
upvote count: 1
type: Answer
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/29952400
answers question: http://stackoverflow.com/q/29952400
has body: Ok so for anyone interested, I have figured it out, and it was quite simple. all I had to do was create a variable for x and y and set them to this.getBBox().x and this.getBBox().y which gives me the x and y coords for the top left of each element. So I edited my drag function to the following : var start = function () { this.odx = 0; this.ody = 0; this.animate({ "fill-opacity" : 0.2 }, 500); }, move = function (dx, dy) { x = this.getBBox().x; y = this.getBBox().y; this.translate(dx - this.odx, dy - this.ody); this.odx = dx; this.ody = dy; }, up = function () { this.animate({ "fill-opacity" : 1 }, 500); update(x,y,this.id); //use the bbox values for the update function. alert(this.id); }; Thanks for the help guys.

http://stackoverflow.com/q/29953238
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/29953385
tagged with: javascript
has title: Load and update a locally JSON file by input text
downvote count: 0
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/48031362
type: UnansweredQuestion
has body: I'm working on a project with a little CMS system where data gets loaded from a extern JSON file. This data loads in perfectly, but then I'm trying to update the JSON with HTML input fields (like changing a title and stuff) A little preview of the JSON File: { "title":"Homepage", "paths": [{ "path": [{ "questions":"Home" }] }] } This is the code that I have for the loading in: $string = "file.json"; $jsonString = file_get_contents($string); $data = json_decode($jsonString, true); $paths = $data["paths"]; And then there are some input fields like this: &lt;input type="text" name="title" value="Update the title" /&gt; So I just want to update some textfields and overwrite the JSON titles for example. Hope someone can help me. PS: I know that SQL maybe was a better solution, but I received this from the client.
tagged with: php
score: 1
tagged with: http://stackoverflow.com/tag/json
tagged with: file

http://stackoverflow.com/comment/48089081
has text: Is there any way to get the link to WordPress JQuery library?
type: Comment
comment on: http://stackoverflow.com/q/29983563
score: 0
type: QuestionComment

http://stackoverflow.com/a/29875079
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29875010
upvote count: 3
has body: You can use textAlign: context.textAlign = "center";
type: Answer
score: 3
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29875010

http://stackoverflow.com/comment/48092235
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29980745
has text: So now I'm having a new issue... When I click on let's say shoe #2, it opens another html page inside of the `data-` element that I was trying to modify.... Even though my PHP doesn't make the HTML... http://puu.sh/hxpsI/5abd077bbd.jpg
type: AnswerComment

http://stackoverflow.com/comment/47866237
score: 1
has text: The function is called anytime the value of ng-model on the directive (delightScore) changes. So you will not need to call the function manually
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29870108

http://stackoverflow.com/comment/48166332
type: QuestionComment
has text: I'm pretty sure this has been disabled in most newer browsers for security reasons. This will never happen or be enabled by web browser engineer's. And what IE did you run it under IE 7? lol
comment on: http://stackoverflow.com/q/29986111
score: 0
type: Comment

http://stackoverflow.com/q/29902901
has body: I want to use : $("...").animate() with loading an onClick JavaScript Ajax . But there are some issues with that: I try using jQuery like this : function Ajaxrequest(){ var xmlHttp;try{xmlHttp=new XMLHttpRequest();return xmlHttp;} catch (e){ try{xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); return xmlHttp; } catch (e){ try{xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); return xmlHttp;} catch (e){ alert("Browser Not support Ajax"); return false;} } } function showtopic(str) { $("html,body").animate({ scrollTop: jQuery(document).height() }, 2000); var xmlHttp = Ajaxrequest(); var issolve = "+1 مشکلم حل شدنبابا حل نشد ! میخوام سوال بپرسم "; if (str == "") { document.getElementById("showtopic").innerHTML = ""; return; } xmlHttp.onreadystatechange = function () { if (xmlHttp.readyState > 0 && xmlHttp.readyState < 4) { document.getElementById("tftopic").innerHTML = loadingmessage; } if (xmlHttp.readyState == 4) { document.getElementById("showtopic").innerHTML = xmlHttp.responseText; document.getElementById("issolved").innerHTML = issolve; } } xmlHttp.open("GET", str, true); xmlHttp.send(); } but it didn't work! Then I made a jQuery inline code like this : jQuery('.go-bott').click(function () { $('html,body').animate({ scrollTop: (jQuery(document).height() * 0.9) }, 2000); return false; }); and use that beside JavaScript onClick, but Ajax doesn't let jQuery run (this code will run on a simple class). How I can have a onClick JavaScript Ajax with a jQuery scroll or Can I use JavaScript to scroll page? Thanks in advance
tagged with: animation
tagged with: scroll
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29903245
tagged with: onclick
has comment: http://stackoverflow.com/comment/47930259
has comment: http://stackoverflow.com/comment/47928542
type: Question
has comment: http://stackoverflow.com/comment/47928593
tagged with: javascript
has title: how to use jQuery click function with javascript OnClick
tagged with: jquery
accepted answer: http://stackoverflow.com/a/29903245
score: 0
answer count: 1

http://stackoverflow.com/comment/48120935
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/30000685
has text: @yogesh The returned message says `"updatedExisting":true`, so this should not make a difference in this case.

http://stackoverflow.com/comment/48032060
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29955604
has text: It's called a website with a scrollbar and anchors
score: 1

http://stackoverflow.com/a/29970044
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29969062
answers question: http://stackoverflow.com/q/29969062
has body: Sure you can avoid jQuery, which is also written in pure JavaScript. Since you only need to check if input text matches any string in the predefined array, you can bypass the sort operation and go directly to comparison. There are some event handler existed in pure JS, like onkeyup, which is pretty handy for input retrieval. Fade in and out effect can be rendered with CSS transition and opacity, as shown in the Vrai The tag in this demo, actually, is not necessary. You can just keep and tags and get the same result.
upvote count: 1
type: Answer
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/48060210

http://stackoverflow.com/a/29853946
upvote count: 2
has body: Yes.. you have to create a closure around it for (var i = 0; i &lt; data.length; i++) { value = data[i]; deferred.then( function(val) { return function(response) { console.log(response+':'+val); }}(value)); }
has comment: http://stackoverflow.com/comment/47834806
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/47833849
has comment: http://stackoverflow.com/comment/47833779
type: Answer
has comment: http://stackoverflow.com/comment/47834045
has comment: http://stackoverflow.com/comment/47834367
answers question: http://stackoverflow.com/q/29853842

http://stackoverflow.com/q/29924852
has comment: http://stackoverflow.com/comment/47971819
tagged with: jquery-mobile
tagged with: closures
tagged with: javascript
score: 0
tagged with: concatenation
answer count: 1
has answer: http://stackoverflow.com/a/29925133
tagged with: jquery
has comment: http://stackoverflow.com/comment/47971521
favorite count: 0
type: AnsweredQuestion
has body: by triggering xyEvent I want to concatenate a string. But myClosure() is always empty. Why? Thanks for help. first.js: $(document).ready(function () { $("#...").on("tap", function () { myClosure(new Item()); }); ... } second.js var string; xyEvent { string = "hello" + myClosure(); // here is the problem }); var myClosure = (function () { var anyString = ""; return function (item) { if(item != null){ anyString = anyString.concat(item.name); consloge.log(anyString); // perfect at this point } else{ return anyString; } }})();
has comment: http://stackoverflow.com/comment/47971526
accepted answer: http://stackoverflow.com/a/29925133
has title: How to access String in Closure
has comment: http://stackoverflow.com/comment/47971495
has comment: http://stackoverflow.com/comment/47972618
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/47971361
type: Question
has comment: http://stackoverflow.com/comment/47971545
has comment: http://stackoverflow.com/comment/47972403

http://stackoverflow.com/a/29969170
upvote count: 2
accepted answer of: http://stackoverflow.com/q/29957684
answers question: http://stackoverflow.com/q/29957684
score: 2
type: AcceptedAnswer
downvote count: 0
has body: You can do this way, producing JSON Object: def BudgetJson(request): from django.http import JsonResponse out_list = [] resultset = models.Expense.objects.filter(category_id=1) for model in resultset: temp_dict = {'expense_period': model.expensePeriod, 'expense_name':model.expenseName, 'expense_amount':model.expenseAmount } out_list.append(temp_dict) data = {'data' : out_list } return HttpResponse(json.dumps(data), content_type='application/json') and inside your &lt;script&gt; tag the datatable will as $('#expenses').DataTable( { "ajax" : "your-url", "columns" : [ {"data" : "expense_period"}, {"data" : "expense_name"}, {"data" : "expense_amount"}, ] }); This will work. :)
type: Answer

http://stackoverflow.com/a/29979655
score: 0
answers question: http://stackoverflow.com/q/29979263
type: Answer
has body: That's an easier way to do it: $( document ).ready(function() { $('.wysihtml5-editor').append('Your HTML content.'); }); You can insert HTML with append or prepend. More information: http://api.jquery.com/append/ http://api.jquery.com/prepend/
has comment: http://stackoverflow.com/comment/48079055

http://stackoverflow.com/comment/47994815
type: QuestionComment
has text: @AnandGhaywankar i pasted my php code also
comment on: http://stackoverflow.com/q/29936060
score: 0
type: Comment

mpld3
tags question: http://stackoverflow.com/q/29976625
type: Tag
tag name: mpld3

http://stackoverflow.com/comment/47838604
comment on: http://stackoverflow.com/q/29856068
has text: @KorvinSzanto I just tried switching the | var file = "/gps.txt" | in the code but it still doesn't look like it's reading the file.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29950448
has comment: http://stackoverflow.com/comment/48021930
has answer: http://stackoverflow.com/a/29950631
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/48022199
linked to: http://stackoverflow.com/q/578348
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/48022269
score: 0
has body: I am using the following code to switch tabs. But the problem is if i put the tabe id in url with #, it will not goto that specific tab. Tab 2 Tab 3 Below is the code jQuery(document).ready(function() { jQuery('.tabs .tab-links a').on('click', function(e) { var currentAttrValue = jQuery(this).attr('href'); // Show/Hide Tabs jQuery('.tabs ' + currentAttrValue).show().siblings().hide(); // Change/remove current tab to active jQuery(this).parent('li').addClass('active').siblings().removeClass('active'); e.preventDefault(); }); }); html code Account Jobs Posted Messages Post A Job
has comment: http://stackoverflow.com/comment/48021902
answer count: 1
has title: Goto specific Tab (accordin) on # hyperlink
accepted answer: http://stackoverflow.com/a/29950631
tagged with: jquery

http://stackoverflow.com/a/29908723
has body: This means that you want to append some html content to the div. If you want your div to recognize the html tags, you need to use .html() property: $('#display').html($('#my_textarea').val()); Also, you need to update this part as follows (onkeyup should be keyup and please do not forget to include # if you are using ID SELECTER): $('#my_textarea').keyup(function() { $('#display').html($('#my_textarea').val()); }); Here is a working demo: https://jsfiddle.net/0uoshu0s/6/
has comment: http://stackoverflow.com/comment/47941115
score: 3
has comment: http://stackoverflow.com/comment/47939976
upvote count: 3
has comment: http://stackoverflow.com/comment/47939963
has comment: http://stackoverflow.com/comment/47940394
has comment: http://stackoverflow.com/comment/47940226
has comment: http://stackoverflow.com/comment/47940220
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/47940211
has comment: http://stackoverflow.com/comment/47939948
has comment: http://stackoverflow.com/comment/47939921
accepted answer of: http://stackoverflow.com/q/29908709
type: Answer
has comment: http://stackoverflow.com/comment/47939884
answers question: http://stackoverflow.com/q/29908709
has comment: http://stackoverflow.com/comment/47940263

http://stackoverflow.com/q/29931446
tagged with: node.js
type: AnsweredQuestion
upvote count: 1
type: Question
has body: Given the following code, we can see that closures help contain the value of variables inside their scope: var f = new Foo('jim','jam'); var b = new Bar('saul','paul'); var bz = new Baz(); function Foo(jim,jam){ this.jim = jim; this.jam = jam; function log(){ console.log('jim:',jim,'jam:',jam); } return log; } function Bar(jim,jam){ function log(){ console.log('jim:',jim,'jam:',jam); } return log; } function Baz(jim,jam){ this.jim = 'bark'; this.jam = 'catch'; function log(){ console.log('jim:',this.jim,'jam:',this.jam); } return log; } f(); b(); bz(); so, what exactly is the purpose of the 'this' keyword in JavaScript then? When does it become necessary?
accepted answer: http://stackoverflow.com/a/29931520
score: 1
has answer: http://stackoverflow.com/a/29931475
has comment: http://stackoverflow.com/comment/47985336
answer count: 2
has title: Given that JavaScript has closures, what exactly is the purpose of the this keyword?
possible better answer: http://stackoverflow.com/a/29931475
downvote count: 0
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/47985481
has comment: http://stackoverflow.com/comment/47985300
has comment: http://stackoverflow.com/comment/47985468
has answer: http://stackoverflow.com/a/29931520

http://stackoverflow.com/comment/48060668
type: QuestionComment
has text: It is not how we create dynamic controls in ASP.Net (unless you are working on MVC). ASP.Net is an event-based model; you do not want to directly manipulate DOM. In a nutshell, you want to use server control and add it to placeholder (or panel) dynamically.
score: 0
comment on: http://stackoverflow.com/q/29969651
type: Comment

http://stackoverflow.com/q/29893240
type: AnsweredQuestion
has title: Returning JavaScript through PHP - good or bad idea?
linked to: http://stackoverflow.com/q/10142242
has comment: http://stackoverflow.com/comment/47910122
type: Question
tagged with: javascript
has body: So I have a jQuery AJAX call that builds a profile when clicked. It would only be called once so I thought that I could just pop a script into the generated html instead of placing it inside the success AJAX call. while($row = mysql_fetch_array($result)){ $content .= ' Points '; } $content.= ' '; echo $content; It feels cleaner, it only executes when I have the required html and I don't have as much JavaScript on page load... But is this bad practice? Please explain any flaws if there is any. Thanks!
tagged with: jquery
accepted answer: http://stackoverflow.com/a/29893853
has comment: http://stackoverflow.com/comment/47910025
tagged with: ajax
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/47910857
has comment: http://stackoverflow.com/comment/47910291
has comment: http://stackoverflow.com/comment/47909632
tagged with: php
has answer: http://stackoverflow.com/a/29893853

http://stackoverflow.com/comment/47890075
has text: Sure. You can look on the documentation for $compile (https://docs.angularjs.org/api/ng/service/$compile) and the scope part of the page talks about both =* and =*? I've also found code in AngularJS itself which tries to set this up. I just haven't been able to make an example which demonstrates it.
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/29882873

http://stackoverflow.com/q/29890022
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/29890289
has title: Search through autocomplete rails 4
answer count: 1
downvote count: 0
favorite count: 0
has body: JS: &lt;script&gt; $(function() { var availableTags = [ "NSDL", "CDSL", "ROCA", "NSE", "SEBI" ]; $( "#search" ).autocomplete({ source: availableTags }); }); &lt;/script&gt; &lt;script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"&gt;&lt;/script&gt; &lt;link rel="stylesheet" href="/resources/demos/style.css"&gt; &lt;link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css"&gt; In _index.js.erb: &lt;%= form_tag service_requests_path, method: :get,:id=&gt;"search_form" do %&gt; &lt;%= text_field_tag :search , nil, class: 'form-control input-breathe', required: true, placeholder: 'Searching for...', :autocomplete=&gt; :on%&gt;&lt;%end%&gt; I want to search with textbox only, without using any button.Now I am getting all the values from the textbox. But the problem is that, when I am selecting any of the tag, it should search all the service requests containing this tag. How can I do this?
tagged with: ruby-on-rails
tagged with: css
type: AnsweredQuestion
score: 2
upvote count: 2
has answer: http://stackoverflow.com/a/29890289
type: Question

http://stackoverflow.com/a/29978223
has body: cart.push fails with an error because it is of type object. That's not true. In JavaScript typeof [] === typeof new Array() === 'object' typeof operator MDN Your code must fail for some other reason. Edit: Error: undefined is not a function (evaluating 'cart.push(product)') is the exact error. That probably means you've overwritten the variable cart somehwere and it's no longer an array. setCart: function(c) { cart = c; ... Could this be the culprit?
accepted answer of: http://stackoverflow.com/q/29978069
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/48076423
upvote count: 2
type: Answer
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/29978069

http://stackoverflow.com/comment/48047753
has text: @Andy nope, I'm using that project in BS3 as I type this, and it's most definitely `datepicker`. - That repo contains both 2 and 3 code.
score: 0
comment on: http://stackoverflow.com/q/29963634
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29993439
answers question: http://stackoverflow.com/q/29977285
has body: Yes you can create android apps from meteor app using Cordova, this is a documentation about Meteor cordova integration which explains how to create meteor apps for Android and iOs, For the gcm push messages you can use meteor packages like raix:push.
accepted answer of: http://stackoverflow.com/q/29977285
upvote count: 1
type: AcceptedAnswer
type: Answer
downvote count: 0
score: 1

http://stackoverflow.com/a/29896407
has body: Turns out if I did e.target.style.color = "Red"; var options = e.target.childNodes; for(var x = 0; x &lt; options.length; x++) { options[x].style.color = "rgb(68, 68, 68)"; } it fixed my issue, singularly styling each individual option to have the default color, bit 'hacky' but works I guess.
accepted answer of: http://stackoverflow.com/q/29896302
answers question: http://stackoverflow.com/q/29896302
score: 0
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/q/29911723
tagged with: javascript
score: -1
has answer: http://stackoverflow.com/a/29912266
answer count: 2
downvote count: 1
tagged with: meteor
favorite count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29912231
has body: I have following autoform hook code. How can I get value outside of method.call. My problem is that when I run method.call, then 'chi' value is undefined. Whereas, on server there is '1' record.But chi doesn't get 'myResult' value. If I comment out the method.call and return 'Gogo', then 'chi' gets this value correctly. Can some one guide me what I am doing wrong and how it can be rectified. Code: before: { method: function(doc) { var retVal = false ; var pai = Q.fcall(function(){ if(!_.isEmpty(doc) &amp;&amp; _.pick(doc, 'name') ) { console.log('Ist level, true condition: ', doc); return true; } else{ console.log('Ist level, false condition: ', doc); return false; } }) .then(function(check){ console.log('Check value: ', check); if( check ){ Meteor.call('CategoryNameAvailable', doc.name, function (error, result) { console.log('Returned result from server', result); if (!result) { if(Contexts.Category.keyIsInvalid('name')){ Contexts.Category.resetValidation('name'); } console.log('Returned result from server inside if condition ', result); Collections.Category.simpleSchema().namedContext("CategoryInsertForm").addInvalidKeys([{ name: "name", type: "notUnique" }]); console.log('Doc value in meteor call function: ', doc); Session.set('retVal', true); console.log('retVal value in meteor call function: ', retVal); } return 'myResult'; }); // return 'Gogo'; /* Meteor call End */ } }) .then(function(chi){ console.log('Chi value: ', chi); }) .done(); console.log('Pai value-2: ', pai); } /* End of method */ } /* End of 'before' hook */
upvote count: 0
has title: MeteorJs, unable to get method.call return value outside of the method
type: Question
tagged with: meteor-autoform

http://stackoverflow.com/comment/47970417
type: AnswerComment
comment on: http://stackoverflow.com/a/29924300
type: Comment
has text: See if the issue goes away if you use `onLoad`. Google might have fixed the issue in Incognito mode but not in normal mode since it was reported?
score: 0

http://stackoverflow.com/comment/48070238
type: QuestionComment
has text: I've added a snippet of the code that I am using.
comment on: http://stackoverflow.com/q/29972635
score: 0
type: Comment

http://stackoverflow.com/q/29993915
linked to: http://stackoverflow.com/q/1077041
tagged with: knockout.js
type: Question
has body: Hej guys, After fetching a "new url" in my backend, I want to refresh the image by setting the property on my viewmodel, which is bound to the src attribute of the image. Problem is that the url is not realy changed since I always overwrite the image in the backend. Any ideas?
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: web
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29993969
favorite count: 0
score: 2
upvote count: 2
type: UnansweredQuestion
has title: How to refresh an image in knockoutjs

http://stackoverflow.com/q/29979804
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/48079401
has comment: http://stackoverflow.com/comment/48082073
answer count: 0
has comment: http://stackoverflow.com/comment/48194669
type: Question
tagged with: javascript
has body: I have an index view with a form, and I want to prepopulate the form with data from the database by having the user click a date on the calendar, so the user can see what that date has stored in it, and edit if they want. I have it set by default to today's date, and it works fine. If I hard-code it to some other date, it also works. But when I do it by clicking the date, the form never re-renders, it always shows data from today. At the moment I am doing it with an ajax call, which I suppose is not correct. I am using the gem bootstrap-datepicker-rails for the calendar. What is the best way to do it? Here is my controller: def index @item = Item.new @items = Item.all @date = params[:u_date] || Time.now.strftime("%Y-%m-%d") @form_items = {} @items.each do |item| todays_trace = Trace.find_by(item_id: item.id, u_date: @date) if todays_trace @form_items[item] = todays_trace else @form_items[item] = Trace.new({input: "", notes: ""}) end end end Here is my view: &lt;div class="row"&gt; &lt;%= form_tag "/traces_form" do %&gt; &lt;div id="datepicker"&gt; &lt;input name="u_date" type="text" data-provide='datepicker' data-date-format="yyyy-mm-dd" value=&lt;%= @date%&gt;&gt; &lt;/div&gt; &lt;% @form_items.each do |item| %&gt; &lt;%= render partial: 'trace_form', :locals =&gt; {:item =&gt; item[0], :trace =&gt; item[1]} %&gt; &lt;% end %&gt; &lt;%= submit_tag "submit" %&gt; &lt;% end %&gt; &lt;/div&gt; Here is my javascript: &lt;script type="text/javascript"&gt; $("#datepicker").on("changeDate", function(event) { var u_date = $("input[name=u_date]").val(); $.ajax({ type: "GET", url: "/items", data: { u_date }, success: function(){ console.log("something happened") } }); }); &lt;/script&gt; And here is the rails log when I click on a date: Started GET "/items?u_date=2015-04-29" for 127.0.0.1 at 2015-04-30 17:04:31 -0700 Processing by ItemsController#index as */* Parameters: {"u_date"=&gt;"2015-04-29"} Item Load (0.2ms) SELECT "items".* FROM "items" Trace Load (0.1ms) SELECT "tr…
has comment: http://stackoverflow.com/comment/48080354
score: 0
tagged with: ruby-on-rails-4
has title: Reload rails 4 view from on click, with params
tagged with: jquery
tagged with: ajax
tagged with: ruby

http://stackoverflow.com/comment/47972663
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29925495
has text: try `console.log(Array.isArray(animal_list)));` before your `if` statement
score: 0

http://stackoverflow.com/q/29947773
tagged with: forms
has answer: http://stackoverflow.com/a/29948057
type: Question
tagged with: javascript
has title: Save info in a form before Post
has body: I am creating a registration form that uses JavaScript to calculate an amount and uses method="post" to redirect the user to PayPal to complete the transaction. The piece I'm missing is some way to capture the information before sending them off to pay. Ideally emailing a copy of the information or even saving to a text file on the server. I'm kind of a n00b here, so while I realize it's possible to post to my own PHP script and have that redirect them to PayPal, I'm not sure I'd be able to figure out all the pieces in that workflow. Is there a simpler way to do it?
score: 0
answer count: 2
type: UnansweredQuestion
tagged with: php
tagged with: paypal
has answer: http://stackoverflow.com/a/29947871

http://stackoverflow.com/q/29994821
score: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/48109229
linked to: http://stackoverflow.com/q/231478
has comment: http://stackoverflow.com/comment/48109355
has comment: http://stackoverflow.com/comment/48109721
type: Question
has answer: http://stackoverflow.com/a/29994933
tagged with: forms
has comment: http://stackoverflow.com/comment/48109225
has answer: http://stackoverflow.com/a/29995007
answer count: 3
tagged with: javascript
has body: I Have one register form that I need to be submitted to subdomain, subdomain register form its using security token key. What I need is to take the security token from subdomain and use it on main domain using javascript. Example of subdomanin token key: &lt;input name="security_token" value="7ba88acf1fade1e1c26d7f7a885564f2" type="hidden"&gt; I need to get the above key and use it on main domanin registration form : &lt;input type="hidden" name="security_token" value="security key" /&gt; I tried this on main domain but failed : &lt;input name="security_token" value="searchTxt" type="text" id="searchTxt"&gt; &lt;script&gt; var input = document.getElementsByName("security_token")[0].value; function searchURL() { window.location = "http://www.subodmain.myurl.com/register" + input.value; } &lt;/script&gt; Anyone can edit my script in and make it work ? Thank you.
has title: How to get value from subdomain input value?
has answer: http://stackoverflow.com/a/29994924
has comment: http://stackoverflow.com/comment/48109185
has comment: http://stackoverflow.com/comment/48109387

http://stackoverflow.com/comment/48114769
type: AnswerComment
has text: After commenting that refreshScreen(), add these two lines right BEFORE `shootButton.onclick`: `extraAmmoHud.innerHTML="Extra Ammo: " + extraAmmo; currentAmmoHud.innerHTML="Current Ammo: " + currentAmmo;`
type: Comment
comment on: http://stackoverflow.com/a/29996889
score: 0

http://stackoverflow.com/q/29902140
duplicate of: http://stackoverflow.com/q/1051782
type: AnsweredQuestion
score: 1
upvote count: 1
accepted answer: http://stackoverflow.com/a/29902167
type: Question
has body: I have a simple object of input checkbox elements and want to check in an each loop which ones are checked and the do stuff. The checkboxes are in one tr in several td's in a table. Here is my code: $('table.occupancy-table').on('change', '.minimum_stay input', function() { var minimumStayInputs = $(this).closest('tr').find('input'); $(minimumStayInputs).each(function(){ if(this.prop('checked')) { //do stuff } } } If I console.log this in the each loop, I get data like: &lt;input id="R11520" type="checkbox" name="minimum_stay[152][1442786400]" value="checked"&gt; &lt;input id="R11521" type="checkbox" name="minimum_stay[152][1442872800]" value="checked"&gt;... But I always get an error Uncaught TypeError: this.prop is not a function from this.prop('checked'). I also tried .is(":checked") with the same result. Any ideas what the reason might be? Let me know if you need sample html or I should create fiddle.
downvote count: 0
has title: can't test for input checked in each loop
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47926906
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/29902167
linked to: http://stackoverflow.com/q/1051782
has comment: http://stackoverflow.com/comment/47926909
tagged with: checkbox

http://stackoverflow.com/comment/47853448
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29864014
has text: You should first fix the issue in your code snippet, because it is missing a few `{` and also `}`. from what I can see it doesn't seem to be an array, instead it sounds like a single object. __But__ if it really is an array of positions it should be like: `[{title:'A', user:{}},{title:'B', user:{}}]` or at least: `[{position:{title:'A', user:{}}}, {position:{title:'B', user:{}}}]`
score: 0

http://stackoverflow.com/a/29935100
type: Answer
accepted answer of: http://stackoverflow.com/q/29934851
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/29934851
upvote count: 1
type: AcceptedAnswer
has body: You are overwriting your activeUserId which is being passed from your Ctrl to your directive at at this line: $scope.api = {}; I believe that you should keep track of your api objects in your controller in this way: in your controller $scope.bars = [ { activeUserId: "id", activeCompanyId: "companyId", api: {} //this allows angularjs to reuse this object instance }, { activeUserId: "id2", activeCompanyId: "companyId2", api: {} //this allows angularjs to reuse this object instance }, ]; the html template for your controller &lt;div ng-repeat="b in bars"&gt; &lt;js-progress api="b.api" your-extra-params-here /&gt; &lt;/div&gt; Later on in your controller, you will be able to do: $scope.bars[0].api.start();

http://stackoverflow.com/comment/47963611
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/29921146
type: Comment
has text: `var url = window.location.href;`

http://stackoverflow.com/a/29922010
type: Answer
has comment: http://stackoverflow.com/comment/47968780
answers question: http://stackoverflow.com/q/29921270
has body: You can check if the value is empty from the start otherwise check if its equal 'A' OR 'B' .... if( setup.match(/\S/)){ if (setup == 'A') { setup = A; $('.scrap').val(sum); }else if (setup == 'B') { setup = B; $('.scrap').val(sum); }else if (setup == 'C') { setup = C; $('.scrap').val(sum); }else if (setup == 'D') { setup = D; $('.scrap').val(sum); } }else{ // will come here when there is an empty value $('.scrap').val(other); }
accepted answer of: http://stackoverflow.com/q/29921270
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47968541
score: 0

http://stackoverflow.com/comment/48031603
comment on: http://stackoverflow.com/q/29955141
type: Comment
type: QuestionComment
has text: Your `AJAX` call is wrong. `update.php` is not the correct URL and `userid` is not defined.
score: 0

http://stackoverflow.com/comment/48106722
comment on: http://stackoverflow.com/a/29993624
score: 0
type: AnswerComment
has text: This is close to what I am looking for; However, the style that I need to change is the one listed in my post: .nav.nav-tabs > li > a
type: Comment

http://stackoverflow.com/a/29930841
answers question: http://stackoverflow.com/q/29927803
has body: As always, there's more than one way to skin a cat, especially with a unique situation like this. That said, here's one approach. Updated JSFiddle: http://jsfiddle.net/b18b4bza/5/ Start by assigning a unique ID to each cell. I've chosen an "A1,B2" format similar to a spreadsheet, where letters and numbers represent columns and rows, respectively. index.html Chrissy Teigen cries Host makes a quick change 'I love you!' 'Merci' or 'Gracias' Attempt at re-creating the 'Ellen selfie' A Weinstein is thanked Jennifer Lawrence trips Half-joking mention of nominee diversity 'This is heavy!' A shout-out for winner's kids (who should be sleeping) Joke about number of British nominees Award accepted posthumously Logo Joke about the Sony hack Winner mentions fellow nominees 'I'd like to thank the academy ...' 'Je Suis Charlie' The show goes over three hours Camera pans to George and Amal Winner talks over orchestra Winner thanks agent or manager Winner forgets to thank spouse Host makes a borderline-offensive joke Presenters have a scripted 'disagreement' NPH performs a music number Then update your Javascript with a few additions: scripts.js $(function() { // Set winning combinations to array var winners = [ ['a1','a2','a3','a4','a5'], ['b1','b2','b3','b4','b5'], ['c1','c2','c3','c4','c5'], ['d1','d2','d3','d4','d5'], ['e1','e2','e3','e4','e5'], ['a1','b1','c1','d1','e1'], ['a2','b2','c2','d2','e2'], ['a3','b3','c3','d3','e3'], ['a4','b4','c4','d4','e4'], ['a5','b5','c5','d5','e5'], ['a1','b2','c3','d4','e5'], ['a5','b4','c3','d2','e1'] ]; var possibleWinners = winners.length; // Initialize selected array with c3 freebie var selected = ['c3']; // Play again, removes all previously clicked $('.again').click(function(){ $('.square').removeClass('clicked'); selected = ['c3']; }); // Toggle clicked and not clicked $('.square').click(function(){ $(this).toggleClass('clicked'); // Push clicked object ID to 'selected' array selected.push($(this).attr('id')); // Compare winners array t…
accepted answer of: http://stackoverflow.com/q/29927803
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 3
score: 3

http://stackoverflow.com/comment/47881384
score: 0
type: Comment
type: QuestionComment
has text: There was a mistake in my syntax/fiddle and I just corrected it
comment on: http://stackoverflow.com/q/29878516

http://stackoverflow.com/a/29943541
has body: Your external template will have access to your scope variables. updated directive: angular.module( 'example', [] ).directive( 'exampleDirective', ['$compile', '$http', function($compile, $http) { return { restrict: 'A', // ... templateUrl: 'my_template.html', // ... }; } ] ); my_template.html: {{item.' + foo + '}}
has comment: http://stackoverflow.com/comment/48029286
upvote count: 2
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29943308
accepted answer of: http://stackoverflow.com/q/29943308
type: Answer
has comment: http://stackoverflow.com/comment/48022464
score: 2
downvote count: 0

http://stackoverflow.com/a/29897596
score: 0
type: Answer
has body: You want to do a string match and then iterate over that. Full example inside AngularJS: http://jsfiddle.net/184cyspg/1/ var myString = 'O:BED,N:KET,OT,N:JAB,FA,O:RPT,'; $scope.myArray = []; var objs = myString.match(/([A-Z])\:([A-Z]*)\,([A-Z]?)/g); objs.forEach(function (entry) { var obj = entry.replace(',', ':'); obj = obj.split(':'); $scope.myArray.push({type: obj[0], code: obj[1], suf: obj[2]}); });
answers question: http://stackoverflow.com/q/29896962

http://stackoverflow.com/q/29983476
tagged with: expresso
tagged with: node.js
type: AnsweredQuestion
type: Question
tagged with: testing
tagged with: javascript
has body: I tried to use expresso to test my project. I have installed it with command sudo npm install --save expresso and it worked for me. Than I decided to test it in created test.js file with code var assert = require('assert'); assert.equal(6, 'foobar'.length); I run it with command expresso ./test.js as was written in example But I have got result No command 'expresso' found, did you mean: Command 'extresso' from package 'icoutils' (universe) Command 'express' from package 'node-express' (universe) expresso: command not found Can anyone help me, please? Thank you in advance!
score: 0
has title: Node.js test with expresso
answer count: 1
has answer: http://stackoverflow.com/a/29983764
accepted answer: http://stackoverflow.com/a/29983764

http://stackoverflow.com/comment/48070579
type: QuestionComment
comment on: http://stackoverflow.com/q/29964674
has text: @BenVoigt I don't fully understand the question (I try to avoid JavaScript) so I took what was posted in the question and extrapolated something out of it. It was certainly an improvement on "Error in my JavaScript" as it at least highlights the OP was expecting something to happen `x` times, but it only happened `y`.
score: 0
type: Comment

http://stackoverflow.com/a/30001343
score: 5
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/30001002
has comment: http://stackoverflow.com/comment/83606455
has body: Revised version, original at the bottom: To keep things quick and clean, I decided to keep the redirect page as just that. Furthermore I figured that the redirect page shouldn't stay in the browser's history to avoid never-ending back-button fiascos. Thus I ended up with this version: Redirecting... Original answer: After some more fiddling I found that this is in fact possible with Javascript. I just had to make it a bit simpler than what I had: Welcome to my app You don't have the app installed. This does exactly what I need. It does unfortunately cause an error in the Javascript console when the redirect can't be done, but I guess I'll just have to live with that.
accepted answer of: http://stackoverflow.com/q/30001002
type: Answer
upvote count: 5

http://stackoverflow.com/a/29954072
score: 0
has body: Try the below working code snippet.I hope it will solve the issue var label = $('label'); $.each(label, function() { var arr = $(this).text().split(' '), num = arr[arr.length-1], modifiedText = '&lt;span&gt;'+num+'&lt;/span&gt;', finalText= $(this).text().replace(num, modifiedText); $(this).html(finalText) });
type: Answer
answers question: http://stackoverflow.com/q/29953553

http://stackoverflow.com/q/29872743
type: Question
has answer: http://stackoverflow.com/a/29872785
has comment: http://stackoverflow.com/comment/47870790
has title: Reducing code redundancy in a series of javascript function expressions
has answer: http://stackoverflow.com/a/29872908
tagged with: javascript
has answer: http://stackoverflow.com/a/29873049
tagged with: jquery
has comment: http://stackoverflow.com/comment/47870874
has comment: http://stackoverflow.com/comment/47870596
score: 0
has comment: http://stackoverflow.com/comment/47870635
answer count: 4
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/5871640
has answer: http://stackoverflow.com/a/29872795
has body: I have a long series of javascript functions that are invoked by 'onClick' on the function name in the html. Corporate number SAVE LLC number SAVE Type of nonprofit SAVE Other description SAVE In the javascript the functions are very similar in form: /** * Get corporation number text field data. */ var getCorpNum = function() { var Corp_number = []; Corp_number=document.getElementById("corp_text").value; if (Corp_number.length > 0) createJSONobj("Corp", Corp_number); } /** * Get LLC number text field data. */ var getLLCNum = function() { var LLC_number = []; LLC_number = document.getElementById("LLC_text").value; if (LLC_number.length > 0) createJSONobj("LLC", LLC_number); } /** * Get type of non-profit text field. */ var getNonProfit=function() { var NP_number = []; NP_number = document.getElementById("NP_text").value; if (NP_number.length > 0) createJSONobj("NP", NP_number); } /** * Get other description text */ var getDesc=function() { var getDesc=[]; getDesc = document.getElementById("OD_text").value; if (getDesc.length > 0) createJSONobj("Other_desc", getDesc); } The issue is that I have other functions like these that all have the same form and I'd would like to reduce the amount of code. Something generic that would capture the form of the code. This is difficult for me because the onClicks need the name of of each function object.
has comment: http://stackoverflow.com/comment/47870816

http://stackoverflow.com/q/29961900
downvote count: 0
tagged with: jquery
favorite count: 0
has title: How to count the number of divs shown in each row when it depends on the screen resolution
has body: I have the following code: HTML Alex_1 Alex_2 Alex_3 Alex_4 Alex_5 Alex_6 Alex_7 Alex_8 Show more JAVASCRIPT $.fn.myToggle = function () { return this.each(function () { var targetContainer = $(this), targetBox = targetContainer.find('.content'), targetTrigger = targetContainer.find('.toggle-trigger'), targetState = targetTrigger.find('.state'), contentBox = targetBox.find('.content-box'), boxHeight = contentBox.outerHeight(), optionHeight = targetBox.find('.options-holder').outerHeight(); $(window).on('resize', function () { boxHeight = contentBox.outerHeight(); if (targetState.hasClass('down')) { targetBox.stop(true, false).animate({ height: boxHeight }); } }); targetTrigger.on('tap', function () { targetBox.stop(true, false); if (targetState.hasClass('down')) { targetState.text(targetState.data('expand-text')); targetBox.animate({ height: optionHeight }); } else { targetState.text(targetState.data('collapse-text')); targetBox.animate({ height: boxHeight }); } targetState.toggleClass('up down'); return false; }); }); }; $(this.el).myToggle().on('click', '.checkbox-toggle', function (event) { var toggle = $(this), container = toggle.closest('.option-filter'); event.preventDefault(); container.find(':checkbox').prop('checked', toggle.hasClass('all')); }); The problem is that the .option-holder divs don't fit in only one row in my .content-box div so i have to hide them and create a show more/less toggle button to show or hide the rest. Everything works fine until the point that I only have the specific amount of .option-holder divs to fit only one line so i don't need the toggle button (the amount of divs comes dynamically from a server). My current solution is to count the number of divs and show the toggle button only if they are more than 4 (in most screen resolutions i get 4 divs per row). The problem is when the screen resolution is bigger and I get 5 or 6 per row. If I have 6 divs per row but only 5 divs to show then the button still exists because I show it a…
has comment: http://stackoverflow.com/comment/48048456
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29966595
tagged with: http://stackoverflow.com/tag/html
tagged with: css
score: 4
has comment: http://stackoverflow.com/comment/48045833
type: Question
has answer: http://stackoverflow.com/a/29962357
tagged with: javascript
upvote count: 4
answer count: 2

http://stackoverflow.com/q/29900450
favorite count: 0
has title: RecordRTC with custom sample rate records silence
tagged with: angularjs
linked to: http://stackoverflow.com/q/28969304
type: AnsweredQuestion
score: 2
downvote count: 0
has answer: http://stackoverflow.com/a/29908978
accepted answer: http://stackoverflow.com/a/29908978
type: Question
upvote count: 2
tagged with: webrtc
answer count: 1
tagged with: javascript
tagged with: getusermedia
has body: I'm trying to use RecordRTC.js to record audio from a microphone and upload it to a nancyfx server. For testing purposes, I'm just trying to upload the audio stream and save it to a wav file. My requirement is, however, that the stream is saved in 16 bits at 22050Hz. The problem is, when I record the file using standard configuration (without recordRtcOptions) , I can upload the file and save it. When I specify the sample rate in recordrtc the output file is just silence. The relevant part of the code is inside an angularJS service as follows: app.service('AudioService', ['$window', '$http', function($window, $http) { var recordRtcOptions = { 'sample-rate' : 22050 }; navigator.getUserMedia = ( $window.navigator.getUserMedia || $window.navigator.webkitGetUserMedia || $window.navigator.mozGetUserMedia || $window.navigator.msGetUserMedia) var _recordRTC = {}; navigator.getUserMedia({ audio: true, video: false }, function (stream) { console.log('starting to initialize getUserMedia'); console.log(recordRtcOptions); _recordRTC = RecordRTC(stream, recordRtcOptions); console.log('Finished initializing getUserMedia'); }, function (error) { console.log('Error initializing media stream: ' + error); }); var instance = {}; instance.startRecording = function() { console.log('starting to record...'); console.log('sample rate: ' + _recordRTC.sampleRate); _recordRTC.startRecording(); }; instance.stopRecording = function(uploadPath) { console.log('sample rate: ' + _recordRTC.sampleRate); _recordRTC.stopRecording(function(audioVideoMURL) { console.log('stopped recording...'); console.log('recordrtc stop sample rate: ' + _recordRTC.sampleRate); $http({ method : 'POST', url : uploadPath, data : _recordRTC.getBlob() }).success(function(data) { console.log('POST /audio Success'); }).error(function() { console.log('POST /audio error'); }); }); }; return instance; }]); Any idea on what might be the problem?

http://stackoverflow.com/q/29915223
has answer: http://stackoverflow.com/a/29915980
has body: I'm new to Angular and still painfully wrapping my head around custom directives. I'd like to reuse this bit of HTML {{$item.name}} by wrapping it into my custom directive: <language-picker ng-model="model.selectedLanguages"/> something like this: app.directive('languagePicker', function() { return { template : ' {{$item.name}} ', restrict : 'E', require : 'ngModel', replace : true .... }; }); But how do I pass the ngModel from my language-picker to the ui-select directive ? UPDATE Using the suggestions below, I got it work with ui-select, but the outer model doesn't get updated at all,see plnkr.co/edit/Y43dmMGIc5GxM9fLoNPW, probably because it's child scope and parent scope remains the same? UPDATE 2 I got it to work in a convoluted way that looks horrible to me, because I've no idea why it "works" in the first place (see the weird stuff happening in the controller): app.directive('languagePicker', function(LanguageService) { return { templateUrl : 'LanguagePickerTpl.html', restrict : 'E', scope : { languages : '=' }, controller : function($scope, LanguageService) { console.log($scope); $scope.langs = LanguageService.get(); $scope.model = $scope; } }; }) template: {{$item.name}} I would be very happy if anyone could explain what's going on (the "working" example is here http://plnkr.co/edit/B53F9sc7UGkj0uxUpC17 )
downvote count: 0
tagged with: javascript
answer count: 4
has title: angularjs pass ngModel from wrapper directive to wrapped directive
favorite count: 0
has answer: http://stackoverflow.com/a/29915556
tagged with: angularjs
has answer: http://stackoverflow.com/a/29915409
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47953241
has answer: http://stackoverflow.com/a/65939516
upvote count: 9
possible better answer: http://stackoverflow.com/a/29915980
accepted answer: http://stackoverflow.com/a/29915556
score: 9
type: Question
tagged with: angularjs-directive

http://stackoverflow.com/a/29931534
type: Answer
upvote count: 11
accepted answer of: http://stackoverflow.com/q/29909400
score: 11
answers question: http://stackoverflow.com/q/29909400
has body: As you mentioned, there is no resize event for elements on the page, just for window. You can however use Mutation Observers to detect changes in an element: const foo = document.querySelector('#foo'); let oldWidth = window.getComputedStyle(foo).getPropertyValue('width'); const observer = new MutationObserver(function(mutations) { mutations.forEach(mutation => { if (mutation.target === foo && mutation.attributeName === 'style' && oldWidth !== foo.style.width) { foo.textContent = 'Width changed from ' + oldWidth + ' to ' + foo.style.width; oldWidth = foo.style.width; } }); }); // configure the observer, just look for attribute changes: const config = { attributes: true }; // start observing observer.observe(foo, config); // change the width after a second so we can detect it setTimeout(() => { foo.style.width = '150px'; }, 1000); #foo { border: 2px solid #f30; width: 100px; height: 100px; transition: width 1s; } foo With a little more work you can create a function that will add a custom event to the element you want to detect width changes on: const addWidthChangeEvent = function(element) { let oldWidth = window.getComputedStyle(element).getPropertyValue('width'); const observer = new MutationObserver(mutations => { mutations.forEach(mutation => { if (mutation.target === element && mutation.attributeName === 'style' && oldWidth !== element.style.width) { oldWidth = element.style.width; element.dispatchEvent(new Event('widthChange')); } }); }); // configure the observer, just look for attribute changes: const config = { attributes: true }; observer.observe(element, config); }; const foo = document.getElementById('foo'); // add the new widthChange event to foo addWidthChangeEvent(foo); // add a listener for the new event foo.addEventListener('widthChange', event => { foo.textContent = foo.style.width; }, false); const randomInt = (min, max) => { return Math.floor(Math.random() * (max - min + 1)) + min; }; // change the width every 2 seconds setInterval(() => { let new…
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/139847820
has comment: http://stackoverflow.com/comment/70905460

http://stackoverflow.com/a/29992836
has comment: http://stackoverflow.com/comment/48105861
type: Answer
upvote count: 1
downvote count: 1
answers question: http://stackoverflow.com/q/29992688
has comment: http://stackoverflow.com/comment/48105498
has comment: http://stackoverflow.com/comment/48106274
has body: What about this (using jQuery): $('#canvas').focus().blur(function() { $('#canvas').focus(); }); The idea is to give it the focus back every time it loses it (blur). I made an example (with a textbox which is basically the same) here: http://jsfiddle.net/thepeak/j02vyryf/
has comment: http://stackoverflow.com/comment/48105174
has comment: http://stackoverflow.com/comment/48106420
score: 0
has comment: http://stackoverflow.com/comment/48105581
has comment: http://stackoverflow.com/comment/48106510

http://stackoverflow.com/comment/54189960
score: 0
type: AnswerComment
type: Comment
has text: How do I use the older versions of ExtJS at bjornharrtell git repo? I forked and synced to the commit for 5.0.1 but when I try to use it when generating an app using sencha cmd I get this error: Failed to resolve dependency Ext.app.Application
comment on: http://stackoverflow.com/a/29858591

http://stackoverflow.com/q/29896989
tagged with: sencha-touch
has answer: http://stackoverflow.com/a/29899179
has comment: http://stackoverflow.com/comment/47916618
type: UnansweredQuestion
upvote count: 1
has title: How to make two lists in different columns or boxes in a Sencha Touch app?
score: 1
has comment: http://stackoverflow.com/comment/47916734
type: Question
downvote count: 0
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/47920038
favorite count: 0
tagged with: extjs
has body: I am trying to make two lists in a same view, I am separating the view in two flex boxes and inside of this includes each list but it is not working properly.. any clue of this implementation or suggestion? I am working with Sencha Touch 2.3.1 framework. Thanks in advance. /** * The home view */ Ext.define('xx.view.home.BlocksHome', { extend : 'Ext.Container', xtype : 'blocksHome', requires: [ 'Ext.TitleBar', 'Ext.dataview.List', 'xx.view.news.News' ], config : { items: [ // selection container { xtype : 'container', cls : 'home-container', flex : 2, layout : { type : 'hbox', align: 'stretch' }, defaults: { xtype : 'container', styleHtmlContent: true, flex : 1 }, items : [ // Data Collection { cls : 'news-container', iconCls: 'inbox', height: 800, layout: 'vbox', items: [ { cls : 'news-collection-header', layout: 'hbox', items: [ { html: ' ' + xx.Text.getText('NEWS') +' ', flex: 2 }, { xtype : 'button', itemId: 'toNewsCollection', iconCls: 'inbox', text : xx.Text.getText('NEWS'), flex: 1 }, { xtype: 'news', layout: 'card' } ] } ] }, // Customers { cls : 'open-activities', layout: 'vbox', items: [ { cls : 'open-activities-header', layout: 'hbox', items : [ { html: ' ' + xx.getText('ACTIVITY_LIST_TITLE') +' ', flex: 2 }, { xtype : 'button', itemId: 'toActivitiesCollection', iconCls: 'check2', text : xx.Text.getText('ACTIVITY_LIST_TITLE'), flex: 1 } ] } ] } ] } ] } }); And here the view include in a card layout named "news" Ext.define('xx.view.news.List', { extend: 'Ext.dataview.List', xtype: 'news', requires: [ 'Ext.TitleBar', 'Ext.plugin.PullRefresh' ], config: { plugins: [ { xclass: 'Ext.plugin.PullRefresh', listeners: { painted: function(element) { if (Ext.browser.is.IE) { // position pull to refresh centered Ext.get(element.query('.x-list-pullrefresh')[0]).setStyle('left', (Ext.getBody().getWidth() / 2) - 132 + 'px'); } } } } ], store: 'News', itemTpl: ' ' + ' new {subject} ' + ' {[xx.Helper.formatSAPdate2Str(values.updatedate)]} ' + ' {responsible} ' + ' ' + ' ' …

dojo
tags question: http://stackoverflow.com/q/29977370
tags question: http://stackoverflow.com/q/29969286
tags question: http://stackoverflow.com/q/29955270
tags question: http://stackoverflow.com/q/29856976
tags question: http://stackoverflow.com/q/29886352
type: Tag
tags question: http://stackoverflow.com/q/29991159
tags question: http://stackoverflow.com/q/29973075
tags question: http://stackoverflow.com/q/29953333
tags question: http://stackoverflow.com/q/29863573
tags question: http://stackoverflow.com/q/29847133
tags question: http://stackoverflow.com/q/29931695
tag name: dojo
tags question: http://stackoverflow.com/q/29924552

http://stackoverflow.com/q/29870232
tagged with: javascript
score: 1
tagged with: jquery
has title: Open 1 modal with two different links
favorite count: 0
has body: So I have a page, with a modal. Now I have a table on that page. I want to include a link in each row of the table that opens that same modal, and then put different content in it using jQuery. The problem I'm having is in the modals. When I give 2 links the id code, and do the following in jQUery: $(document).ready(function() { $("#code").click(function() { $("#CodeModal").modal('show') }); }); Only the first link opens the modal. I have also tried data-toggle, but that resulted in no links being able the open the modal. Is there a way to make this possible? If so, how to do it? Thanks.
accepted answer: http://stackoverflow.com/a/29870248
upvote count: 2
tagged with: twitter-bootstrap
downvote count: 1
type: AnsweredQuestion
type: Question
answer count: 1
has answer: http://stackoverflow.com/a/29870248

http://stackoverflow.com/a/29888384
score: 0
has comment: http://stackoverflow.com/comment/47900620
answers question: http://stackoverflow.com/q/29888137
type: Answer
has body: Possible mistake ! ... Include this also in widget ( Any one if you have multiple )
has comment: http://stackoverflow.com/comment/47900757

http://stackoverflow.com/q/29905317
has title: Filter array of objects to a single matching object in mongodb/meteor
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/29914194
answer count: 1
tagged with: meteor
type: UnansweredQuestion
tagged with: node.js
has comment: http://stackoverflow.com/comment/47935712
type: Question
tagged with: mongodb
has body: I have a query which looks as so: var writer = Writers.findOne({ _id: writerId, books: { $elemMatch: { id: Books.findOne({ slug: bookSlug })._id } } }); However, this will return the full list of classes in the query. { name: "H.P. Lovecraft", books: [{ id: "1234", slug: "at-the-mountains-of-madness" }, { id: "5678", slug: "herbert-west-reanimator" }] } Would there be a way to eliminate all information except for the one item in the list I want and make it into an object? That is to say, I want my final result to be: { name: "H.P Lovecraft", book: { id: "1234", slug: "herbert-west-reanimator" } } How would this be done in Meteor with mongodb?

http://stackoverflow.com/comment/47910190
score: 0
comment on: http://stackoverflow.com/q/29893571
type: Comment
type: QuestionComment
has text: It's not clear whether you're *actually* trying to do this in Javascript or Java. Where do JSPs come in? If all the code is server-side, Javascript is a red herring. If it's all client-side, Java and JSPs are red herrings...

http://stackoverflow.com/a/29897216
has body: Use $in operator... You can use it like Schema.find({_id:{$in:[array_of_playerid]} }).exec(function(error,results)){ }
type: Answer
answers question: http://stackoverflow.com/q/29896697
score: 1
upvote count: 1
downvote count: 0

http://stackoverflow.com/a/30031248
downvote count: 0
type: Answer
upvote count: 1
has body: Try in this way, I hope this will give you an idea: page.find('div.user-image')['style'].should == 'background-image:url(/images/user_image.jpg)'
answers question: http://stackoverflow.com/q/29944289
score: 1

http://stackoverflow.com/q/29949762
score: 0
upvote count: 1
answer count: 1
downvote count: 1
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/29954268
tagged with: meteor
type: UnansweredQuestion
has title: Exception in async function: Only on server, not on localhost
type: Question
has body: I am trying to get a route working that will function as a "Thank You" page for people who buy our products on an external store. On localhost everything works fine but on our staging server I get the following exception: Exception in callback of async function: action@http://taskwunderstaging-45398.onmodulus.net/12289f8cf999b67e6c6c6dcad1a5a5eded53f4e2.js:517:468 Does anyone have an idea what might be causing this? The code in question is as follows: The Iron Router Endpoint Router.route('/signup-partner', { name: 'signupPartner', where: 'client', waitOn: function(){ return Meteor.subscribe("packages"); }, action: function() { Meteor.logout(function() {}); var query = this.params.query; //@TODO verify the query with the sha key! var userInfo = { email:query.email, firstname:query.firstname, lastname:query.lastname, }; var companyInfo = { companyName:query.company, street:query.street, city:query.city, zipcode:query.zipcode, country:query.country, taxId:query.taxid }; var orderInfo = { product:query.product, order:query.order, }; // get the package from the database orderInfo.package = Packages.findOne({digistoreId:orderInfo.product}).name; orderInfo.tw_id = Packages.findOne({digistoreId:orderInfo.product})._id; var data = { userInfo:userInfo, companyInfo:companyInfo, orderInfo:orderInfo, }; var that = this; // check if the user account already exists and if so add the package and login the user Meteor.call("partnerUserExists", data.userInfo.email,{orderId:data.orderInfo.order,tw_id:data.orderInfo.tw_id}, function(error, result){ if(result === "not-found"){ that.render('signup_partner',{ data: function(){ return data; } }); } else { Session.set('boughtPackage',result); that.redirect('login'); } }); } }); the method that this route calls is as follows: partnerUserExists: function(email,orderIds){ var user = Meteor.users.findOne({"emails.address":email}) || false; console.log(user); if(!user){ return "not-found"; } if(_.indexOf(user.data.digistoreOrders,orderIds.order…

http://stackoverflow.com/q/29906688
answer count: 0
tagged with: npm
type: UnansweredQuestion
tagged with: node.js
score: 2
has title: Can't uploading base 64 to imgur
downvote count: 0
has body: up: function(req, res) { console.log(req.param('image')); imgurwrap.setClientID('myImgurClientID') imgurwrap.uploadImageBase64({ image: req.param('image'), title: 'sfdsf', description: 'sfsdf' }, function(err, res) { console.log(res); console.log(err); }); }, This code returns me an url with an empty image like this: https://i.sstatic.net/3t2JV.png . However if I declare a variable and put my encoded base64 string in it, it works. So I thought some data was appened in the request but a diff showed no difference. I've tried others npm imgur modules and it's always the same behavior so something must be wront on my side but I can't figure it out..
type: Question
tagged with: sails.js
tagged with: javascript
tagged with: base64
upvote count: 2
favorite count: 0
has comment: http://stackoverflow.com/comment/47943085

http://stackoverflow.com/comment/47836720
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29855374
has text: @Ted Would that counter be on the close of the success block on the Ajax call?
score: 0

http://stackoverflow.com/q/29856727
upvote count: 0
has answer: http://stackoverflow.com/a/29856995
downvote count: 1
type: Question
has title: Mobile view emulator, Javascript/HTML
has comment: http://stackoverflow.com/comment/47839650
tagged with: mobile
tagged with: javascript
score: -1
answer count: 2
tagged with: scale
favorite count: 0
has answer: http://stackoverflow.com/a/29856798
type: UnansweredQuestion
has body: I want to "emulate" how site will look in phone. So, for example next code: First Second Must always look in xs-12 version of site. I tried to use , but it doesn't work for me.

http://stackoverflow.com/comment/47926934
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29901025
has text: Neither `setTimeout` nor `clearTimeout` are jQuery things. They are vanilla-js things.
score: 0

http://stackoverflow.com/comment/127702342
comment on: http://stackoverflow.com/a/38031996
has text: This should be bumped as it is simpler than accepted answer
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/29946117
downvote count: 0
linked to: http://stackoverflow.com/q/1709301
tagged with: javascript
has answer: http://stackoverflow.com/a/29949424
has comment: http://stackoverflow.com/comment/48013271
has comment: http://stackoverflow.com/comment/48014889
answer count: 3
has comment: http://stackoverflow.com/comment/48013580
has title: Submit a form from a link and get $_Post value
favorite count: 0
has body: I have the following problem. I have a form containing several links. Those links should assign a hidden field and submit the form using some javascript. I'm using PHP 5.4. When I submit the form using the button, the $_POST containts data. But when the form is submitter from javascript, the $_POST is empty. Any clue? <?php var_dump($_POST); ?> test 1 test 2 OK
has answer: http://stackoverflow.com/a/60092210
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29946499
upvote count: 1
tagged with: php
has comment: http://stackoverflow.com/comment/48019313
score: 1
has comment: http://stackoverflow.com/comment/48014204
has comment: http://stackoverflow.com/comment/48013696
tagged with: forms
type: Question
has comment: http://stackoverflow.com/comment/106280700

http://stackoverflow.com/comment/48098186
has text: Still wont do anything :(
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29967723

http://stackoverflow.com/q/29975374
has body: I am working with PHP's Yii framework and having issues clearing or deleting the uploaded file from the textfield. Currently, it will delete the content from the fileField, but can't get it to delete the textfield. Any ideas? UPDATE I can now clear my textField because I've hard coded my clearFileInputField function by adding $('.getFile').val(""); I reference this in my HTML by adding the 'class' =&gt; 'getName' in the input section. While this clears the data, it doesn't remove the file after saving. Any suggestions? HTML &lt;div id = "clearContent"&gt; &lt;?php echo $form-&gt;labelex($model,'info'); ?&gt; &lt;?php echo $form-&gt;textfield($model,'info', array(placeholder =&gt; "No file chosen", readonly =&gt; true, 'class' =&gt; 'getName')); ?&gt;&lt;br&gt; &lt;?php echo $form-&gt;fileField($model,'info'); ?&gt; &lt;?php echo $form-&gt;error($model,'info'); ?&gt; &lt;input type="checkbox" onclick = "clearFileInputField('clearContent')" href="javascript:noAction();"&gt; Remove File &lt;/div&gt; JavaScript: &lt;script&gt; function clearFileInputField(tagId) { document.getElementById(tagId).innerHTML = document.getElementById(tagId).innerHTML; $('.getFile').val(""); } &lt;/script&gt;
has comment: http://stackoverflow.com/comment/48073790
has comment: http://stackoverflow.com/comment/48088460
tagged with: yii
tagged with: javascript
score: 4
type: Question
upvote count: 4
answer count: 1
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/29977042
tagged with: php
has title: Clear or Delete file from textField
type: UnansweredQuestion

http://stackoverflow.com/q/29943445
has comment: http://stackoverflow.com/comment/48008646
has comment: http://stackoverflow.com/comment/48017951
has comment: http://stackoverflow.com/comment/48008902
type: Question
has comment: http://stackoverflow.com/comment/48007913
has comment: http://stackoverflow.com/comment/48007927
has comment: http://stackoverflow.com/comment/48008186
tagged with: javascript
has comment: http://stackoverflow.com/comment/48007648
tagged with: jquery
has comment: http://stackoverflow.com/comment/48007736
tagged with: ajax
has comment: http://stackoverflow.com/comment/48017478
score: 0
has comment: http://stackoverflow.com/comment/48007655
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/48007889
has comment: http://stackoverflow.com/comment/48008633
has body: I am executing 3 nested synchronous jQuery Ajax calls. Inside the success event handler of the inner most Ajax call I have updated a div on the HTML page. This is not taking effect on the HTML page until all the calls get completed. My idea is to give updates to the users on the page about the progress of the process. The inner most Ajax call uses the information from the above 2 Ajax calls. Thats why if I execute the Ajax calls synchronously it gets wrong data for the inner most Ajax call due to the for loops get executed earlier than the main inner most Ajax call gets completed. Please look at these lines of code in the below sample code: // ISSUE: This line of code takes effect on the HTML page after all the ajax calls get completed $("&lt;label&gt;" + responseText + "&lt;/label&gt;&lt;br /&gt;").appendTo('#DlgHdBodyContainer'); Sample code: //Asynchronous AJAX function to Retrieve a CRM record using OData $.ajax({ type: "GET", contentType: "application/json; charset=utf-8", dataType: "json", url: odataUri, async: false, beforeSend: function (XMLHttpRequest) { //Specifying this header ensures that the results will be returned as JSON. XMLHttpRequest.setRequestHeader("Accept", "application/json"); }, success: function (data, textStatus, XmlHttpRequest) { var customObjects1 = data.d.results; for (var i = 0; i &lt; customObjects1.length; i++) { var CustomObject1Id = customObjects1[i].cc_CustomObject1Id; var ActivityId = customObjects1[i].Activity.Id; var CustomObject1Name = customObjects1[i].Name; if (customObjects1[i].Activity.Id != null) { //Asynchronous AJAX function to Retrieve a CRM record using OData $.ajax({ type: "GET", contentType: "application/json; charset=utf-8", dataType: "json", url: odataUri, async: false, beforeSend: function (XMLHttpRequest) { //Specifying this header ensures that the results will be returned as JSON. XMLHttpRequest.setRequestHeader("Accept", "application/json"); }, success: function (data2, textStatus, XmlHttpRequest) { if (data2.d…
has comment: http://stackoverflow.com/comment/48008327
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/48007786
has comment: http://stackoverflow.com/comment/48015017
has comment: http://stackoverflow.com/comment/48009091
has answer: http://stackoverflow.com/a/29943836
has title: Updating a div in the succes event of an Ajax call

http://stackoverflow.com/q/29860379
accepted answer: http://stackoverflow.com/a/31497955
tagged with: aws-sdk
upvote count: 6
tagged with: node.js
type: AnsweredQuestion
has body: Lets say I have the following // file sample.js var aws = require('aws-sdk'); var dynamoDB = new aws.DynamoDB(); exports.processData = function(){ var data = dynamoDB.getItem(params); // so something with data }; How can I write unit tests for the above code sample. //file sample_test.js var aws = require('aws-sdk'); var sinon = require('sinon'); // the following code doesnt seem to stub the function // the actual function is still used in sample.js var getItemStub = sinon.stub(); aws.DynamoDB.prototype.getItem = getItemStub; var sample = require('./sample'); What will be a good way to stub the aws-sdk api. I was thinking of using SinonJS to achieve it, but I am open to other libraries and suggestions .
type: Question
tagged with: javascript
has title: How to stub aws-sdk
has answer: http://stackoverflow.com/a/37345527
score: 6
answer count: 2
tagged with: sinon
possible better answer: http://stackoverflow.com/a/37345527
downvote count: 0
has answer: http://stackoverflow.com/a/31497955
favorite count: 0

http://stackoverflow.com/comment/47881441
type: QuestionComment
comment on: http://stackoverflow.com/q/29878662
score: 0
has text: You'd probably be missing media-queries for the tablet resolution range.
type: Comment

http://stackoverflow.com/a/29938349
upvote count: 1
answers question: http://stackoverflow.com/q/29936971
type: Answer
has body: For such array/collection manipulation in Javascript I would suggest you to use underscorejs library. It provides functions that, to me, make everything much more simple. In your case: function find_value(array, key) { // find will run the provided function for every object in array var obj_found = _.find(array, function(obj) { // keys returns the keys inside an object // so if the key of currently examined object // is what we are looking for, return the obj if (_.keys(obj)[0] === key) { return obj; } }); // if an object with such key was found return its value if (obj_found) { return obj_found[key]; } else { return null; } } Here is a working fiddle of what I am suggesting.
downvote count: 0
score: 1

http://stackoverflow.com/comment/48029580
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/29954223
has text: If you have a proper DOM structure in the first place, then using media queries to do most things are sufficient. If you really need to change the dom there is always javascript, but it really isn't the best tool in most cases.
type: Comment

http://stackoverflow.com/comment/48120298
type: Comment
has text: `url: "/pages/login.php",` - you should change your relative path, consider removing the first `/` or adding a `.` prior to it.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/30000764

http://stackoverflow.com/comment/48122579
score: 0
has text: The answer that @Fabian linked here does not I don't think help me. The problem that I'm having, which I think I may have not clarified well enough, is that when I call the above function, it returns "undefined". That is the output is "undefined" followed by the correct output of `console.log(result)`.
type: QuestionComment
comment on: http://stackoverflow.com/q/30001713
type: Comment

http://stackoverflow.com/a/29923295
has comment: http://stackoverflow.com/comment/47969635
has comment: http://stackoverflow.com/comment/47969832
answers question: http://stackoverflow.com/q/29923205
type: Answer
upvote count: 4
has comment: http://stackoverflow.com/comment/47969104
downvote count: 0
has comment: http://stackoverflow.com/comment/47968906
has body: Just exclude the current item clicked from the slideUp (with not) and use slideToggle for the current item. jQuery(".food-content").hide(); jQuery(".food-content").first().slideToggle(500); jQuery('.food-item').click(function () { jQuery(".menu-container, .full-menu-container").siblings().not(this).find('.food-content').slideUp(); jQuery(this).find('.food-content').slideToggle(); }); https://jsfiddle.net/TrueBlueAussie/uyb4Lzuy/1/
has comment: http://stackoverflow.com/comment/47968858
has comment: http://stackoverflow.com/comment/47969025
score: 4

http://stackoverflow.com/comment/47834653
comment on: http://stackoverflow.com/a/29853638
score: 0
type: AnswerComment
type: Comment
has text: @hmt - just to be clear, you have to not only use `.on()`, but you have to use it the right way (which is described in the reference posts I've linked to).

http://stackoverflow.com/a/30001159
downvote count: 0
type: Answer
has body: always Use **ON()** instead of **click()** enter link description here Check this https://jsfiddle.net/ncsr4tgh/1/ its working.....
score: 1
answers question: http://stackoverflow.com/q/30000929
upvote count: 1

http://stackoverflow.com/comment/48028434
type: Comment
type: QuestionComment
has text: I'm not sure. I'm using Web Essentials 2013 with Visual Studio 2013 Premium.
comment on: http://stackoverflow.com/q/29953740
score: 0

http://stackoverflow.com/comment/48059206
type: Comment
type: QuestionComment
has text: It looks like a misprint.
score: 0
comment on: http://stackoverflow.com/q/29969717

http://stackoverflow.com/a/29956383
has body: There's no way to lookup like you want. You'll need to create a map. That map can either replace your initial array in your data, if it makes sense, or you can just generate a lookup map that you refer to later. Luckily if you set fooarray[0] = bar;foomap['uuid'] = bar;, you can update bar via either data structure eg fooarray[0][1] = 'new title' or foomap['uuid'][1] = 'new title' and it will update in both structures, because it's passed by reference. edit building on @YangLi: var products = { product_id: [product_id, title, description], 1234: [1234, apple, this is just apple], 2345: [2345, pineapple, this is not just apple] } var productsIndex = {} function recursiveTransform(val){ setTimeout(function(){ productsIndex[products[val].[0]] = products[val]; if (val != products.length -1) recursiveTransform(val+1); }, 0) } recursiveTransform(0);
type: Answer
answers question: http://stackoverflow.com/q/29956294
score: 0

http://stackoverflow.com/q/29984862
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29998577
accepted answer: http://stackoverflow.com/a/29998577
has body: I am using the Bootstrap Datepicker here in order to display a simple calendar range picker. All is working well so far, however I would like some additional functionality that I can't seem to figure out. I would like to select a start date and then automatically fill in the end date (+10 days). I'm sure this is possible however I can't figure it out. I have created a Fiddle. Any help is greatly appreciated. My JS is as follows; $( document ).ready(function() { $('#sandbox-container .input-daterange').datepicker({ format: "dd/mm/yy", startDate: "0d", endDate: "+10d", todayBtn: "linked", clearBtn: true, multidateSeparator: " ", forceParse: false, daysOfWeekDisabled: "0,6", orientation: "top auto", todayHighlight: true, toggleActive: true }); }); My HTML is as follows; Select borrow date to
type: Question
upvote count: 2
linked to: http://stackoverflow.com/q/2021788
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
has title: Bootstrap datepicker auto fill end date
has comment: http://stackoverflow.com/comment/48094359
tagged with: datepicker
has comment: http://stackoverflow.com/comment/48093000
score: 2
downvote count: 0
tagged with: twitter-bootstrap

http://stackoverflow.com/q/29913946
has comment: http://stackoverflow.com/comment/47984340
tagged with: javascript
score: 0
tagged with: google-chrome-extension
answer count: 1
has title: How to use backgroundpage to stay a value which used in an inject js?
accepted answer: http://stackoverflow.com/a/29931326
has body: { "name": "coffee", "manifest_version":2, "version": "1.0", "description": "coffee test", "browser_action": { "default_icon": "icon.png" , "default_title": "My Task List", "default_popup": "popup.html" }, "background": { "scripts": ["background.js"] }, "content_scripts": [{ "matches": ["http://*/*","https://*/*" ], "js": ["inject.js"], "run_at": "document_end", "all_frames": true }], "permissions": [ "tabs", "http://*/*","https://*/*" ] } manifest.josn count=1; background.js var bgpg=chrome.extension.getBackgroundPage(); if(bgpg) { alert("ok"); if(bgpg.count&gt;=0){ bgpg.count=bgpg.count+1; }else{ bgpg.count=0; } alert(bgpg.count); }else{alert("NO");} inject.js. It didn't alter anything.In fact,last week I succeed to use the background value,but today I totally can't find where I am wrong.
has comment: http://stackoverflow.com/comment/47984859
has comment: http://stackoverflow.com/comment/47984937
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47984192
has comment: http://stackoverflow.com/comment/47984713
has comment: http://stackoverflow.com/comment/47986433
has comment: http://stackoverflow.com/comment/47975094
type: Question
has answer: http://stackoverflow.com/a/29931326

http://stackoverflow.com/a/29926836
type: Answer
answers question: http://stackoverflow.com/q/29926670
downvote count: 0
score: 3
has body: For disabling a link, see the accepted answer to this question. To make such a disabled link clickable again, however, requires not only the removal of the class, but you'll also need to unbind the handler that disables the link: $('new-user').removeClass('not-allowed'); $('new-user').off('click');
upvote count: 3
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29926670

asp.net
tags question: http://stackoverflow.com/q/29856267
tags question: http://stackoverflow.com/q/29895022
tags question: http://stackoverflow.com/q/29863361
tags question: http://stackoverflow.com/q/29906391
tags question: http://stackoverflow.com/q/29889818
tags question: http://stackoverflow.com/q/29937353
tags question: http://stackoverflow.com/q/29949366
tags question: http://stackoverflow.com/q/29887817
tags question: http://stackoverflow.com/q/29861728
tags question: http://stackoverflow.com/q/29852027
tags question: http://stackoverflow.com/q/29951952
tags question: http://stackoverflow.com/q/29935216
tags question: http://stackoverflow.com/q/29921258
tags question: http://stackoverflow.com/q/29864710
tags question: http://stackoverflow.com/q/30002393
tags question: http://stackoverflow.com/q/29962306
tags question: http://stackoverflow.com/q/29868137
tags question: http://stackoverflow.com/q/29896396
tags question: http://stackoverflow.com/q/29889190
tags question: http://stackoverflow.com/q/29897717
tags question: http://stackoverflow.com/q/29915622
tags question: http://stackoverflow.com/q/29893242
tags question: http://stackoverflow.com/q/29850599
tags question: http://stackoverflow.com/q/29942314
tags question: http://stackoverflow.com/q/29857066
tags question: http://stackoverflow.com/q/29918372
tags question: http://stackoverflow.com/q/29923945
tags question: http://stackoverflow.com/q/29967023
tags question: http://stackoverflow.com/q/29868232
tags question: http://stackoverflow.com/q/29865484
tags question: http://stackoverflow.com/q/29929507
tags question: http://stackoverflow.com/q/29995880
tags question: http://stackoverflow.com/q/29900098
tags question: http://stackoverflow.com/q/29936860
tags question: http://stackoverflow.com/q/29873787
tags question: http://stackoverflow.com/q/29929433
tags question: http://stackoverflow.com/q/29863494
tags question: http://stackoverflow.com/q/29846639
tags question: http://stackoverflow.com/q/29969651
tags question: http://stackoverflow.com/q/29930271
tags question: http://stackoverflow.com/q/29965882
tags question: http://stackoverflow.com/q/29912905
type: Tag
tags question: http://stackoverflow.com/q/29943514
tags question: http://stackoverflow.com/q/29943131
tags question: http://stackoverflow.com/q/29989199
tags question: http://stackoverflow.com/q/29962008
tags question: http://stackoverflow.com/q/29968078
tags question: http://stackoverflow.com/q/29934318
tags question: http://stackoverflow.com/q/29940310
tags question: http://stackoverflow.com/q/29999382
tags question: http://stackoverflow.com/q/29937886
tags question: http://stackoverflow.com/q/29888064
tags question: http://stackoverflow.com/q/29896572
tags question: http://stackoverflow.com/q/29911833
tags question: http://stackoverflow.com/q/29871691
tags question: http://stackoverflow.com/q/29961224
tags question: http://stackoverflow.com/q/29912282
tags question: http://stackoverflow.com/q/29875706
tags question: http://stackoverflow.com/q/29920263
tags question: http://stackoverflow.com/q/29950649
tags question: http://stackoverflow.com/q/29977668
tags question: http://stackoverflow.com/q/29910350
tags question: http://stackoverflow.com/q/29890491
tags question: http://stackoverflow.com/q/29849313
tags question: http://stackoverflow.com/q/30001892
tags question: http://stackoverflow.com/q/29906775
tags question: http://stackoverflow.com/q/29890544
tags question: http://stackoverflow.com/q/29876011
tags question: http://stackoverflow.com/q/29983150
tag name: asp.net
tags question: http://stackoverflow.com/q/29907837
tags question: http://stackoverflow.com/q/29914620
tags question: http://stackoverflow.com/q/29921073
tags question: http://stackoverflow.com/q/29951698
tags question: http://stackoverflow.com/q/29973237
tags question: http://stackoverflow.com/q/29959626
tags question: http://stackoverflow.com/q/29923961
tags question: http://stackoverflow.com/q/29906273
tags question: http://stackoverflow.com/q/29989952

http://stackoverflow.com/a/29947833
accepted answer of: http://stackoverflow.com/q/29947176
type: AcceptedAnswer
downvote count: 0
score: 15
answers question: http://stackoverflow.com/q/29947176
has body: There isn't a much cleaner way (then your update). As you noticed, when you change item in your callback function you change the local reference, and not the original item in the array. You can improve this a bit by using the $index from the ng-repeat, instead of calculating it yourself: &lt;div ng-click="getUpdatedItem(item, $index)"&gt; &lt;/div&gt; And in your controller: $scope.getUpdatedItem = function(item, index){ itemService.getItem(item).then( function(updatedItem){ $scope.myItems[index] = updateItem; }, function(error){ //Handle error } ); }; You can also use angular.copy instead but it's much less efficient: function(updatedItem){ angular.copy(updateItem, item); },
type: Answer
has comment: http://stackoverflow.com/comment/74033045
upvote count: 15

http://stackoverflow.com/comment/48047056
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29963334
score: 0
has text: What is event ? Does your code generate an error ?

http://stackoverflow.com/comment/48074003
type: QuestionComment
type: Comment
has text: Not possible with NAT. That information is simply not available to the server.
score: 0
comment on: http://stackoverflow.com/q/29976359

http://stackoverflow.com/comment/48043669
score: 0
type: Comment
has text: This is so much messier than my solution, why would you even post this 30 minutes later after seeing my answer. ??
comment on: http://stackoverflow.com/a/29961145
type: AnswerComment

http://stackoverflow.com/a/29941959
has body: My difficulty with both of these solutions was actually get the dialog to be invoked from the html. both solutions used that didn't compatible with my situation. I worked out that as in the solutions the hyperlink was not actually a hyperlink that if I changed it to a button like I do for the first option things would be easier, so the hmtl changed to &lt;td&gt; &lt;input title="View tracks in this release" onclick="return toggleMe(this,'30')" src="/images/open.png" alt="Open" type="image"&gt; &amp;nbsp; &lt;input title="Link" onclick="return promptForDiscogsReleaseId(this,'676fdad7-69b5-4f38-a547-a8320f01ad59')" src="/images/custom_link.png" alt="Link" type="image"&gt; &lt;/td&gt; and added this javascript function that shows a prompt and then creates a new page with the derived hyperlink javascript function to function promptForDiscogsReleaseId(btn,mbReleaseId) { var answer = prompt("Please the Discogs Release Id you want to link this release to:"); window.open("/linkrelease/?discogsid="+answer+"&amp;mbid="+mbReleaseId, "_blank"); } and it works.
type: Answer
accepted answer of: http://stackoverflow.com/q/29924882
answers question: http://stackoverflow.com/q/29924882
score: 0
type: AcceptedAnswer

http://stackoverflow.com/comment/48016917
has text: @Trim, I am receiving data in the php file but my jQuery is throwing error message. I have put an alert in error and success function. Each time, the alert of error function is getting hit.
score: 0
comment on: http://stackoverflow.com/q/29946624
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29950758
has comment: http://stackoverflow.com/comment/48032681
score: 2
has body: When new Date() is printed to your console, your operating system defines the locale and format for printing. Wed Apr 29 2015 18:15:33 GMT+0100 (GMT Daylight Time) is what your browser has deemed a default. When you print .toJSON, this happens: http://es5.github.io/#x15.9.5.44 This function provides a String representation of a Date object for use by JSON.stringify (15.12.3). When the toJSON method is called with argument key, the following steps are taken: Let O be the result of calling ToObject, giving it the this value as its argument. Let tv be ToPrimitive(O, hint Number). If tv is a Number and is not finite, return null. Let toISO be the result of calling the Get internal method of O with argument "toISOString". 5.If IsCallable(toISO) is false, throw a TypeError exception. Return the result of calling the Call internal method of toISO with O as the this value and an empty argument list. http://es5.github.io/#x15.9.5.43 15.9.5.43 Date.prototype.toISOString ( ) This function returns a String value represent the instance in time represented by this Date object. The format of the String is the Date Time string format defined in 15.9.1.15. All fields are present in the String. The time zone is always UTC, denoted by the suffix Z. If the time value of this object is not a finite Number a RangeError exception is thrown. http://es5.github.io/#x15.9.1.15 15.9.1.15 Date Time String Format ECMAScript defines a string interchange format for date-times based upon a simplification of the ISO 8601 Extended Format. The format is as follows: YYYY-MM-DDTHH:mm:ss.sssZ The reason is specifically so that dates can be serialized as a string and then brought back to an Object without any loss of data.
upvote count: 2
answers question: http://stackoverflow.com/q/29950598
downvote count: 0
type: Answer

http://stackoverflow.com/a/29903071
upvote count: 1
has body: Try to change characterclicked to: var oddoneout = new Array(); oddoneout[0] = {characterName:"character3", answer: 1}; oddoneout[1] = {characterName:"character6", answer: 2}; oddoneout[2] = {characterName:"character9", answer: 3}; oddoneout.sort(function(a, b) {return Math.random() -0.5;}); function characterclicked(i) { switch(i) { case 1: case 2: case 3: if (oddoneout[i-1].answer == i) { alert("You're right!"); } break; default: alert(i); break; } } To unsort the array your comparison function is wrong. So I tried to adjust your code hoping it could help you.
type: Answer
answers question: http://stackoverflow.com/q/29902873
downvote count: 0
score: 1

http://stackoverflow.com/q/29945803
has title: jQuery - changing page with sending a POST parameter
has comment: http://stackoverflow.com/comment/48012407
tagged with: javascript
linked to: http://stackoverflow.com/q/199099
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/29946050
has body: scenario is: I have HTML a-tag in a page(call it 'index.php') which is a link to another page (lets call it page 'action.php') ! obviously 'action.php' page needs to receive a POST parameter, otherwise it return error! i have the needed parameter in 'index.php' page, but i dont want to use form-tag to send it. Whenever user clicked on the a-tag, the parameter should be sent to the 'action.php' page. Indeed, AJAX has nothing to do here, while i want to change the page, with sending the POST parameter whenever user click on my &lt; a > ! example: index.php &lt;a class='showProject' href='action.php' data-pid='&lt;?php echo project_ID ?&gt;'&gt; PROJECT &lt;/a&gt; action.php echo $_POST['project_id']; i prefer that, if there is any way to do this, the jQuery Code starts with the following event: $('.showProject').on('click',this,function(e){ /* YOUR SOLUTION */ });
tagged with: jquery
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29946056
has comment: http://stackoverflow.com/comment/48012808
type: Question

http://stackoverflow.com/comment/47939943
score: 0
has text: The fiddle works for me :S
comment on: http://stackoverflow.com/q/29907141
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29921683
type: Question
has body: I have a situation where I am dynamically creating tables. There are an undetermined number of tables, so there could be one table or there could be ten tables, etc. Then I am taking the probability of the first value and dividing it by the probability of all the numbers in its table added ( for example 0.50/(0.50+0.94+0.80) ) and THEN multiplying it by a number in the next table with the same equation performed on it (for example 0.54/(0.54+0.49+0.32)), and finally multiplying that number by a number in the next table with the same equation performed on it (for example 0.11/(0.11+0.18+0.72))...this could go on for a long time depending how many tables there are. In this instance, 27 different numbers will be created as you perform this equation until you have used every number combination in the table (3 * 3 * 3 combinations). Thus, my goal is to create a function that will do this multiplication dynamically, only knowing that there is the class attributeGroup on the div containing each of the tables (as shown below). Thus far I have been thinking about using jQuery's each function, as in $('.attributeGroup').each(..., and have also thought about putting the selected table rows into an array and popping them out once used for each attributeGroup... An example of this: If you had just two tables, the first with two rows with probabilities of 0.2 and 0.3, and the second with two rows and probabilities of 0.4 and 0.5, you would first do (0.2/(0.2+0.3)) * (0.4/(0.4+0.5)), then (0.2/(0.2+0.3)) * (0.5/(0.4+0.5)), then (0.3/(0.2+0.3)) * (0.4/(0.4+0.5)), and finally (0.3/(0.2+0.3)) * (0.5/(0.4+0.5)) With Oucomes:0.17777777777,0.22222222222,0.26666666666,0.33333333333 table { text-align: center; width: 100%; } Group 1 Type 1 Probability Val 1 .50 Val 2 .94 Val 3 .80 Group 2 Type 2 Probability Val 1 .54 Val 2 .49 Val 3 .32 Group 3 Type 3 Probability Val 1 .11 Val 2 .18 Val 3 .72
tagged with: javascript
tagged with: jquery
score: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47964811
favorite count: 0
has comment: http://stackoverflow.com/comment/47965805
type: UnansweredQuestion
has title: For-each inside of For-each inside...undetermined number of For-each loops
upvote count: 1
tagged with: css
has comment: http://stackoverflow.com/comment/47965145
has comment: http://stackoverflow.com/comment/47966051
answer count: 0
has comment: http://stackoverflow.com/comment/47965229
downvote count: 1

http://stackoverflow.com/comment/47989257
type: QuestionComment
score: 2
has text: Define _'weird issues'_
comment on: http://stackoverflow.com/q/29933555
type: Comment

http://stackoverflow.com/comment/48016899
type: Comment
has text: parseInt() would work too, since the possible values are 0 and 1.
score: 0
comment on: http://stackoverflow.com/q/29947636
type: QuestionComment

http://stackoverflow.com/comment/48024518
comment on: http://stackoverflow.com/a/29950333
has text: If it's a single field, try isNan or shorten my regex to `^-?\d+(?:\.?\d*)$`. Explosion Pills' regex ought to work as well but will capture the decimal as an additional field, which is wonky.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/29975755
has body: Bind a new click event to the element in question. To re-enable the submit button, remove the event (not shown). Don't know if this is the best option, and would like comments (or even markdowns if a good comment is provided with it). https://jsfiddle.net/fndnu5m0/7/ $(function() { $('#name').editable({ type: 'text', title: 'Name', url: '/echo/json/', pk: 123, inputclass: 'autocomplete' }). on('shown', function(event, edit) { console.log('on', this, edit) $(document).find('input.autocomplete').val('') .parent().next().find('button.editable-submit').css('opacity', 0.3) .bind('click',function(){return false;}); }); });
answers question: http://stackoverflow.com/q/29957783
score: 1
upvote count: 1
type: Answer
downvote count: 0

http://stackoverflow.com/q/29944289
tagged with: cucumber
tagged with: phantomjs
has answer: http://stackoverflow.com/a/30031248
tagged with: javascript
upvote count: 1
answer count: 1
favorite count: 0
has title: Get css value with phantom js
has body: I am using Cucumber and Capybara to run some automation tests with chrome and I have an option to run them headless with phantom js I am trying to get the background-image url value and can achieve this with element :errorContainer, "body.error .message-container" alert = people_form.errorContainer.native.css_value('background-image') This will return the url, however this fails when running my tests using phantom js as i get NoMethodError: undefined method `css_value' for #&lt;Capybara::Poltergeist::Node tag="div"&gt; How can i get the background-image url here please Thanks
tagged with: css
downvote count: 0
type: UnansweredQuestion
score: 1
type: Question

http://stackoverflow.com/a/29998374
upvote count: 2
answers question: http://stackoverflow.com/q/29998179
has body: RouterJS and HistoryJS look like they might do what you're looking for.
downvote count: 0
type: Answer
score: 2

http://stackoverflow.com/a/29886534
downvote count: 0
has comment: http://stackoverflow.com/comment/47977290
accepted answer of: http://stackoverflow.com/q/29886489
has comment: http://stackoverflow.com/comment/47899520
has comment: http://stackoverflow.com/comment/47899533
has body: I tried a simpler approach: var str = "HELLO"; var letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; var strArray = str.split(''); var lettersArray = letters.split(''); for (var i = 0; i &lt; 3; i++) { var pos1 = Math.round(Math.random() * (str.length - 1)); var pos2 = Math.round(Math.random() * (letters.length - 1)); strArray[pos1] = lettersArray[pos2]; } alert(strArray.join("")); DEMO: https://jsfiddle.net/erkaner/r1zd7rsw/7/
has comment: http://stackoverflow.com/comment/47977544
upvote count: 2
has comment: http://stackoverflow.com/comment/47914893
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47985304
has comment: http://stackoverflow.com/comment/47976788
has comment: http://stackoverflow.com/comment/47986051
has comment: http://stackoverflow.com/comment/47976717
has comment: http://stackoverflow.com/comment/47977053
type: Answer
answers question: http://stackoverflow.com/q/29886489
has comment: http://stackoverflow.com/comment/47976484
score: 2

http://stackoverflow.com/comment/48026697
type: Comment
comment on: http://stackoverflow.com/a/29952783
score: 1
type: AnswerComment
has text: You could do that in CSS with transitions as well - no javascript needed apart from toggling the class to open it.

http://stackoverflow.com/comment/48048826
type: Comment
has text: I just edit it look at https://www.hobbytronics.co.uk/image/data/tutorial/raspberry-pi/gpio-pinout-bplus.jpg
comment on: http://stackoverflow.com/a/29964322
type: AnswerComment
score: 0

http://stackoverflow.com/q/29942027
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29942076
has title: Query if else if else check true?
type: Question
accepted answer: http://stackoverflow.com/a/29942112
tagged with: if-statement
tagged with: javascript
score: 0
answer count: 2
tagged with: jquery
has answer: http://stackoverflow.com/a/29942112
possible better answer: http://stackoverflow.com/a/29942076
has body: Hello i want to check if a div has the class active. the first item works, after that it stops. Can someone tell me how to fix this? (Its a slider, so it has to work not on click.) It slides automatic. http://i61.tinypic.com/28h2zb6.jpg &lt;script&gt; $(document).ready(function () { if ($('#211').hasClass('item active')){ $('.vandaag').css("background-color", "blue"); console.log("werkt1!");} else if ($('#218').hasClass('item active')){ $('.vandaag').css("background-color", "#005993"); console.log("werkt2!");} else if ($('#219').hasClass('active')){ $('.vandaag').css("background-color", "#005993"); console.log("werkt3!");} }); &lt;/script&gt; the number is the id of the image slider. and the .item .active is when the slide is active. Greetz

http://stackoverflow.com/q/30000698
score: -1
type: Question
has title: Optimize looping through 2 arrays javascript canvas game
answer count: 2
tagged with: canvas
tagged with: arrays
tagged with: javascript
possible better answer: http://stackoverflow.com/a/30001158
has body: I'm working on my first javascript canvas game, and I wonder is there a better way for comparing collisons between objects in 2 arrays. For example i have an array with rockets, and array with enemies, the code is working, but i think when arrays length becomes much larger it will have effect on the performance. Example 100 rockets through 100 enemies is 10000 iterations per frame for (i in rockets){ rockets[i].x+=projectile_speed; for (j in enemies){ if(collision(rockets[i], enemies[j])){ enemies[j].health-=5; sound_hit[hit_counter-1].play(); hit_counter--; if (hit_counter==0){ hit_counter=5; } rockets.splice(i,1); if (enemies[j].health &lt;= 0) { score += enemies[j].score; sound_explode[Math.floor(Math.random()*25)].play(); enemies[j].isDead = true; } } else if(rockets[i].x &gt;= width){ rockets.splice(i,1); } } }
favorite count: 0
has comment: http://stackoverflow.com/comment/48121752
has answer: http://stackoverflow.com/a/30001158
downvote count: 1
accepted answer: http://stackoverflow.com/a/30001050
upvote count: 0
has answer: http://stackoverflow.com/a/30001050
type: AnsweredQuestion

http://stackoverflow.com/comment/91907684
comment on: http://stackoverflow.com/a/38777177
type: AnswerComment
has text: +1, I think "There is no meaningful way to implement the iteration protocols for objects, because not every object is a collection." sums it up.
score: 4
type: Comment

http://stackoverflow.com/q/29973664
has answer: http://stackoverflow.com/a/29976995
tagged with: web-scraping
type: AnsweredQuestion
has body: I'm very new to HtmlUnit and I'm trying to scrape a website that uses Javascript to edit the code. I heard HtmlUnit was the best way to go as it returns the final code using a headless browser. However as you will see I cannot even get past creating a HtmlPage object without getting a huge and impossible to understand exception thrown (at least given my virtually null experience with HtmlUnit). Here is my code: import com.gargoylesoftware.htmlunit.*; import com.gargoylesoftware.htmlunit.html.HtmlPage; public class Main { public static void main(String[] args) { Main scraper = new Main(); scraper.testingGargoyle(); } private void testingGargoyle() { String myUrl = "https://www.wearvr.com/#game_id=game_4"; WebClient webClient = new WebClient(); try { HtmlPage myPage = ((HtmlPage) webClient.getPage(myUrl)); } catch (FailingHttpStatusCodeException | IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } And this is the exception that gets thrown : Apr 30, 2015 5:43:50 PM com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify WARNING: Obsolete content type encountered: 'application/x-javascript'. Apr 30, 2015 5:43:50 PM com.gargoylesoftware.htmlunit.javascript.StrictErrorReporter runtimeError SEVERE: runtimeError: message=[The data necessary to complete this operation is not yet available.] sourceName=[https://load.sumome.com/] line=[1] lineSource=[null] lineOffset=[0] Exception in thread "main" ======= EXCEPTION START ======== EcmaError: lineNumber=[19] column=[0] lineSource=[&lt;no source&gt;] name=[TypeError] sourceName=[https://www.wearvr.com/assets/scripts/bundle.b4038a088bb1abfcf55c.js] message=[TypeError: Cannot find function bind in object function (e, n, r) {...}. (https://www.wearvr.com/assets/scripts/bundle.b4038a088bb1abfcf55c.js#19)] com.gargoylesoftware.htmlunit.ScriptException: TypeError: Cannot find function bind in object function (e, n, r) {...}. (https://www.wearvr.com/assets/scripts/bundle.b4038a088bb1abfcf55c.js#19) at…
type: Question
possible better answer: http://stackoverflow.com/a/29976995
answer count: 2
has answer: http://stackoverflow.com/a/29977703
accepted answer: http://stackoverflow.com/a/29977703
tagged with: htmlunit
downvote count: 0
tagged with: javascript
score: 4
has title: HtmlUnit not creating HtmlPage object
tagged with: http://stackoverflow.com/tag/html
upvote count: 4
tagged with: headless-browser
favorite count: 0

http://stackoverflow.com/a/29914093
accepted answer of: http://stackoverflow.com/q/29914054
type: Answer
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/29914054
type: AcceptedAnswer
downvote count: 0
has body: I think you can get the contents of the p element with class title inside the #headline element var title = document.querySelector('#headline .title').innerHTML Demo: Fiddle

http://stackoverflow.com/q/29857488
has comment: http://stackoverflow.com/comment/47868744
tagged with: javascript
tagged with: angularjs-scope
upvote count: 2
has comment: http://stackoverflow.com/comment/47879386
tagged with: angularjs-ng-repeat
favorite count: 0
has comment: http://stackoverflow.com/comment/47868778
tagged with: angularjs
has title: AngularJS ng-repeat not rendering $resource
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47843141
score: 2
has comment: http://stackoverflow.com/comment/47840968
answer count: 0
downvote count: 0
has comment: http://stackoverflow.com/comment/47841198
type: Question
has body: I'm working on an Angular app that includes a user feed page, one of the items on the feed is a list of groups that the user belongs to. The groups are pulled from the backend through a $resource call that accepts the user id as parameters. The issue I am facing is that allGroups (the collection returned by the $resource call) is available in the $scope but is not rendering on the page. Here is the controller that is setting the groups variable: angular.module('kickitAngularFrontendApp') .controller('UserCtrl', function ($timeout, $scope, User, $rootScope) { $timeout(function() { User.allGroups.query({user_id: $rootScope.user.id}, function(data) { $scope.allgroups = data; }) }, 130); }); Here is the User factory angular.module('kickitAngularFrontendApp') .factory('User', function ($resource) { return { allGroups: $resource('http://localhost:3000/api/users/:user_id/get_groups', { query: { method: 'GET', params: {}, isArray: false } }), groupsCreated: $resource('http://localhost:3000/api/users/:id/get_groups_created', { query: { method: 'GET', params: {}, isArray: false } }), allEvents: $resource('http://localhost:3000/api/users/:id/get_events', { query: { method: 'GET', params: {}, isArray: false } }), eventsCreated: $resource('http://localhost:3000/api/users/:id/get_events_created', { query: { method: 'GET', params: {}, isArray: false } }), }; }); Here is the view that is rendering the groups Group Feed I can see that the allGroups object is attached to the UserCtrl $scope and view it with ng-inspector but it will not render on the page. My thought is that because the $resource request requires the id of the $rootScope.user object which is set after the page loads it is not available to be rendered. If this is indeed the case, how would I go about solving it? Any help is greatly appreciated. Also, I am using Angular ui-router if that helps.
tagged with: angular-ui-router
has comment: http://stackoverflow.com/comment/47854473

http://stackoverflow.com/a/29958138
upvote count: 7
has body: Most modern browsers automatically send in a high-precision timestamp as an argument into each requestAnimation callback loop: http://caniuse.com/#search=performance So you simply subtract the last timestamp from the current timestamp to get the elapsed time since the loop was last run. 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 startingTime; var lastTime; var totalElapsedTime; var elapsedSinceLastLoop; var $total=$('#total'); var $loop=$('#loop'); requestAnimationFrame(loop); function loop(currentTime){ if(!startingTime){startingTime=currentTime;} if(!lastTime){lastTime=currentTime;} totalElapsedTime=(currentTime-startingTime); elapsedSinceLastLoop=(currentTime-lastTime); lastTime=currentTime; $total.text('Since start: '+totalElapsedTime+' ms'); $loop.text('Since last loop: '+elapsedSinceLastLoop+' ms'); requestAnimationFrame(loop); } body{ background-color: ivory; } #canvas{border:1px solid red;} T1 T2 For the couple of browsers that don't support Performance, you will have to use Date.now() instead of currentTime inside the loop since no timestamp is automatically sent by those browsers into the loop.
downvote count: 1
has comment: http://stackoverflow.com/comment/48037282
accepted answer of: http://stackoverflow.com/q/29957819
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29957819
has comment: http://stackoverflow.com/comment/48038157
type: Answer
score: 6

http://stackoverflow.com/a/29861765
answers question: http://stackoverflow.com/q/29860883
has body: Suppose we have a turtle that has drawn one segment of an n-sided regular polygon by moving from x1, y1 to x2, y2. To draw the remaining sides, we do this n-1 times: turn by a certain angle move forward a certain distance The angle that we have to turn is 360/n degrees. For example, if we're drawing a triangle, the turtle has to turn 120 degrees after each segment. If we're drawing the triangle clockwise, we subtract 120 degrees from the current orientation of the turtle. If we're drawing it counterclockwise, we add 120 degrees. The distance to move forward is the length of the first segment. We can calculate the length of the segment using the Pythagorean theorem. In JavaScript, we can implement it thus: var dx = x2-x1, dy = y2-y1, length = Math.sqrt(dx*dx + dy*dy); The initial orientation of the turtle is the same as the angle of the first line segment, which we can calculate by taking the inverse cosine of dx/length: var angle = Math.acos(dx/length); if (dy &lt; 0) { angle = 2*Math.PI - angle; } To make use of the turning angle and segment length, we have to implement the following turtle operations: set a turtle position x, y set a turtle orientation angle move the turtle distance units forward in its current orientation add delta to the turtle orientation query the current position x, y of the turtle After those operations are implemented, we can write a loop that iterates n-1 times. In each iteration, we turn and move forward by the prescribed amounts, query the turtle position, and print the coordinates. To implement the turtle operations, we have to store the position and orientation of the turtle. Here is an easy way to do so: var turtle = { x: 0, y: 0, angle: 0 }; To move the turtle distance units forward in its current orientation, we use basic trigonometry: turtle.x += Math.cos(turtle.angle) * distance; turtle.y += Math.sin(turtle.angle) * distance; Note that the trigonometric functions in JavaScript work with radians rather than degrees. There are 2&pi;…
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47869143
type: Answer
has comment: http://stackoverflow.com/comment/48080175
downvote count: 0
has comment: http://stackoverflow.com/comment/47869416
has comment: http://stackoverflow.com/comment/47997668
score: 3
accepted answer of: http://stackoverflow.com/q/29860883
upvote count: 3

http://stackoverflow.com/q/29936248
answer count: 1
has title: How to Debug IE8 "Abort Script Execution?" Alert
accepted answer: http://stackoverflow.com/a/29936404
has answer: http://stackoverflow.com/a/29936404
type: AnsweredQuestion
tagged with: internet-explorer-8
has body: The website runs well on all modern browsers. However, we try to achieve (for the moment) IE8 compatibility. Now, we get the following error alert: Abort script execution? The scripts loaded might slow down...etc [Yes] [No] How can I find out which script is causing this? Thank you
type: Question
tagged with: debugging
tagged with: javascript
score: 0

http://stackoverflow.com/comment/47953060
type: QuestionComment
has text: you could use `setTimeout` ? But I don't want to support your spammy malicious interests! :)
score: 1
comment on: http://stackoverflow.com/q/29915700
type: Comment

http://stackoverflow.com/q/29983585
has comment: http://stackoverflow.com/comment/48086726
upvote count: 2
has title: Unexpected scoping issue when assigning click listener
type: Question
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29983636
has body: When my loadNav() function loops through the nav array and assigns a click listener to a dynamically-created element, all seems well. If I break on the first loop through the navItem.id is 'newGL' and the second time through it is 'litGL', as it should be. But when I check the listeners after the loop is done, they both have an id of 'litGL' (and also a type of 'b'). But the elements themselves have the correct navItem.text, so I guess I’m not understanding how variables are assigned within the passed function to the .click method. Any hints why my first click listener is getting overwritten with the values meant for the second one? var nav = [ { id:'newGL', text:'new', type:'a' }, { id:'litGL', text:'lit', type:'b' } ] function loadNav(nav){ for(item in nav){ var navItem = nav[item]; var element = $("&lt;div&gt;" + navItem.text + "&lt;/div&gt;"); element.click(function(){ getContent(navItem.id,navItem.type); //in practice I'm getting two click listeners with a navItem.id of 'litGL' and a navItem.type of 'b' }); $('#horzNav').append(element); } }
answer count: 2
score: 2
downvote count: 0
possible better answer: http://stackoverflow.com/a/29983633
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29983633
favorite count: 0
tagged with: scope
has answer: http://stackoverflow.com/a/29983636

http://stackoverflow.com/q/29925431
has answer: http://stackoverflow.com/a/46157887
favorite count: 0
has title: ChartJS - Draw chart with label by month, data by day
type: UnansweredQuestion
score: 22
has comment: http://stackoverflow.com/comment/47980224
has answer: http://stackoverflow.com/a/48301453
type: Question
has body: I'd like to draw a line chart by Chartjs with data by day, but label by month. If label is displayed by day, then there are a lot of points. So, I'd like to display label by month instead of by day. For example: Someone could teach me how to do that? Thank you.
tagged with: chart.js
tagged with: javascript
has answer: http://stackoverflow.com/a/43529671
upvote count: 22
answer count: 3
downvote count: 0

http://stackoverflow.com/q/29931548
has comment: http://stackoverflow.com/comment/47985649
has title: Chrome Browser Extension Load Dynamic Content From Default Popup Ppage
favorite count: 0
has comment: http://stackoverflow.com/comment/47985509
answer count: 0
type: UnansweredQuestion
upvote count: 1
downvote count: 1
has body: I am struggling how to display dynamic or external content from popup.html in Chrome browser. My manifest.json looks like: { "name": "New Extension", "manifest_version": 2, "version": "0.1", "description": "My new Chrome extension", "icons": { "16": "name.png" }, "options_page": "option.html", "browser_action": { "default_icon": "icon.png", "default_title": "New Extension", "default_popup": "popup.html" }, "permissions": ["&lt;all_urls&gt;"] } Right now my popup.html looks like &lt;html&gt; &lt;body&gt; show dynamic/externally loaded content here &lt;/body&gt; &lt;/html&gt; Obviously that is incorrect/incomplete. What are my options, can I "link through" the dynamic content? I do not think I want to use IFRAME, but what about AJAX? How can this be accomplished? Any help appreciated. Thank you in advance.
has comment: http://stackoverflow.com/comment/47985780
type: Question
tagged with: javascript
tagged with: ajax
has comment: http://stackoverflow.com/comment/47985721
score: 0
tagged with: google-chrome-extension
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/a/29971755
score: 0
upvote count: 1
type: AcceptedAnswer
downvote count: 1
has body: The following code will find the index of the value you are looking for. This will return -1 if the value is not in the array. Taken from this SO post. I just added the alert at the end. var myArray = [0,1,2] could become var myArray = localValues; in your case, then you can set needle to the value you are looking for. var indexOf = function(needle) { if(typeof Array.prototype.indexOf === 'function') { indexOf = Array.prototype.indexOf; } else { indexOf = function(needle) { var i = -1, index = -1; for(i = 0; i &lt; this.length; i++) { if(this[i] === needle) { index = i; break; } } return index; }; } return indexOf.call(this, needle); }; var myArray = localValues, needle = 3, index = indexOf.call(myArray, needle); // 1 alert(index); EDIT: Noticed a bit late that you may be looking for the KEY in the array. function GetObjectKeyIndex(obj, keyToFind) { var i = 0, key; for (key in obj) { if (key == keyToFind) { return i; } i++; } return null; } // Now just call the following GetObjectKeyIndex(localValues, "localProductCode"); The above snippet returns an ID if it exists, or null if no key with such a name can be found.
type: Answer
has comment: http://stackoverflow.com/comment/48063469
accepted answer of: http://stackoverflow.com/q/29971595
answers question: http://stackoverflow.com/q/29971595

http://stackoverflow.com/a/29893893
answers question: http://stackoverflow.com/q/29893629
has comment: http://stackoverflow.com/comment/47913279
has body: Yes, use the vw and vh CSS properties. 1vw = 1% of window width, 1vh = 1% of window height. http://demosthenes.info/blog/660/Using-vw-and-vh-Measurements-In-Modern-Site-Design
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/47918947

http://stackoverflow.com/comment/48051323
comment on: http://stackoverflow.com/q/29965525
type: Comment
type: QuestionComment
score: 0
has text: @tanya inside only local stage: [fiddle](https://jsfiddle.net/mdx20uqe/7/).

http://stackoverflow.com/q/29924932
tagged with: collections
type: Question
has answer: http://stackoverflow.com/a/73423106
tagged with: ecmascript-6
accepted answer: http://stackoverflow.com/a/29926193
has answer: http://stackoverflow.com/a/70222738
tagged with: javascript
possible better answer: http://stackoverflow.com/a/29924964
upvote count: 28
has answer: http://stackoverflow.com/a/29924964
has answer: http://stackoverflow.com/a/59831840
downvote count: 0
score: 28
favorite count: 0
answer count: 5
has answer: http://stackoverflow.com/a/29926193
has title: How to reliably check an object is an EcmaScript 6 Map/Set?
tagged with: dictionary
type: AnsweredQuestion
has body: I just want to check that an object is a Map or Set and not an Array. to check an Array I'm using lodash's _.isArray. function myFunc(arg) { if (_.isArray(arg)) { // doSomethingWithArray(arg) } if (isMap(arg)) { // doSomethingWithMap(arg) } if (isSet(arg)) { // doSomethingWithSet(arg) } } If I were to implement isMap/isSet, what does it need to look like? I'd like for it to be able to catch subclasses of Map/Set if possible as well.
tagged with: set

http://stackoverflow.com/a/29898826
has body: You are mixing Angular and jQuery, and that's the slippery slope to Hell :) (ok, caveat: directives, but that's a different story). If you find yourself about to write jQuery in your controller then alarm bells should ring that you are breaking the MVC separation and missing something simpler. The trick here is to make your ng-show conditional on whether the current item being rendered is the selected one. To detect that, make a note in your scope of the selected index. Like so ... HTML view: Name: {{thing.name}} Delete JS controller: $scope.selectedIndex = -1; $scope.selectthing = function(idx) { $scope.selectedIndex = idx; . . . // do some awesome stuff with the selected thing. }
upvote count: 2
answers question: http://stackoverflow.com/q/29897555
has comment: http://stackoverflow.com/comment/77058655
type: Answer
score: 2
downvote count: 0

http://stackoverflow.com/q/29900221
has comment: http://stackoverflow.com/comment/47929891
downvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/47923302
has answer: http://stackoverflow.com/a/29906677
tagged with: meteor
has body: Meteor each loop data taking too much time to load. While its loading displays stop script error. Please help me how to solve this issue. Please find the code. {{#each list_data}} {{#each arr}} {{#if isSelected material_id ../material_id}} {{description}} {{else}} {{ description }} {{/if}} {{/each}} {{/each}} Template.list.isSelected = function(fooToCheck, recordFoo) { if(recordFoo == null) { return false; } else { return (fooToCheck == recordFoo); } };
score: 2
has comment: http://stackoverflow.com/comment/47923194
upvote count: 2
type: UnansweredQuestion
has title: Meteor each loop loading takes so much time
type: Question

http://stackoverflow.com/comment/47982940
type: AnswerComment
comment on: http://stackoverflow.com/a/29925336
score: 0
type: Comment
has text: There must be something in your page - or your browser does not like the same name, ID and function name - I changed the function name to heute

http://stackoverflow.com/q/29858721
upvote count: 3
tagged with: minify
has body: What's the best practice for minifying and bundling js/css in a pure front end app, and how do the tools work? I know how this can be done with server side apps like .NET/Java/LAMP/etc. But what about pure front end projects, SPA projects or backendless projects that are built with say, ember or angular these days? Say your entire project consists of HTML/css/js, which interfaces with a RESTful service elsewhere. What kind of process or tool do you use to minify and bundle the resources for that? I've seen grunt plugins that exist for this, but I find the documentation to be pretty magical and it's still unclear to me how they work. Specifically, does the tool: 1) Replace src="/js/a.js",src="/js/b.js" with src="/js/bundle-a+b.min.js"? (and likewise with css?) in the source html files? 2) have different modes for dev and release, or is the tool only run when the project is released? Or are the resource requests entirely managed by a js tool and js/css files have to be requested via a library function? Wouldn't the lag be noticeable in this case? Thanks.
tagged with: css
favorite count: 0
downvote count: 0
type: AnsweredQuestion
score: 3
has answer: http://stackoverflow.com/a/29858798
accepted answer: http://stackoverflow.com/a/29858798
type: Question
has title: How do front end devs bundle and minify files?
answer count: 1
tagged with: javascript

http://stackoverflow.com/comment/48453236
type: Comment
has text: Not `<image>`, its the ` `, and just to test how was done the final form. And Yes, both examples works, but id prefer the second one.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/30135485

http://stackoverflow.com/comment/48016760
has text: @HydraCles if you want to keep your html structure then you can use this: `$('#nav a:first-child').click(function() { $('#hidden').slideDown(1000); });`
type: AnswerComment
comment on: http://stackoverflow.com/a/29947795
type: Comment
score: 0

http://stackoverflow.com/comment/47859697
type: Comment
type: QuestionComment
has text: maybe it is about utf8 ?
comment on: http://stackoverflow.com/q/29867370
score: 0

slick.js
tag name: slick.js
type: Tag
tags question: http://stackoverflow.com/q/29993601
tags question: http://stackoverflow.com/q/29901228
tags question: http://stackoverflow.com/q/29880735

http://stackoverflow.com/a/29981936
upvote count: 11
answers question: http://stackoverflow.com/q/29981895
type: Answer
score: 11
downvote count: 0
has body: First of all, look closely at the usage of this construction: mod(3)(9); You can split it into two steps: var fn = mod(3); fn(9); From here is it obvious that mod(3) alone must return a new function so that later it could be invoked again. This new function needs to preserve the value passed in with the first invocation. This is the key part: you should store that value in the closure (well it's stored automatically due to nature of closures): function mod(x) { return function(y) { return y % x; }; } Here comes good illustration of the term "closure". If someone asks you (on interview, for example) you may say: closure is the function with the scope it was originally created in. So in the function above, new inner function always has internal access to the outer function parameter x.

http://stackoverflow.com/q/29970839
has answer: http://stackoverflow.com/a/29974200
tagged with: javascript
answer count: 2
possible better answer: http://stackoverflow.com/a/29971603
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/29971603
favorite count: 0
accepted answer: http://stackoverflow.com/a/29974200
has body: I am a beginner with node so excuse me if this question is too obvious. Also I tried the official documentation but I could resolve this problem. My node server is communicating with an external api through a service. This is what I ve got so far in my service api-service.js : var http = require('http'); exports.searchNear = function(lat, long, next){ var options = { host: '1xx.xx.1xx.1x', path: '/api/v1/geo, method: 'GET' }; var req = http.request(options, function(res) { var msg = ''; res.setEncoding('utf8'); res.on('data', function(chunk) { msg += chunk; }); res.on('end', function() { console.log(JSON.parse(msg)); }); }); req.on('error', function(err) { // Handle error }); req.write('data'); req.end(); var mis = 'hello'; next(null, mis); } At this moment I can get the Json and log it in the console. But I want to store the returned json in a variable so I could pass in the next() callback. I tried to add a callback to the end event like: exports.searchNear = function(lat, long, next){ .... ..... var req = http.request(options, function(res) { ..... res.on('end', function(callback) { console.log(JSON.parse(msg)); callback(msg); }); }); .... req.end('', function(red){ console.log(red); }); } Thank you in advance.
tagged with: node.js
type: AnsweredQuestion
has title: http request get body
tagged with: http://stackoverflow.com/tag/json
upvote count: 1
tagged with: http
type: Question

http://stackoverflow.com/q/29903636
tagged with: automation
has body: I need your help, How do I go about amending the javascript code below such that, I would be able to not have an empty table row at the end of my table that was generated dynamically using the MS Word Automation? Noted that the recordset that was executed only has (8) records in it. So somewhere in this code, a row is being auto tacked on? I've attached a screenshot of the problem: The code used below is from my HTA application: function test() { var wordApp = new ActiveXObject("Word.Application") var doc = wordApp.Documents.Add() var col doc.Tables.Add(Range=doc.Range(0, 0), numrows=1, numcolumns=2) doc.Tables(1).Borders.Enable = true row = 1 col = 0 while (!rs.eof) { col = col + 1 alert(row) if (col = 1) { doc.Tables(1).Cell(row,1).Range.Text = rs.Fields("firstname").value col = col + 1 rs.movenext } if (col = 2) { doc.Tables(1).Rows.Add() doc.Tables(1).Cell(row,2).Range.Text = rs.Fields("firstname").value col = 1 rs.movenext } row++ } wordApp.Visible = true wordApp.Activate(); //wordApp.WindowState = 1 }
downvote count: 0
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/29904272
answer count: 1
has title: How do you get rid of the last empty table row using MS Word Automation
tagged with: ms-word
type: UnansweredQuestion
upvote count: 1
score: 1
tagged with: hta
type: Question

http://stackoverflow.com/a/29856941
type: Answer
has comment: http://stackoverflow.com/comment/47841085
score: 3
upvote count: 3
has body: text = text.replace(" \n", '****************'); text = text.replace("\n", ' '); text = text.replace('****************', " \n"); Is this what you're after? Doesn't use regex, but its a bit simpler of a procedure.
accepted answer of: http://stackoverflow.com/q/29856784
has comment: http://stackoverflow.com/comment/47840663
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/29856784

http://stackoverflow.com/a/29847456
accepted answer of: http://stackoverflow.com/q/29846423
has body: Where am I wrong or what piece am I missing? That A does not inherit from A.prototype. A is a (constructor) function, and inherits from Function.prototype. Do a console.log(Object.getPrototypeOf(A)) :-) From A.prototype only new A instances do inherit (whose .constructor is A). See also __proto__ VS. prototype in JavaScript.
type: Answer
answers question: http://stackoverflow.com/q/29846423
score: 5
upvote count: 5
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/29958747
has answer: http://stackoverflow.com/a/29959946
has title: Why can't I find app.locals in jade
tagged with: node.js
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29959946
type: Question
has body: I'm working with express/node/jade and have build a module for some variables. I have this line in my app.js app.locals.GVs = require('./utils/globalvars.js'); and this is my jade extends ../layout block content h1 Edit - Change Your Profile p There will hopefully be a form to change users here. form(id='form',action='') include ./includes/user-form.jade input(type='reset', value='Clear') input(type='submit', value='Update') script. //Wait for document to load. $(document).ready(function(){ $('#firstname').val('#{data.firstname}'); $('#lastname').val('#{data.lastname}'); $('#username').val('#{data.username}'); $('#phone').val('#{data.phone}'); $('#email').val('#{data.email}'); //Once form is submitted thisUserData (UserData) is created. $('#form').submit(function(){ // creates the variable thisUserData as a new UserData. var thisUserData = new GVs.UserData($('#firstname').val(), $('#lastname').val(), $('#username').val(), $('#password').val(), $('#confirmpassword').val(), $('#phone').val(), $('#email').val()); //POST call; Sends thisUserData and alerts that a user was updated. $.post('/user/edit', {userFormData: thisUserData}, function(data){ alert("User updated!"); }); }); }); I get an error on when I call GVs var thisUserData = new GVs.UserData(...); I also tries passing it the same way i did with "data" but it did the same thing. EDIT: I tried to see if I could get GVs in the jade file like so p There will hopefully be a form to change users here. became this p There will hopefully be a form to change users here. '#{GVs.UserData}' and its there, why can I get it in jade but not in script.?
tagged with: javascript
tagged with: express
score: 0
tagged with: pug
answer count: 1

http://stackoverflow.com/comment/48072338
score: 0
type: AnswerComment
has text: @SterlingArcher - if a ` ` element has no type, then like an ` ` with no type, it also defaults to submit. But there's no button in the question or this answer.
type: Comment
comment on: http://stackoverflow.com/a/29976303

http://stackoverflow.com/a/29956204
score: 0
has body: To explain this simply. They're two types of elements jQuery Elements and JavaScript Elements. this is a JavaScript element. jQuery functions only work with jQuery Elements. So to make it work, use: $(this).myjQueryFunction(); so for you: $(this).children(); In depth When creating jQuery elements using $(), it does a few things. jQuery uses Sizzle for selecting elements. If what's passed into $() is already an element. It doesn't do anything. Of it is, it will turn it into an element. Depending on which of the two jQuery uses. It will return an element. This is a regular JavaScript element but what makes it so special? The jQuery functions can only be run after $. The reason is how you create chained-JavaScript functions using prototype: //Kind of how it's created $.prototype.children = function () { //jQuery's code to get children } This is making it so children() can only be run off of $.
has comment: http://stackoverflow.com/comment/48033636
has comment: http://stackoverflow.com/comment/48033402
type: Answer
answers question: http://stackoverflow.com/q/29956151

http://stackoverflow.com/a/51993487
type: Answer
has body: To preserve the settings of select2, use this code instead of the accepted solution : $('#my-select').off('change.mychange').on('change.mychange', function () { //your code }); You don't need to reinstatiate the .select2(). It's unnecessary and also shorter.
score: 0
answers question: http://stackoverflow.com/q/29933721

http://stackoverflow.com/q/29876626
linked to: http://stackoverflow.com/q/14220321
favorite count: 0
has comment: http://stackoverflow.com/comment/47877984
has answer: http://stackoverflow.com/a/29876662
linked to: http://stackoverflow.com/q/23667086
duplicate of: http://stackoverflow.com/q/14220321
linked to: http://stackoverflow.com/q/15764844
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29876662
upvote count: 1
type: Question
has body: Here's my problem I have a JSON file full of country codes, and a function that gets a random country code, like this: function getRandomCountryCode(specificMap){ $.getJSON('../maps/' + specificMap + '.json', function( data ) { var countries = []; for (var i in data.country) { countries.push(data.country[i].code); } var rndCountryCode = countries[Math.floor(Math.random()*countries.length)]; return rndCountryCode; }); }; In another function, I call the above function and try to store the rndCountryCode variable into another variable so it's available inside the new function. function loadMap(map){ var specificMap = map; var y = getRandomCountryCode(specificMap); console.log("Y is : " + y); } All I get is undefined. I did a lot of research (here and here and especially here) and realized this is because of asynchronous nature of $.getJSON, and that I should use callbacks but for the life of me I can't figure it out. Thanks for all your help.
tagged with: javascript
has title: $.getJSON return value to variable
downvote count: 0
answer count: 1
score: 1
tagged with: jquery
tagged with: asynchronous
tagged with: callback

http://stackoverflow.com/comment/47837766
type: Comment
comment on: http://stackoverflow.com/a/29855867
type: AnswerComment
has text: the .gameBox-Ops at the end is the class of the container I am trying to call with AJAX
score: 0

http://stackoverflow.com/comment/47938667
has text: No, there's no built-in Javascript function for this.
type: Comment
type: QuestionComment
score: 2
comment on: http://stackoverflow.com/q/29908121

http://stackoverflow.com/comment/47935870
type: Comment
comment on: http://stackoverflow.com/a/29906503
type: AnswerComment
has text: It looks like someone else has just posted an example of this!
score: 0

http://stackoverflow.com/q/29973559
tagged with: javascript
has comment: http://stackoverflow.com/comment/48066870
upvote count: 0
has body: Would anybody be so kind to tell me where the problem is? I want to encode and decode an simple input, but it does not work! Why? Thank you for your help ;) ENCODE: function codeschutz_encode(s, delta) { var temp = ""; var alt, neu; for(var i = 0; i < s.length; i++) { alt = s.charCodeAt(i); if(alt >= 65 && alt <= 90) { neu = alt + delta; if(neu > 90) { neu -= 26; } } else if (alt >= 97 && alt <= 122) { neu = alt + delta; if (neu > 122) { neu -= 26; }; } else { neu = alt; } temp += String.formCharCode(neu); } return temp; } DECODE: function codeschutz_decode(s, delta) { var temp = ""; var temp, neu; for (var i = 0; i < s.length; i++) { alt = s.CharCodeAt(i); if (alt >= 65 && alt <= 90) { neu = alt - delta; if (neu < 65) { neu += 26; } } else if (LT >= 97 && alt <= 122) { neu = alt - delta; if (neu < 97) { neu += 26; } } else { neu = alt; } temp += String.formCharCode(neu); } return temp; } HTML: I created a textarea for the input and a textare for the output verschlüsseln |
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/48066946
answer count: 1
has comment: http://stackoverflow.com/comment/48066985
favorite count: 0
tagged with: encode
downvote count: 2
has answer: http://stackoverflow.com/a/29973821
tagged with: css
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/48067105
has comment: http://stackoverflow.com/comment/48067256
has title: javascript encode - decode problems
type: Question
tagged with: decode
score: -2
accepted answer: http://stackoverflow.com/a/29973821

http://stackoverflow.com/comment/47855206
has text: According to [§11.2.1 Property Accessors](http://www.ecma-international.org/ecma-262/5.1/#sec-11.2.1) this should not be necessary because at step 6 the value inside the brackets is stringified with [ToString](http://www.ecma-international.org/ecma-262/5.1/#sec-9.8).
type: AnswerComment
comment on: http://stackoverflow.com/a/29865017
type: Comment
score: 2

http://stackoverflow.com/comment/48016031
comment on: http://stackoverflow.com/q/29947468
score: 0
has text: losing a day = hour difference due to timezones lol.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29922708
upvote count: 1
downvote count: 1
tagged with: meteor
has comment: http://stackoverflow.com/comment/47980232
favorite count: 0
has comment: http://stackoverflow.com/comment/47982420
tagged with: meteor-accounts
has comment: http://stackoverflow.com/comment/47967522
has comment: http://stackoverflow.com/comment/47976971
answer count: 0
has comment: http://stackoverflow.com/comment/47971802
type: UnansweredQuestion
has body: When validating objects for database insert, I would like to access the Meteor.users collection to let the user know if he added an event manager to the event who is stored in the database. I extended the discover meteor book example for my needs. I know of the Meteor Accounts API, but I'm stuck at the moment how to proceed. Here is the Meteor method Meteor.methods({ eventInsert: function(eventAttributes) { check(Meteor.userId(), String); check(eventAttributes, { title: String, shareInPercent: Number, eventDate: Date }); var errors = validateEvent(eventAttributes); if (errors.title || errors.shareInPercent || errors.eventDate) throw new Meteor.Error('invalid-event', "Check your inputs again."); var user = Meteor.user(); var event = _.extend(eventAttributes, { userId: user._id, author: user.username, submitted: new Date() }); var eventId = Events.insert(event); return { _id: eventId }; } }); validateEvent = function (event) { var errors = {}; if (!event.title) errors.title = "Please fill in an event title"; if (!event.eventDate) errors.eventDate = "Please enter a date"; var eventManagersNotExisting = areEventManagersExistingUsers(event.eventManagers); return errors; } areEventManagersExistingUsers = function (eventManagers) { var eventManagersNotExisting = []; _.each(eventManagers, function(eventManager){ var eventManagerFound = Meteor.users.findOne({username: eventManager}); }); return eventManagersNotExisting; } When an insert is triggered, the Meteor method is called, the validateEvent method is called in-between, which calls itself a helper method to check the users collection as seen here var eventManagerFound = Meteor.users.findOne({username: eventManager}); If I'm right and because it should make sense, I can't put console.log() messages in the Meteor method, because the method is executed server side and the message won't appear in the browser console. My first question therefore is, is there a way to look at log messages done on server side, similar to Node,…
has title: How to access Meteor user collection on server and debug correctly
type: Question
linked to: http://stackoverflow.com/q/14346394
tagged with: javascript
has comment: http://stackoverflow.com/comment/47994010
score: 0

http://stackoverflow.com/comment/48072162
comment on: http://stackoverflow.com/q/29976206
type: QuestionComment
type: Comment
score: 1
has text: You're not doing anything to stop the form from being submitted. `return false`?

http://stackoverflow.com/comment/48071957
type: Comment
comment on: http://stackoverflow.com/a/29950571
has text: creating unnecessary thing while you have a directive like `ng-if` thats not good..
score: 0
type: AnswerComment

http://stackoverflow.com/q/29929848
accepted answer: http://stackoverflow.com/a/29995423
upvote count: 4
tagged with: testing
has comment: http://stackoverflow.com/comment/47982021
tagged with: protractor
downvote count: 0
tagged with: javascript
tagged with: end-to-end
has title: Cloning element finders
type: AnsweredQuestion
favorite count: 0
has answer: http://stackoverflow.com/a/29995423
type: Question
has comment: http://stackoverflow.com/comment/65423927
has body: While researching available ElementFinder and ElementArrayFinder methods, I've noticed that there is a clone() method which is briefly documented: Create a shallow copy of ElementFinder. From what I understand, clone() is not coming from WebdriverJS and is a protractor-specific function. What I don't understand is why would you want to clone an element finder or an element finder "array" in your tests? What use cases does clone() cover? I've looked into the protractor source code to find example usages, but found only the underlying change set, which didn't help to have a clear picture.
answer count: 1
score: 4
tagged with: selenium
has comment: http://stackoverflow.com/comment/47982087

http://stackoverflow.com/q/29914631
tagged with: javascript
tagged with: jquery
has body: I know that this is a common question. Long story made short: I would show progress to user during long running script. This is my code/idea: store "progress" in mysql so Ajax can read it (of course via PHP). "progress()" is the "long" running script test: public function startProgress() { $this-&gt;unique = sha1(session_id().uniqid().time()); echo json_encode($this-&gt;unique); $this-&gt;progress(); } public function progress() { for($i=1;$i&lt;=10;$i++) { $this-&gt;progress = $i; $this-&gt;setProgress(); sleep(1); } } private function setProgress() { $progress = array('tot'=&gt;10,'current'=&gt;$this-&gt;progress); $args['service'] = $this-&gt;unique; $args['progress'] = json_encode($progress); $progress_service = New ProgressService(); $progress = $progress_service-&gt;getProgress($args['service']); if ($progress!=null) { $args['id'] = $progress[0]-&gt;id; } $progress_service-&gt;setData($args); } Basically my idea is: 1) Generate an unique string ($this-&gt;unique = sha1(session_id().uniqid().time()); 2) Store for reference (using it in saveData) and encode in JSON and output to the javascript / jquery, so I can use it to launch another script via Ajax to search in database. My issue is that the echo is output only after the end of progress (~ 10 seconds, with $i&lt;10 and sleep(1) ) How I could obtain "immediately" that unique?
tagged with: ajax
score: 0
type: UnansweredQuestion
tagged with: php
has title: PHP+Ajax: get unique string before long running script
type: Question
has comment: http://stackoverflow.com/comment/47951566
has answer: http://stackoverflow.com/a/29918976
answer count: 1

http://stackoverflow.com/a/29849496
downvote count: 0
answers question: http://stackoverflow.com/q/29849318
type: Answer
upvote count: 1
has body: It can be implemented by checking the Referer of incoming HTTP requests. As the referer is a HTTP header, it can be accessed this way in Django: referer = request.META.get('HTTP_REFERER') Beware that you cannot rely on the Referer header being correct as the user can change it or prevent it being sent.
score: 1

http://stackoverflow.com/a/29918837
type: Answer
score: 0
has body: I would like to suggest to make two pages: In first page you fetch longitude, latitude from database and use iframe to call map page. e.g. <?php /* Code to get latitude and longitude */ /* store value in $lat and $lon */ $map_url = "map_php.php?lon=$lon&lat=$lat"; ?> <iframe src="<?=$map_url?>" align="center" name="mymap" scrolling="No" width="100%" height="500" style="" frameborder="0"> In second page write code for map generating part. e.g. <?php $lat = $_GET["lat"]; $lon = $_GET["lon"]; ?> Try it. I think it will work for you. Set map property and zoom level as per your requirement.
answers question: http://stackoverflow.com/q/29918257
has comment: http://stackoverflow.com/comment/47959315

http://stackoverflow.com/q/29905154
tagged with: javascript
favorite count: 0
tagged with: flip
tagged with: http://stackoverflow.com/tag/html
tagged with: css
upvote count: 3
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29905384
tagged with: google-chrome
score: 3
has body: I wanted to create a card with text which will flip and show a backside with some other text, whenever you click on the "card" (div). I checked for any mistakes and stuff but somehow its not working on chrome. HTML: front back CSS: .card { position: relative; float: left; padding-bottom: 25%; width: 25%; text-align: center; } .card__front, .card__back { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } .card__front, .card__back { -webkit-backface-visibility: hidden; backface-visibility: hidden; -webkit-transition: -webkit-transform 0.3s; transition: transform 0.3s; } .card__front { background-color: #ff5078; } .card__back { background-color: #1e1e1e; -webkit-transform: rotateY(-180deg); transform: rotateY(-180deg); } .card.effect__click.flipped .card__front { -webkit-transform: rotateY(-180deg); transform: rotateY(-180deg); } .card.effect__click.flipped .card__back { -webkit-transform: rotateY(0); transform: rotateY(0); } Javascript: (function() { var cards = document.querySelectorAll(".card.effect__click"); for ( var i = 0, len = cards.length; i < len; i++ ) { var card = cards[i]; clickListener( card ); } function clickListener(card) { card.addEventListener( "click", function() { var c = this.classList; c.contains("flipped") === true ? c.remove("flipped") : c.add("flipped"); }); } })();
type: Question
has title: 3d flip animation not working in chrome
downvote count: 0
answer count: 1

http://stackoverflow.com/q/29939453
has answer: http://stackoverflow.com/a/29940128
type: AnsweredQuestion
has body: I'm using google maps javascript api places SearchBox with componentRestrictions settings to country cz. But getting autocomplete with all countries. const AUTOCOMPLETE_OPTIONS = { types: ['address'], componentRestrictions: { country: 'cz' } }; new google.maps.places.SearchBox(inputPlaceElement, AUTOCOMPLETE_OPTIONS); If dump created object to console componentRestrictions is set as I want but in request url there is nothing about this restriction there should be GetPredictions not GetQueryPredictions: https://maps.googleapis.com/maps/api/js/AutocompletionService.GetQueryPredictions?1sb&amp;4scs&amp;15e3 I'm not sure where is problem here, if I set other country code it's not working either.
type: Question
tagged with: google-maps
tagged with: javascript
has comment: http://stackoverflow.com/comment/48001189
tagged with: google-maps-api-3
has title: Google maps componentRestrictions not working
score: 0
answer count: 1
accepted answer: http://stackoverflow.com/a/29940128

http://stackoverflow.com/q/29856126
has answer: http://stackoverflow.com/a/29856222
has answer: http://stackoverflow.com/a/29856636
tagged with: javascript
has answer: http://stackoverflow.com/a/29856165
score: 0
has title: Styling a input's background color and removing the disabled red circle when hovering over it?
tagged with: jquery
tagged with: twitter-bootstrap
answer count: 5
has answer: http://stackoverflow.com/a/29856215
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has answer: http://stackoverflow.com/a/29856354
has body: Is it possible to remove the red circle when hovering over a disabled input. I'm using bootstrap's form-control and when disabled it shows a red circle when I hover over it. Can I remove this red circle? Can I change the background color of the input? Tried both in this fiddle, but didn't have any luck. .bcolor { background-color: "#fffff;" } Home
type: UnansweredQuestion
type: Question

http://stackoverflow.com/q/29935216
tagged with: google-chrome
type: Question
tagged with: debugging
possible better answer: http://stackoverflow.com/a/38182789
upvote count: 5
has answer: http://stackoverflow.com/a/38182789
has body: My project was totally involved in asp.net, We are working on browser compatibility issues, window.showModalDialog is not working in chrome please help me with any replacement, other than window.open
tagged with: javascript
answer count: 3
has answer: http://stackoverflow.com/a/29936148
has title: Window.showModalDialog Replacement
tagged with: asp.net
favorite count: 0
tagged with: cross-browser
type: AnsweredQuestion
score: 3
linked to: http://stackoverflow.com/q/25663053
accepted answer: http://stackoverflow.com/a/29936148
has answer: http://stackoverflow.com/a/60851733
downvote count: 2

http://stackoverflow.com/q/29965154
has comment: http://stackoverflow.com/comment/48050361
score: 0
answer count: 1
tagged with: arrays
has comment: http://stackoverflow.com/comment/48050694
has answer: http://stackoverflow.com/a/29966421
tagged with: angularjs
has comment: http://stackoverflow.com/comment/48050727
type: AnsweredQuestion
has body: I am trying to do a basic task: removing an item from my array. The array looks like that: myWordsInJSON = [{"eng":"frau","rus":"жена"},{"eng":"mann","rus":"муж"},{"eng":"witwe","rus":"вдова"},{"eng":"witwer","rus":"вдовец"},{"eng":"schwiegervater","rus":"свекор"}] Here is my html code: {{$index + 1}} {{item[Params.lang1]}} {{item[Params.lang2]}} x Output screenshot It looks great. When I press the 'delete' label, my Controller's cutting function starts: $scope.cut = function(index){ $scope.myWordsInJSON.splice(index,1); if ($scope.myWordsInJSON.length == 1) $scope.myWordsInJSON = []; console.log('cuted, index =', index,$scope.myWordsInJSON); }; But than strange things happens. After cutting a few items from the beginning of my array, I've got this picture: everythig looks ok DOM looks great, last element of my array is: 2 schwiegervater свекор x BUT!!! When I am pressing on this element, which has to invoke my cut function like cut(1), nothing happens and in my console I see index = 4 that means that my function is getting index=4 instead of index=1 So, it looks like my indexes from initial page compilation is still here... How can I solve this problem? Update! The problem solved by using '$index' instead of '{{$index}}'. Sanks to valverde93. But I still cant understand why that happens ))) Maby someone can explane?
has title: How to delete elements from array in Angularjs application
accepted answer: http://stackoverflow.com/a/29966421
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/48052147

http://stackoverflow.com/q/29960135
tagged with: javascript
score: 0
has title: Angular js ng show not working
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/48041068
has answer: http://stackoverflow.com/a/41507959
tagged with: angularjs
has comment: http://stackoverflow.com/comment/48041797
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29960876
has comment: http://stackoverflow.com/comment/48041601
has comment: http://stackoverflow.com/comment/48040865
type: Question
answer count: 2
has body: I am working on a small web app and facing an issue. I want to show a preloader svg inside a div as below :- &lt;div class="loader" ng-show="main.showLoader"&gt; &lt;svg class="spinner" width="65px" height="65px" viewBox="0 0 66 66" xmlns="http://www.w3.org/2000/svg"&gt; &lt;circle class="path" fill="none" stroke-width="6" stroke-linecap="round" cx="33" cy="33" r="30"&gt;&lt;/circle&gt; &lt;/svg&gt; In my HTML I switched main.showLoader = true on click of a button. Controller Function :- $scope.setCA=function(cont,click){ if($scope.aC!=null){ $scope.aC={}; } if($scope.c[c.p]==null){ $scope.mC=''; .....Server interactions here var chat={ 'name':cont.name, 'phone':cont.phone, 'msgs':msgs, 'unreadMsgs':unreads, }; $scope.chats[cont.phone]=chat; //Assign the messages from repective users in the chats array to the respective contact phone number as here $scope.$apply(function(){ $scope.activeChats[cont.phone]=chat; if(click) $scope.setChatInFocus($scope.chats[cont.phone]); //Send chats to setChatinFocus }); }); } else{ $scope.showFirstTime = false; if($scope.activeChats[cont.phone]==null){ $scope.activeChats[cont.phone]=$scope.chats[cont.phone]; } if(click) $scope.setChatInFocus($scope.chats[cont.phone]); } setTimeout(function(){scrollToBottom()},10); this.showLoader=false; }; HTML:- &lt;div class="singleContact person" ng-cloak ng-class="{active: contactName === contact.name}" ng-repeat="contact in contacts" ng-click='main.showLoader=true;setChatActive({ "name": contact.name, "phone": contact.phone },true)&gt; It switches on as intended but does not go off. Some help ?
has comment: http://stackoverflow.com/comment/48041721

http://stackoverflow.com/comment/48112976
has text: I don't think loop is the issue here, since I can save, delete and update just fine to the database... just not the onClick. Maybe I need to read more on how exactly to pass and update values inside the addListener... Not sure where to begin tho
comment on: http://stackoverflow.com/q/29996059
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/53707892
type: QuestionComment
has text: U want to find what??? the behind coding inside print?
type: Comment
comment on: http://stackoverflow.com/q/29912933
score: 0

http://stackoverflow.com/q/29942538
has comment: http://stackoverflow.com/comment/48007611
tagged with: javascript
has comment: http://stackoverflow.com/comment/48006278
has comment: http://stackoverflow.com/comment/48006323
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
type: UnansweredQuestion
tagged with: blogger
has answer: http://stackoverflow.com/a/29966195
tagged with: css
has answer: http://stackoverflow.com/a/40552418
score: 3
tagged with: google-custom-search
has comment: http://stackoverflow.com/comment/48006441
downvote count: 1
has body: I am embedding a custom google search into my blogger site using layout -&gt; add a gadget -&gt; html/javascript. However, the search box has a white background. How can I make the background transparent? As you can see in the last screenshot, there is no option for the background color of the search box. Is there any other way to make it transparent?
has title: Google Custom Search with transparent background
type: Question
upvote count: 4
answer count: 2
has comment: http://stackoverflow.com/comment/48016032

http://stackoverflow.com/a/30015333
upvote count: 1
score: 1
has body: In java, driver.switchTo().alert().accept(); will do the job. I am not sure, why you are using "print al.accept()", probably are you trying to print text? then alert.getText() will do in java, sorry if i am wrong, because i am sure in python. Thank You, Murali http://seleniumtrainer.com/
answers question: http://stackoverflow.com/q/29999482
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/78332494

http://stackoverflow.com/comment/47882545
has text: angular expressions are treated as text
comment on: http://stackoverflow.com/q/29879131
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47981349
has text: Passing large files via HTTP can start to consume resources very quickly. Shockwave Flash might be a better method. This can handle larger files much better.
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29922959

http://stackoverflow.com/comment/48034881
has text: Regex is implemented differently in different languages. Not all of them support look-arounds, for instance.
comment on: http://stackoverflow.com/q/29957123
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47827407
score: 0
has text: presumably the `speak` api has callbacks that you would use just like any other asynchronous api. Also remember that events outside of angular need to use `$apply()`
comment on: http://stackoverflow.com/q/29850241
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47939532
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29908503
type: AnswerComment
has text: Thanks a lot for the great answer. I would like to know what if I have several signals, dont you think the button will be overlapping with legeneds?

http://stackoverflow.com/q/29977149
type: Question
answer count: 2
has body: The following code works in the sense that it cause the alert to appear then disappear after 3 seconds. The problem is, when I trigger it a second time (without refreshing the browser), it will appear but not timeout a second time and disappear unless the x is clicked. How can I make it keep appearing and disappearing on cue without a user x'ing out? Please see following: function appendWarning () { // missing if(!result) { $(".confirmAlert").append('class="alert alert-danger" role="alert"&gt;Oh snap! Something went terribly wrong!&lt;/div&gt;'); } else { var confPop = $(".confirmAlert").append('&lt;div id="confrimedLuck" class="alert alert-warning alert-dismissible" role="alert"&gt;&lt;button type="button" class="close" data-dismiss="alert" aria-label="Close"&gt;&lt;span aria-hidden="true"&gt;&amp;times;&lt;/span&gt;&lt;/button&gt;' + rand + '&lt;/div&gt;'); console.log("confPop BANG!"); } var cleanAlert = setTimeout(function(){ document.getElementById('confrimedLuck').style.display = 'none'}, 3000); console.log("cleanAlert executed!"); }
downvote count: 0
possible better answer: http://stackoverflow.com/a/29977555
tagged with: javascript
tagged with: scope
has comment: http://stackoverflow.com/comment/48073883
has comment: http://stackoverflow.com/comment/48073950
has comment: http://stackoverflow.com/comment/48073941
favorite count: 0
accepted answer: http://stackoverflow.com/a/29977237
has comment: http://stackoverflow.com/comment/48073978
has answer: http://stackoverflow.com/a/29977555
upvote count: 1
type: AnsweredQuestion
tagged with: settimeout
has title: Popup visibility removal successful on first try only
score: 1
has answer: http://stackoverflow.com/a/29977237

http://stackoverflow.com/q/29854405
has title: Sending array from server to client with socket.io
has comment: http://stackoverflow.com/comment/47835552
score: 0
tagged with: socket.io
has body: I am developing a small chat app, and I would like to be able to display a list of connected users. To do so, on my server side, I have: var users = {}; io.on('connection', function(socket){ socket.on('newUser', function(pseudo) { socket.pseudo = pseudo; users[socket.pseudo] = socket; io.sockets.emit('newUser', pseudo); console.log(Object.keys(users)); }); The console sends me back [ 'root' ] if I connect the user root. And this is what I have on my client side: var pseudo = '#{user.username}'; socket.emit('newUser', pseudo); socket.on('newUser', function(pseudo) { $('#messageZone').append('&lt;p&gt;&lt;em&gt;' + pseudo + ' just joined the conversation !&lt;/em&gt;&lt;/p&gt;'); }); So my question is, how can I send the full updated users array to each client when they connect themselves and display it in a div? Thank you for your help!
tagged with: javascript
tagged with: express
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29854797
type: Question
answer count: 1
tagged with: node.js
accepted answer: http://stackoverflow.com/a/29854797

http://stackoverflow.com/comment/47866604
comment on: http://stackoverflow.com/q/29856267
score: 0
type: QuestionComment
has text: Thanks, I'm not in the office today to post code. I think I'm going to store the indexes I delete client side in a hidden field control. Then when the page posts back from the server, grab these indexes from the hidden field and go through the grid and remove the rows. I will try this and let you guys know if that does the trick.
type: Comment

http://stackoverflow.com/q/29983887
type: AnsweredQuestion
downvote count: 0
has title: 'this' returning either 'Object' or 'Window' inside the same object
type: Question
accepted answer: http://stackoverflow.com/a/29983907
has answer: http://stackoverflow.com/a/29983911
score: 1
has body: Now that's a new one for me. I searched around but can't find the solution elsewhere. I've got this code (coffeescript) : PositionDetector = -&gt; detectPosition : -&gt; console.log this # outputs 'Object' (OK) navigator.geolocation.getCurrentPosition(this.locationHandler) locationHandler : (position) -&gt; console.log this # outputs 'Window' (WHY??) positionDetector = new PositionDetector() positionDetector.detectPosition() (or the corresponding compiled javascript, if you prefer) : var PositionDetector = function() { detectPosition : function() { console.log(this); // outputs 'Object' navigator.geolocation.getCurrentPosition(this.locationHandler); }, locationHandler : function(position) { console.log(this); // outputs 'Window' } } var positionDetector = new PositionDetector(); positionDetector.detectPosition(); Question is, why does the first 'this' output 'Object' and the second one 'Window'? Live demo in a Codepen
possible better answer: http://stackoverflow.com/a/29983911
has answer: http://stackoverflow.com/a/29983907
upvote count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/29984193
favorite count: 0
has comment: http://stackoverflow.com/comment/48087580
answer count: 3

http://stackoverflow.com/a/29996114
score: 2
accepted answer of: http://stackoverflow.com/q/29996036
downvote count: 0
has body: use this $("#homeButton").removeClass( "selected" ); $("#overButton").addClass( "selected" ); instead of var homeButton = document.getElementById("homeButton"); var aboutButton = document.getElementById("overButton"); homeButton.className = homeButton.className - " selected"; aboutButton.className = aboutButton.className + " selected";
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/48111843
upvote count: 2
answers question: http://stackoverflow.com/q/29996036
type: Answer

http://stackoverflow.com/comment/48074506
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29977467
has text: that should work too
type: Comment

http://stackoverflow.com/q/29917473
has comment: http://stackoverflow.com/comment/47956268
has title: how to set title attribute of button using jquery
has body: I want to assign ajax return data to button's title attribute on hover of button, so i use $('#data_btn').title = html(returndata);, in below code, then it unable to show any output. Here, #data_btn is id of button element. Please help me regarding. $('#data_btn').hover(function(){ var val_d = $('#country').val() +"-"+ $('#city').val(); window.alert(val_d); if(val_d != 0) { $.ajax({ type:'post', url:'getdata.php', data:{id:val_d}, cache:false, success: function(returndata){ $('#data_btn').title = html(returndata); //$('#data_btn').html(returndata); } }); } })
has comment: http://stackoverflow.com/comment/47956401
type: AnsweredQuestion
score: 3
has answer: http://stackoverflow.com/a/29917533
has comment: http://stackoverflow.com/comment/47956069
accepted answer: http://stackoverflow.com/a/29917758
has comment: http://stackoverflow.com/comment/47956237
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/29917574
has answer: http://stackoverflow.com/a/29917758
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47956284
tagged with: ajax
answer count: 3
favorite count: 0
has comment: http://stackoverflow.com/comment/47958526
possible better answer: http://stackoverflow.com/a/29917574
upvote count: 4

http://stackoverflow.com/q/29903896
has comment: http://stackoverflow.com/comment/47931918
type: Question
tagged with: javascript
tagged with: jquery
score: 0
has answer: http://stackoverflow.com/a/29904034
tagged with: http://stackoverflow.com/tag/html
answer count: 1
type: UnansweredQuestion
has body: I want to center this date picker to make it easier to use on mobile, but I'm having trouble getting it to work. I'm currently trying this method: https://css-tricks.com/centering-percentage-widthheight-elements/ .picker { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 40%; } ...but no luck. Horizontally it centers, but not properly and the modal scales with the window size. Vertically it doesn't center at all. I've also tried centering it with jQuery, but I couldn't get that to work properly either. Fiddle: http://jsfiddle.net/qos2v29e/
tagged with: css
has comment: http://stackoverflow.com/comment/47930596
has title: Centering modal window
has comment: http://stackoverflow.com/comment/47930806

http://stackoverflow.com/a/29990606
type: Answer
answers question: http://stackoverflow.com/q/29986905
has body: This should work: module.exports = function(grunt) { var myElements = [ 'elementOne', 'elementTwo', 'elementThree' ]; grunt.initConfig({ myElements: myElements, sass: { dist: { files: { myElements[0] : '/scss/elementOne.scss', myElements[1] : '/scss/elementTwo.scss', myElements[2] : '/scss/elementTwo.scss', } } } ....
score: 0

apache
tag name: apache
tags question: http://stackoverflow.com/q/29917691
tags question: http://stackoverflow.com/q/29895480
tags question: http://stackoverflow.com/q/29858927
type: Tag
tags question: http://stackoverflow.com/q/29856590
tags question: http://stackoverflow.com/q/29930394

http://stackoverflow.com/a/29953533
upvote count: 1
downvote count: 0
type: Answer
score: 1
has body: You are adding event handler twice and the if needs to be inside var audio=new Audio("sample.mp3"); audio.onreadystatechange=function(){ if(audio.readyState===4){ alert(audio.duration); } }
answers question: http://stackoverflow.com/q/29953409

button
tags question: http://stackoverflow.com/q/29869627
tags question: http://stackoverflow.com/q/29925214
tags question: http://stackoverflow.com/q/29884654
tags question: http://stackoverflow.com/q/29901111
tags question: http://stackoverflow.com/q/29900551
type: Tag
tags question: http://stackoverflow.com/q/29934522
tags question: http://stackoverflow.com/q/29913997
tags question: http://stackoverflow.com/q/29856105
tags question: http://stackoverflow.com/q/29872986
tags question: http://stackoverflow.com/q/29853694
tags question: http://stackoverflow.com/q/29947814
tags question: http://stackoverflow.com/q/29845463
tags question: http://stackoverflow.com/q/29864387
tags question: http://stackoverflow.com/q/29950046
tag name: button
tags question: http://stackoverflow.com/q/30000929

http://stackoverflow.com/comment/47867822
type: QuestionComment
comment on: http://stackoverflow.com/q/29871091
has text: good questions: all values must be conserved! And yes - it have to be after filling the array! and all integers could be between 0 and 99!
score: 0
type: Comment

http://stackoverflow.com/a/29919714
upvote count: 1
score: 1
has body: use a token interceptor like this: app.factory('TokenInterceptor', function($q, $window) { return { request: function(config) { config.headers = config.headers || {}; if ($window.sessionStorage.token) { config.headers['X-Access-Token'] = $window.sessionStorage.token; config.headers['X-Key'] = $window.sessionStorage.user; config.headers['Content-Type'] = "application/json"; } return config || $q.when(config); }, response: function(response) { return response || $q.when(response); } }; }); and then use it in your app.config like this $httpProvider.interceptors.push('TokenInterceptor');
has comment: http://stackoverflow.com/comment/47960859
downvote count: 0
has comment: http://stackoverflow.com/comment/47960521
type: Answer
answers question: http://stackoverflow.com/q/29919245

http://stackoverflow.com/q/29997227
has answer: http://stackoverflow.com/a/29997258
type: AnsweredQuestion
score: 1
tagged with: java
type: Question
has comment: http://stackoverflow.com/comment/48114260
has comment: http://stackoverflow.com/comment/48114014
accepted answer: http://stackoverflow.com/a/29997258
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/48114087
has comment: http://stackoverflow.com/comment/48114058
has comment: http://stackoverflow.com/comment/48114102
has comment: http://stackoverflow.com/comment/48114266
has comment: http://stackoverflow.com/comment/48114307
tagged with: http://stackoverflow.com/tag/html
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/48114253
has body: I am stuck in the following problem: I have this div in html: Title of the pie chart: Time OnChange of drop down list I am calling a Javascript function, showAxis('x'), which dynamically generates HTML table. The code is below: function showAxis(coordinate){ var axisList = coordinate + "AxisList"; var v = document.getElementById(axisList); selectedAxisType = v.options[v.selectedIndex].value; var dataArray = new Array(); selectedChartType = "PieChart"; var selectedChart = document.getElementById(selectedChartType); var tr, td; var table, tableBody; var dropdown, opt, i; table = document.createElement('TABLE'); dataArray = ["Years", "Seasons", "Months", "Weeks", "Days"]; table.setAttribute("id", "time"+axisList+"Table"); table.setAttribute("class", "time"+axisList+"Table"); table.width='100%'; tableBody = document.createElement('TBODY'); table.appendChild(tableBody); dropdown = document.createElement("select"); dropdown.setAttribute("id", "time"+axisList); tr = document.createElement('TR'); tableBody.appendChild(tr); td = document.createElement('TD'); td.width='40%'; td.appendChild(document.createTextNode("Time selection on the basis of:")); tr.appendChild(td); opt = document.createElement("option"); opt.hidden="true"; dropdown.options.add(opt); for (i=0; i<dataArray.length; i++){ td = document.createElement('TD'); opt = document.createElement("option"); opt.text = dataArray[i]; opt.value = dataArray[i]; dropdown.options.add(opt); td.appendChild(dropdown); tr.appendChild(td); }// END of Outer for loop selectedChart.appendChild(table); }// END of showAxis() PROBLEM: This dynamically generated table in showAxis(coordinate) method gets appended before "xAxisList" drop down list, I want this TABLE as whole to be appended after the drop down list ("xAxisList"). I have spent much time on few blogs, but couldn't find anything helpful. I would be really thankful if someone helps me solving this issue. Thanks allot for your time and reading my question.
favorite count: 0
has title: How to append dynamically generated HTML table at the end of div, on selection of drop down present in the same div?
upvote count: 1

http://stackoverflow.com/comment/47877666
comment on: http://stackoverflow.com/q/29876525
score: 0
has text: Never do such things, users might have problems logging into your program. Locking user account might lead to unused accounts.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/138146745
type: Comment
comment on: http://stackoverflow.com/a/29935020
score: 0
type: AnswerComment
has text: `object.getSelectionStyles()[styleName]` in `getStyle` function did not work for me (using FabricJS version 5.3.0) because it returns an array with an object for the style of every selected character. Instead, I'm doing `object.getSelectionStyles()[0][styleName]` so that I check the style of the first character, and act accordingly.

http://stackoverflow.com/a/29924277
answers question: http://stackoverflow.com/q/29924032
has comment: http://stackoverflow.com/comment/47999728
has comment: http://stackoverflow.com/comment/47998924
type: Answer
downvote count: 0
has body: As Andy said, give every option the same class. In my example it's "option-item". $("#doThis").on("click", function() { var arrayList = []; $('.option-item').each(function(i) { arrayList[i] = $(this).val(); }); var decide = arrayList[Math.floor(Math.random() * arrayList.length)]; $("#verdict").text(decide); }); Every value is now stored in the array. see fiddle. greetings timmi
score: 1
has comment: http://stackoverflow.com/comment/47970161
accepted answer of: http://stackoverflow.com/q/29924032
upvote count: 1
has comment: http://stackoverflow.com/comment/47997927
type: AcceptedAnswer

http://stackoverflow.com/a/29938880
accepted answer of: http://stackoverflow.com/q/29936055
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/29936055
type: Answer
score: 2
has body: You have to replace all the hyperlinks with text. Clone the table that is to be exported table = $('#'+tableName).clone(); Replace the anchor tag with corresponding span var sp1 = document.createElement("span"); var sp1_content = document.createTextNode($(hyperLinks[i]).text()); sp1.appendChild(sp1_content); var sp2 = hyperLinks[i]; var parentDiv = sp2.parentNode; parentDiv.replaceChild(sp1, sp2); You can find here details about replacing a node. Exported using the code from Stackoverflow answer Here is the snippet or PEN var tmp; function strip(html) { tmp = document.createElement("DIV"); tmp.innerHTML = html; console.log(tmp.innerText); console.log(tmp.textContent); return tmp.textContent || tmp.innerText || ""; } 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, filename) { if (!table.nodeType) /*Clone the table that is to be exported*/ table = $('#'+table).clone(); var hyperLinks = table.find('a'); for (i = 0; i < hyperLinks.length; i++) { //hyperLinks[i] = $(hyperLinks[i]).text(); var sp1 = document.createElement("span"); // give it an id attribute called 'newSpan' sp1.setAttribute("id", "newSpan"); // create some content for the new element. var sp1_content = document.createTextNode($(hyperLinks[i]).text()); console.log(sp1_content); // apply that content to the new element sp1.appendChild(sp1_content); // build a reference to the existing node to be replaced var sp2 = hyperLinks[i]; var parentDiv = sp2.parentNode; // replace existing node sp2 with the new span element sp1 parent…
upvote count: 2

http://stackoverflow.com/comment/48124890
type: Comment
comment on: http://stackoverflow.com/a/30001050
has text: just got the top score ;) thanks for link! Nice old school side scroller!
score: 0
type: AnswerComment

http://stackoverflow.com/a/29953719
downvote count: 0
score: 1
has body: Finishing up the approach you started with: set the element text to everything before the last section, then append the span and its contents: var label = $('label'); $.each(label, function() { var el = $(this), arr = el.text().split(' '), num = arr[arr.length - 1], rest = arr.slice(0, arr.length - 1).join(' '); el. text(rest + " "). append($('').text(num)); }); span { color: red; } Some Number (XXXXXX1234) Some Other Number (XXXXXX4567) Some Number (XXXXXX7890)
answers question: http://stackoverflow.com/q/29953553
has comment: http://stackoverflow.com/comment/48028716
upvote count: 1
type: Answer

http://stackoverflow.com/a/29977263
upvote count: 4
accepted answer of: http://stackoverflow.com/q/29977262
downvote count: 0
answers question: http://stackoverflow.com/q/29977262
has comment: http://stackoverflow.com/comment/48076058
has body: I have just figured out. Just use Promise.all: function x(timeout) { return new Promise((resolve, reject) =&gt; { setTimeout(function() { resolve(timeout + ' done!'); }, timeout); }); } (function() { Promise.all([ x(300), x(200), x(100), ]).then(([x300, x200, x100]) =&gt; { console.log(x100); console.log(x200); console.log(x300); }); })();
type: AcceptedAnswer
score: 4
type: Answer

http://stackoverflow.com/q/29900628
has answer: http://stackoverflow.com/a/29900860
accepted answer: http://stackoverflow.com/a/29900723
answer count: 5
has comment: http://stackoverflow.com/comment/47924000
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29900798
type: Question
tagged with: javascript
has title: Javascript Add delay every 5th time in for loop
score: 0
has body: I have an array and I'm using a for loop to go through it like this: var test=['1','2','3','4','5','6','7','8','9','10','11','12','13']; for(var i=0; i&lt;test.length;i++){ console.log(test[i]); } Now I want to know how to set a delay (5 seconds) every 5th item in array looped and then continue through the rest of the array.
upvote count: 1
downvote count: 1
has answer: http://stackoverflow.com/a/29900901
possible better answer: http://stackoverflow.com/a/29900860
has answer: http://stackoverflow.com/a/29900955
favorite count: 0
has answer: http://stackoverflow.com/a/29900723

http://stackoverflow.com/comment/48124843
type: QuestionComment
type: Comment
score: 0
comment on: http://stackoverflow.com/q/30002384
has text: That was the issue, thanks for the help!

http://stackoverflow.com/comment/47831463
score: 0
type: Comment
type: QuestionComment
has text: How u can see the other line then?
comment on: http://stackoverflow.com/q/29852330

http://stackoverflow.com/q/29958524
tagged with: azure
has answer: http://stackoverflow.com/a/29958920
has answer: http://stackoverflow.com/a/29958969
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/48037612
tagged with: ajax
has comment: http://stackoverflow.com/comment/48037930
has body: As part of my coursework I have to build a web app that connects to a database, all hosted on azure and implementing the REST api. I've set up a MySQLdatabase and am now trying to work through the example code my lecturer gave out in order to tweak it to my current project. Only I am having some trouble following it. The desired structure is that index.html has a button, when this is pressed a call to NameWebService uses ajax to connect to a php file which then deals with the database connection and data collection. Yet nothing is being return from the database (and being unable to debug php from webmatrix I'm not 100% sure the connection is even being established). Any help would be greatly appreciated. NameWebService.js var year; var gender; function SetValues() { year = document.getElementById('Year').value; gender = document.getElementById('Gender').value; } function getNames(year, gender) { //alert(year + '\n' + gender); $.ajax({ url: '/Name', type: 'GET', data: 'table='+year, datatype: 'json', success: function (data) { alert('Data is:\n'+data) createNamesTable(data); }, error: function (jqXHR, textStatus, errorThrown) { alert(jqXHR + '\n' + textStatus + '\n' + errorThrown); } }); } function createNamesTable(Names) { var strResult = ' ' + ' ' + ' ' + ' ' + ' Rank ' + ' Name ' + ' Change Since Last Year ' + ' ' + ' ' + ' '; $.each(Names, function (Rank, Name){ strResult += " " + Name.Rank + " " + Name.Name + " " + Name.Change + " "; }); strResult += " "; $("#allNames").html(strResult); } calls to PHP and consequently database, takes back the data and creates a table from it. NameRestService.php <?php require "RestService.php"; require "Name.php"; class NameRestService extends RestService { private $Domain = 'domain'; private $User = 'username'; private $Password = 'password'; private $Database = 'database'; private $Names; public function __construct() { parent::__construct("Name"); } public function performGet($url, $parameters, $requestBody, $accept) { $this-…
type: UnansweredQuestion
tagged with: php
has comment: http://stackoverflow.com/comment/48037860
score: 1
tagged with: mysql
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/48037779
has comment: http://stackoverflow.com/comment/48037655
has title: Understanding what ajax is doing
tagged with: javascript
answer count: 2

http://stackoverflow.com/comment/48051134
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29965643
has text: You could also use [d3-tip](https://github.com/caged/d3-tip). It's a tooltip library that is really easy to use. [Here](http://bl.ocks.org/Caged/6476579) is an example with a bar chart and tooltips.
type: Comment

http://stackoverflow.com/comment/47858140
has text: Wow, excellent, it works! You are really a genius, man~ It's cool! I really really admire you, haha, I've been struggling for this a few days, OK, next step I should start to study how to extract these data to excel. Any button to choose your answer as the best answer here?
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29865223

http://stackoverflow.com/q/29963496
type: Question
has title: regular expression what does \d+? mean?
has comment: http://stackoverflow.com/comment/48047225
tagged with: javascript
score: 0
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/48047667
favorite count: 0
duplicate of: http://stackoverflow.com/q/22937618
has body: I'm new to regular expression using javascript. I know \d+ means one or more number(s), but the following ? really confused me! I tried some possibilities: 1.it means zero or more numbers, but /\d+?/.test("a") returns false 2.it means one number followed by zero or one +, but "11+".split(/\d+?/) returns ["","","+"] (all these codes are in JavaScript) So it seems like it means exactly one number!? Thanks for all responses and advice!
type: UnansweredQuestion
tagged with: regex
has comment: http://stackoverflow.com/comment/48047385
answer count: 0
has comment: http://stackoverflow.com/comment/48047313
linked to: http://stackoverflow.com/q/22937618
has comment: http://stackoverflow.com/comment/48047840

http://stackoverflow.com/a/29920020
accepted answer of: http://stackoverflow.com/q/29919615
has body: Here is an object version. This is not really what you're after, but along the same lines and honestly, a bit neater as it's a data structure. var myArray = [ "Apple: 10", "Apple: 3", "Banana: 3", "Pear: 7", "Pineapple: 7" ]; var newArray = {}; myArray.forEach(function(val) { var item = val.split(":"); var key = item[0]; var num = parseInt(item[1], 10); if ( newArray.hasOwnProperty(key) ){ newArray[key] += num; } else { newArray[key] = num; } }); alert ( JSON.stringify(newArray) ); And, as said in the comments, when we look at: myArray .push($(this).attr('id') + " : " +$(this).val()); And myArray [ "Apple: 10", "Apple: 3", "Banana: 3", "Pear: 7", "Pineapple: 7" ] You seem to have duplicate IDs in your document which needs to be fixed first as an ID must be unique in any given document.
answers question: http://stackoverflow.com/q/29919615
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 1
upvote count: 1

http://stackoverflow.com/q/29859265
has comment: http://stackoverflow.com/comment/47844380
has answer: http://stackoverflow.com/a/29859308
has answer: http://stackoverflow.com/a/29859305
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29859356
score: 1
possible better answer: http://stackoverflow.com/a/29859308
type: Question
has comment: http://stackoverflow.com/comment/47844381
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/47844602
tagged with: jquery
accepted answer: http://stackoverflow.com/a/29859305
has title: Why can't I use a tag for jQuery anywhere?
answer count: 3
has body: This is an issue of scope I believe. I wish to use jQuery in a Joomla module and include the code within a tags in the php source. This works: &lt;script&gt; alert("foo"); &lt;/script&gt; but this doesn't: &lt;script&gt; alert($.jquery); alert(jQuery.jquery); &lt;/script&gt; which should produce at least 1 alert box with the jQuery version, but the alert says "undefined". The webpage &lt;head&gt; section already includes jQuery, and it is used in the html stream before the above &lt;script&gt;. I don't believe the &lt;script&gt; block defines a new, independent script scope / context, but that is how it behaves.
favorite count: 0
upvote count: 1

http://stackoverflow.com/comment/48328797
type: AnswerComment
score: 0
has text: Of course. Thanks again! But I dont see any changes in the demo? :-)
type: Comment
comment on: http://stackoverflow.com/a/29919506

http://stackoverflow.com/a/29968016
accepted answer of: http://stackoverflow.com/q/29967752
has comment: http://stackoverflow.com/comment/48058347
upvote count: 1
has comment: http://stackoverflow.com/comment/48058038
has comment: http://stackoverflow.com/comment/48058947
score: 1
has comment: http://stackoverflow.com/comment/48059558
has comment: http://stackoverflow.com/comment/48058772
type: AcceptedAnswer
downvote count: 0
has body: You will need a template helper (set somewhere in your client folder) to communicate your data to your views, like so: Template.registerHelper('AppData', function () { return AppData; }); This way your views, as well as your javascript code, will be able to access your AppData object.
answers question: http://stackoverflow.com/q/29967752
has comment: http://stackoverflow.com/comment/48058142
type: Answer

http://stackoverflow.com/q/29861693
type: AnsweredQuestion
score: 3
downvote count: 0
has comment: http://stackoverflow.com/comment/47850068
has answer: http://stackoverflow.com/a/29863412
type: Question
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/47850055
upvote count: 3
tagged with: functional-programming
has title: JavaScript: Can this code be refactored to a more functional programming style?
favorite count: 0
has body: Can this code be chained and the for loop abstracted away? Using map and filter? function listViewFilter(){ // test var DateFiltered = containerdata.filter(function (obj){ // remove dates of 010 return !/010/.test(obj.EventDate); }); var NameFiltered = []; for (var i = 0; i &lt; DateFiltered.length; i++){ // remove EventNames.Name if empty string if (DateFiltered[i].EventNames[0].Name == "") continue; else NameFiltered.push(DateFiltered[i]); } Filtered = NameFiltered; }
accepted answer: http://stackoverflow.com/a/29863412

http://stackoverflow.com/a/29845767
accepted answer of: http://stackoverflow.com/q/29845681
upvote count: 2
type: AcceptedAnswer
type: Answer
score: 2
downvote count: 0
has body: The main problem is that you are reading the client time and comparing it with server time. If the clocks are set differently on the two computers then you will always get the wrong result. You should never really trust anything running on the client computer anyway (it's easily hacked) so the best approach is to just both record the start time and calculate the duration server side.
answers question: http://stackoverflow.com/q/29845681

http://stackoverflow.com/q/29951516
has answer: http://stackoverflow.com/a/29953100
type: Question
tagged with: imagemin
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: node.js
favorite count: 0
has body: I have a server and it gets a lot of image uploads. The app uploading the images is based in PHP. However, I want to use Node to watch the upload folder, then run imagemin on any new images. I was thinking I would use npm packages 'watch' and 'imagemin'. I am not sure how to configure them exactly though or how to have it run all the time. So far I have the following which I can turn on manually: var Imagemin = require('imagemin'); var watch = require('watch'); var imagemin = new Imagemin() .use(Imagemin.pngquant()); watch.createMonitor('images', function (monitor) { monitor.files['images/*.png'] monitor.on("created", function (file) { compressImage(file); }) monitor.on("changed", function (file) { compressImage(file); }); }); function compressImage(file) { var dest, path; path = f.split('/'); path.pop(); dest = path.join('/'); imagemin.src(file).dest(dest).run(); } After a couple of files are added though I get a warning about a possible EventEmitter memory leak detected. 11 listeners added. Use emitter.setMaxListeners() to increase limit and then it stops working. Is there a better way to do this and how can I run it automatically?
has title: Watch folder on server for new images to compress
type: UnansweredQuestion
upvote count: 1
tagged with: watch
score: 1

http://stackoverflow.com/a/74829446
type: Answer
answers question: http://stackoverflow.com/q/29875869
has body: You can create a reusable component with a fallback component. export const StringComponent = (Base, { name, Fallback = undefined, ...rest }) => { const Component = Base[name]; // return fallback if the component doesn't exist if (!Component) return <Fallback/> return <Component {...rest}/>; }; And call it like this: import * as Pages from "../pages" const routes = [ {path: "/", element: "Home" }, {path: "/about", element: "About" }, {path: "*", element: "NotFound" }, ] export function App(){ const Fallback = Pages.NotFound // render each route using a string as name return ( { routes.map(page => StringComponent(Pages, { name: page.element, Fallback }) ) } ) } OBS: Imported Pages needs to be something like this: import Home from "./home" import About from "./about" import NotFound from "./not-found" export { Home, About, NotFound }
score: 0

http://stackoverflow.com/comment/48116723
has text: It had loaded when I copy paste same URL from firebug and try.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29998590

http://stackoverflow.com/comment/136824416
score: 0
type: Comment
has text: JSON is a string.
type: AnswerComment
comment on: http://stackoverflow.com/a/29879051

http://stackoverflow.com/comment/48108045
has text: how have you tried to do this?
type: Comment
type: QuestionComment
score: 2
comment on: http://stackoverflow.com/q/29994284

http://stackoverflow.com/comment/65908372
has text: Sure. Whenever you save something to localstorage, it's in response to an event (e.g. a button being clicked, or some text entered into an input field). When that event occurs you can $emit() an event. It's like announcing to the app that something has happened. In this case, we're announcing that some data was saved (using an arbitrary name: 'codesUpdated'). Elsewhere in the app, in some other controller(s), and prior to $emitting the event, we use $on() to say: "When 'codesUpdated' happens, run this code in response". That code might update the UI, or perhaps save the data to a server.
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/29929828
type: Comment

http://stackoverflow.com/comment/47861247
has text: This is the script I used.
comment on: http://stackoverflow.com/q/29868101
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/29872986
score: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47871083
tagged with: button
accepted answer: http://stackoverflow.com/a/29873028
has answer: http://stackoverflow.com/a/29873056
tagged with: php
answer count: 4
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29873028
has answer: http://stackoverflow.com/a/29873118
has body: Just a very brief explanation of what a part of my code does: I have two buttons that do different things. One of them lets the user search through the table/database for whatever he/she wants to search for The other lets the user insert things into the database WHAT I'M TRYING TO DO: I'm trying to check to see which button the user clicked on so that the appropriate code will be executed. I've been looking around and pretty much everywhere I go, people are suggesting to use isset(), but it's not working for me. Perhaps I don't fully understand what isset() does, but doesn't it basically check to see whether a variable is set? Here's my code: Perform Search Insert Data if(isset($_POST['sButton'])){ } else{ } To test it, I had the if statement print "Checked" and the else print "Not checked". When I run my code, it prints "Not checked". What am I doing wrong and what should I be doing? Thanks in advance!
type: Question
tagged with: isset
has answer: http://stackoverflow.com/a/29873996
possible better answer: http://stackoverflow.com/a/29873056
has comment: http://stackoverflow.com/comment/48122952
has comment: http://stackoverflow.com/comment/47872509
has title: Check to see if a button is clicked on... not working
tagged with: javascript

http://stackoverflow.com/comment/47936983
type: Comment
type: QuestionComment
has text: It looks like your trying to make it do the strange shake effect when you click one of the links, but it's currently doing it on the other link than the one you clicked?? If so, swap your addClass and removeClass on the objects.
comment on: http://stackoverflow.com/q/29907141
score: 0

http://stackoverflow.com/comment/48088896
type: AnswerComment
type: Comment
has text: Please check this question http://stackoverflow.com/questions/29983563/add-wordpress-jquery-to-cutom-page-template
comment on: http://stackoverflow.com/a/29944617
score: 0

http://stackoverflow.com/comment/47881108
type: QuestionComment
has text: possible duplicate of [I have some html code that contains javascript markers.I need to get some values with jsoup](http://stackoverflow.com/questions/29864947/i-have-some-html-code-that-contains-javascript-markers-i-need-to-get-some-values)
comment on: http://stackoverflow.com/q/29877349
type: Comment
score: 0

http://stackoverflow.com/q/29889190
has answer: http://stackoverflow.com/a/29889319
type: Question
tagged with: c#
tagged with: javascript
has title: onkeydown='return (window.event.keyCode doesn't allow select input with mouse click
has comment: http://stackoverflow.com/comment/47902369
accepted answer: http://stackoverflow.com/a/29889319
answer count: 1
tagged with: jquery
tagged with: asp.net
linked to: http://stackoverflow.com/q/23039374
type: AnsweredQuestion
has body: I'm developing an ASP.NET MVC 5 web page with .NET Framework 4.5.1 and C#. I have this code: &lt;input type="text" class="quantity" name="Quantity" id="Quantity" onkeydown='return (window.event.keyCode &gt;= 48 &amp;&amp; window.event.keyCode &lt;= 57) || window.event.keyCode == 8 || window.event.keyCode == 46' required /&gt; onkeydown works fine to allow only numbers, backspace and delete keys, but I can't select the input text when I click on it my the mouse. I haven't found any relative information about this on Internet. Any idea?
score: 0

http://stackoverflow.com/q/29867835
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion
has body: I have list with id myid. I can get values li values like this $('#' + i).text(). But I am using $( '#myid' ).sortable() . How can get values in currently displayed order? Demo here. I need to implement function in stop: value 1 value 2 value 3 value 4 value 5
downvote count: 0
score: 1
has title: Jquery, get values from tag
type: Question
tagged with: jquery-ui-sortable
tagged with: javascript
has answer: http://stackoverflow.com/a/29868043
accepted answer: http://stackoverflow.com/a/29868043
upvote count: 1
answer count: 1
tagged with: jquery

http://stackoverflow.com/comment/47990767
type: AnswerComment
type: Comment
has text: If you are using PHP you wouldn't want to read file names one by one, that's pretty dang inefficient and when doing server-side code, you want to be as efficient as possible
comment on: http://stackoverflow.com/a/29933362
score: 0

innertext
tags question: http://stackoverflow.com/q/29877248
tags question: http://stackoverflow.com/q/29870638
tag name: innertext
type: Tag

spring-mvc
tags question: http://stackoverflow.com/q/29889928
tags question: http://stackoverflow.com/q/29964621
tag name: spring-mvc
type: Tag
tags question: http://stackoverflow.com/q/29856986
tags question: http://stackoverflow.com/q/29935032
tags question: http://stackoverflow.com/q/29937641

http://stackoverflow.com/q/29917315
answer count: 2
linked to: http://stackoverflow.com/q/26139206
possible better answer: http://stackoverflow.com/a/29917483
has answer: http://stackoverflow.com/a/29917586
downvote count: 0
has answer: http://stackoverflow.com/a/29917483
tagged with: javascript
tagged with: jquery
has body: Thanks to this post I've achieved to hide a dropdown menu when a value from a selectfield it's selectd: $(function () { var selectField = $('#id_type_contract'), verified = $('#id_mod_contracts'); function toggleVerified(value) { value == 'Modification' ? verified.show() : verified.hide(); } // show/hide on load based on pervious value of selectField toggleVerified(selectField.val()); // show/hide on change selectField.change(function() { toggleVerified($(this).val()); }); }); })(django.jQuery); But it doesn't work as I wanted: Image , because still remains its label and 'Add' button (green cross). So, I think the best way to proceed is to hide the entire div, am I right? html Modification: --------- Contract foo Contrato bar contract CCCC How could I adapt the above JavaScript function? Is there any other better option?
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
accepted answer: http://stackoverflow.com/a/29917586
upvote count: 2
tagged with: django
has title: Hide/show div section - select option
type: AnsweredQuestion
score: 2
type: Question

http://stackoverflow.com/comment/65173207
comment on: http://stackoverflow.com/a/32671263
score: 4
type: AnswerComment
has text: I believe that this will not have forward compatibility issues because if an iterator was added to objects this would overwrite it and if an iterator was added to an object subtype it would use the subtype iterator.
type: Comment

http://stackoverflow.com/comment/47954976
score: 0
comment on: http://stackoverflow.com/q/29916736
has text: what is it happening now, always showing the message or always going to login page?
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/48150510
has text: Also, I've updated question with a 4th requirement to narrow down possible solutions. Thanks for your input, it has made me look better at the problem.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29996504
type: Comment

http://stackoverflow.com/comment/48285765
type: QuestionComment
has text: The lines will be the only thing drawn onto the canvas.
type: Comment
comment on: http://stackoverflow.com/q/29972238
score: 0

http://stackoverflow.com/comment/47894677
comment on: http://stackoverflow.com/a/29885093
type: Comment
has text: @user4833581 You need to uncomment `return true` in the `validate()` function, then it works. Otherwise it will return `undefined`, which has the same effect as `false` here.
score: 1
type: AnswerComment

mgwt
tags question: http://stackoverflow.com/q/29991207
tag name: mgwt
type: Tag

http://stackoverflow.com/q/29911516
has comment: http://stackoverflow.com/comment/47945153
has title: How to pass a link value from a HTML page to rest web service
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29911597
has body: If I have a HTML or a JSP page having list of sports like below. Tennis Football Hockey Cricket All these 4 should be a Link. If I click on any of them it should return some details wherever clicked. For this I need to pass this sport name to a REST client which will pass this as a parameter to a rest service. My question is how to pass the value of a link whichever clicked from HTML page to a Java application like we pass text box or check box values from HTML using the form action? Or is there any better approach, please suggest
type: Question
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/29912035
tagged with: user-interface
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47946295
tagged with: rest
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/29904100
score: 5
answer count: 1
tagged with: javascript
favorite count: 0
upvote count: 5
tagged with: node.js
type: AnsweredQuestion
downvote count: 0
has title: socket.io not reconnecting after a disconnect
tagged with: socket.io
type: Question
has answer: http://stackoverflow.com/a/29904294
accepted answer: http://stackoverflow.com/a/29904294
has body: I am developing a node.js application using socket.io to communicate between server and client. If the server faces any error, I send an error message to the client and I close the connection from both server and client. However when the client tries to reconnect, it is no longer able to connect to the server. My code server.js io.sockets.on('connection', function(socket) { /*Some code*/ stream.on('error',function(errormsg){ socket.emit('error',{txt: "Error!"}); socket.disconnect(); }); }); client.js var server_name = "http://127.0.0.1:5000/"; var socket = io.connect(server_name); socket.on('error',function(data){ console.log(data.txt); socket.disconnect(); }); function submitclick() { var text="hello"; if(socket.connected ==false) socket= io.connect({'forceNew': true}); console.log(socket.connected); } Status of socket.connected is false. I do not receive it on the server side either.

http://stackoverflow.com/q/29943352
downvote count: 0
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/29943595
has answer: http://stackoverflow.com/a/29943668
has comment: http://stackoverflow.com/comment/48007714
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/29943595
has body: I intend to re-use HTML DOM's create element method described in W3Schools for my form. function myFunction() { var btn = document.createElement("BUTTON"); var t = document.createTextNode("CLICK ME"); btn.appendChild(t); document.body.appendChild(btn); } Click the button to make a BUTTON element with text. Try it In the example above, a button is used to create a HTML element. How can I change this to use a href link (an tag) instead of a button's click event?
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/48041429
upvote count: 1
has comment: http://stackoverflow.com/comment/48041749
type: Question
possible better answer: http://stackoverflow.com/a/29943434
linked to: http://stackoverflow.com/q/134845
score: 1
has answer: http://stackoverflow.com/a/29943434
has comment: http://stackoverflow.com/comment/48041544
has comment: http://stackoverflow.com/comment/48038987
has title: Dynamically create element but use <a href> instead of a button onClick
answer count: 3

http://stackoverflow.com/comment/47861842
type: AnswerComment
has text: Thank you. Now columns horizontal positions differ by few pixels as described in https://github.com/free-jqgrid/jqGrid/issues/52
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29855739

http://stackoverflow.com/comment/48112494
type: AnswerComment
comment on: http://stackoverflow.com/a/29996273
score: 0
type: Comment
has text: put the button outside of Gridly and call $('.gridly').append(brick);

http://stackoverflow.com/comment/48058115
type: AnswerComment
comment on: http://stackoverflow.com/a/29969063
has text: Thanks! I did actually have it like that at one point. The isotope now works but I'm back to my main problem. It doesnt add the 'is-filtered' class like it should do. It adds the .isotope-hidden class but seems to stop functioning before the alert, which doesn't work either
type: Comment
score: 0

http://stackoverflow.com/comment/47984734
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/29929491
type: Comment
has text: It is a general question, not a specific one. I'm looking for points of view. Either technique would work. I could do a test but the whole point is to avoid spending the time on a test if people already have experience in this matter.

http://stackoverflow.com/a/29958102
downvote count: 0
has comment: http://stackoverflow.com/comment/48036967
type: Answer
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/29958075
has body: var dividerval = (currentval/targetval); targetval is undefined. You might want to do: var dividerval = (currentval/getusertarget);

http://stackoverflow.com/q/29937114
answer count: 3
downvote count: 0
favorite count: 0
tagged with: symfony
tagged with: url-routing
has answer: http://stackoverflow.com/a/33263577
type: AnsweredQuestion
tagged with: twig
linked to: http://stackoverflow.com/q/14596673
has title: How to pass locale using FOSJsRoutingBundle
type: Question
score: 5
has answer: http://stackoverflow.com/a/29938491
upvote count: 5
tagged with: javascript
has body: I installed FOSJsRouting but my route need _locale parameter. How can I do that in JS ? Is there a way to get the locale in js ? In twig, I can do app.request.attributes.get('_locale') but in JS, I don't find any documentation. AJAX $.ajax({ type : 'get', url : Routing.generate('get_credits', {'_locale': app.request.attributes.get('_locale'), 'amount' : amount, 'monthNumber' : month }), beforeSend : function(){ console.log('loading'); }, success: function(data){ }, error : function(){ } });
possible better answer: http://stackoverflow.com/a/29939073
accepted answer: http://stackoverflow.com/a/29938491
has answer: http://stackoverflow.com/a/29939073

http://stackoverflow.com/q/29865907
has answer: http://stackoverflow.com/a/29865970
tagged with: http://stackoverflow.com/tag/html
downvote count: 1
has comment: http://stackoverflow.com/comment/47856782
answer count: 4
favorite count: 0
has answer: http://stackoverflow.com/a/29865984
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47856781
type: Question
has title: change ajax url based on value of select option
has answer: http://stackoverflow.com/a/29866635
upvote count: 1
accepted answer: http://stackoverflow.com/a/29865970
possible better answer: http://stackoverflow.com/a/29865976
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29865976
has body: I have a form with a select box with three selections Option1 Option2 Option3 Each selection has its own php file option1.php option2.php option3.php Based on the selection I would like for the Ajax url to change to the respective php file Ajax part $.ajax({ type: "GET", url: "option1.php",
tagged with: ajax
score: 0

http://stackoverflow.com/comment/47864767
type: QuestionComment
has text: You could try my module for chaining promises: https://github.com/rangelier/promise
comment on: http://stackoverflow.com/q/29869700
score: 0
type: Comment

http://stackoverflow.com/a/29887481
has body: Given your actual code, it looks like you want var timerID = setInterval("CountdownTimer()",1000); to become var timerID; setTimeout(function(){ timerID = setInterval("CountdownTimer()",1000) }, n); // Where n is the number of milliseconds to wait
has comment: http://stackoverflow.com/comment/47900710
has comment: http://stackoverflow.com/comment/47899156
score: 0
type: AcceptedAnswer
type: Answer
answers question: http://stackoverflow.com/q/29887352
accepted answer of: http://stackoverflow.com/q/29887352

http://stackoverflow.com/comment/48116895
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29998775
score: 0
has text: @ShaunakD it still works, what does that mean btw?

http://stackoverflow.com/q/29891513
accepted answer: http://stackoverflow.com/a/29967149
tagged with: jquery-ui
tagged with: javascript
tagged with: jquery
has title: How can I allow resizable() to increase size beyond initial size?
type: AnsweredQuestion
has body: Is there a way to decouple css's max-height and max-width from the limits used by JQuery-UI's resizable()? I have a div that, when initially created, should be limited in size: .my-div { max-width: 40em; max-height: 50%; } I want it to be resizable beyond its initial size, but unfortunately resizable() seems to use these attributes to also determine the maximum size for resizing. Trying to override that by passing maxHeight and maxWidth options doesn't work. Is there a way to solve this, or some other-work around that will allow me to limit the initial size of the div and later on allow it to increase via resizable()? I've found an identical question on jquery.com, but it's unanswered there. A small reproducing jsfiddle - how can I allow resizing the div to see the ".com" suffix, while keeping only the "stackoverflow" word visible at first?
has answer: http://stackoverflow.com/a/29891919
type: Question
has answer: http://stackoverflow.com/a/29967149
answer count: 2
tagged with: css
possible better answer: http://stackoverflow.com/a/29891919
score: 0
has comment: http://stackoverflow.com/comment/47923276

http://stackoverflow.com/a/29927114
answers question: http://stackoverflow.com/q/29926821
type: Answer
upvote count: 1
has body: If the a controllerTwo needs to call the same function as controllerOne, you may want to create a service to handle it. Angular Services - they are accessible throughout your program through dependency injection. var app = angular.module('myAppModule', []) .controller('controllerOne', ['$scope', 'Hello', function($scope, Hello){ console.log(Hello.helloWorld() + ' controller one'); }]) .controller('controllerTwo', ['$scope', 'Hello', function($scope, Hello){ console.log(Hello.helloWorld() + ' controller two'); }]) .factory('Hello', [function() { var data = { 'helloWorld': function() { return 'Hello World'; } } return data; }]); Hope this helps!
score: 1
downvote count: 0

http://stackoverflow.com/q/29980136
type: Question
has comment: http://stackoverflow.com/comment/48079889
upvote count: 0
score: -2
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
has title: Can't get data attribute from a selected option in a dynamically built table
has answer: http://stackoverflow.com/a/29980729
tagged with: http://stackoverflow.com/tag/html
type: UnansweredQuestion
downvote count: 2
tagged with: enums
has comment: http://stackoverflow.com/comment/48079906
has body: I'm building a table and populating it with a column that has an enum drop down list. I want to get the attribute data-yogaspaceid of the select element when it has been changed. I can trigger the change event but the attribute 'data-yogaspaceid' that I'm trying to retrieve keeps returning as 'undefined' Here is the select tag and javascript $(function() { $(document).on('change', '#statusDropDown', function() { // yogaSpaceid keeps coming up undefined var yogaSpaceId = $("#statusDropDown").find(':selected').attr('data-yogaspaceid'); }); }); Listed Unlisted The variable yogaSpaceId should have the value 12 but instead it is undefined

http://stackoverflow.com/comment/48121514
score: 0
comment on: http://stackoverflow.com/q/30000447
type: Comment
type: QuestionComment
has text: But again, how does it help? This may be a massive improvement - if it's possible - I just don't see how knowing where the mouse is, with greater accuracy, helps given that the medium in which it's displayed can't display that pointer any more accurately, or convey movements more specifically, than it already does. This seems less of a useful resource and more an inevitable means of consuming yet more CPU time.

http://stackoverflow.com/a/29886282
type: Answer
downvote count: 0
score: 1
has body: $('tr').each(function(){ $this=$(this).find('td &gt; div'); $this.each(function(){ var gettext= $(this).text(); $(this).html('&lt;input type="text" value="'+gettext+'"/&gt;'); }); }); I think this is what you want.
accepted answer of: http://stackoverflow.com/q/29886068
has comment: http://stackoverflow.com/comment/47896922
answers question: http://stackoverflow.com/q/29886068
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/comment/48101979
comment on: http://stackoverflow.com/q/29991186
score: 0
has text: @Pointy++: it's worth noting though that using regex might be a better fit here, otherwise we need to use workarounds whenever our matching might get more complicated (most common: case-insensitive matching - with `.indexOf()` we'd have to use `.toLowerCase()` on all strings matched both with and against). If @Pointy comment is not enough, fiddle would be much appreciated - then it would be much easier for us to alter given code to match this specific use-case.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47995621
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29923043
has text: @vtz I spend a lot of years in coding forums and I know when something is wrong. I had many moments where I googled something and came to stackoverflow and loved this page, because the quality is very high here. But there was many threads that lacked in quality and was closed.. so I didn't got an answer and this made me sad, because if the quality was a little bit better, the thread wouldn't be closed. But it's ok for now, a question was edited in the main part. We can stop the discussion :)
score: 0

http://stackoverflow.com/q/29941794
score: 0
has answer: http://stackoverflow.com/a/56021822
type: UnansweredQuestion
has body: My requirement is to create N type of markers in leaflet. The list is huge that can not be fit in map area. I want something similar to this : http://blog.georepublic.info/2012/leaflet-example-with-wfs-t/ There is some problem in the above given example that while zooming in the marker moves from their original position. Please suggest any fix for this or any other alternative to place the controls outside the map like this example.
tagged with: leaflet
has comment: http://stackoverflow.com/comment/74348161
type: Question
answer count: 2
tagged with: javascript
has answer: http://stackoverflow.com/a/29956849
has title: Placing leaflet controls outside map

http://stackoverflow.com/q/29904903
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29905882
has title: react newforms, throw error on server response
score: 0
type: AnsweredQuestion
has body: I am using react newforms for react form handling. I find it really good but couldn't figure out how to trigger an error on a given input field if the server responses with an error. For example you got a login form and you decide not to show an alert box under the form but throw a custom error that newforms catches and displays an error message Username does not exist right below the input field. (like it does on clientside validation)
tagged with: newforms
type: Question
has answer: http://stackoverflow.com/a/29905882
tagged with: reactjs
answer count: 1

http://stackoverflow.com/q/29960206
has body: The goal: I want a create a simple website that shows your levitation based on your adress (found through your IP) or the entered geocode. Where I'm stuck: I'm using http://ipinfo.io/ to track the users geolocation through the IP. It returns the geolocation as the response.loc (shown in the code below). I then want to add that geolocation to google maps and have is as the default value. var geocoder; var map; var infowindow = new google.maps.InfoWindow(); var marker; function initialize() { geocoder = new google.maps.Geocoder(); var latlng = new google.maps.LatLng(59.6162,16.5528); var mapOptions = { zoom: 13, center: latlng, mapTypeId: 'hybrid' } map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions); } function codeLatLng() { var input = document.getElementById('latlng').value; var latlngStr = input.split(',', 2); var lat = parseFloat(latlngStr[0]); var lng = parseFloat(latlngStr[1]); var latlng = new google.maps.LatLng(lat, lng); geocoder.geocode({'latLng': latlng}, function(results, status) { if (status == google.maps.GeocoderStatus.OK) { if (results[1]) { map.setZoom(15); marker = new google.maps.Marker({ position: latlng, map: map }); infowindow.setContent(results[1].formatted_address); infowindow.open(map, marker); } else { alert('No results found'); } } else { alert('Geocoder failed due to: ' + status); } }); } google.maps.event.addDomListener(window, 'load', initialize); // get geocode from IP // $.get("http://ipinfo.io", function (response) { $("#ip").html("Your IP: " + response.ip); $("#address").html("Location: " + response.city + ", " + response.region); $("#details").html("Location: " + response.loc); }, "jsonp"); html, body { height: 100%; margin: 0px; padding: 0px } #panel { position: relative; top: 5px; left: 50%; margin-left: -180px; z-index: 5; background-color: #fff; padding: 5px; border: 1px solid #999; width: 350px; } #latlng { width: 225px; } #map-canvas { height: 50%; width: 50%; margin-left: 25%; margin-top: 5%; } .cont…
type: Question
tagged with: google-maps
tagged with: javascript
tagged with: jquery
score: 0
has title: How do I Get and Set geolocation to google maps?
has answer: http://stackoverflow.com/a/29960365
tagged with: http://stackoverflow.com/tag/html
answer count: 1
type: UnansweredQuestion
tagged with: css

http://stackoverflow.com/a/30193157
has body: Before you get your PartnerDetail.getPartnerId();, set it's value. PartnerDetail.setPartnerId(10); var p = PartnerDetail.getPartnerId(); console.log(p) // 10 Demo: http://jsfiddle.net/zLexLvza/1/
type: Answer
score: 0
answers question: http://stackoverflow.com/q/29848908

http://stackoverflow.com/a/29954003
answers question: http://stackoverflow.com/q/29953781
score: 1
accepted answer of: http://stackoverflow.com/q/29953781
upvote count: 1
type: AcceptedAnswer
type: Answer
has body: As mentioned in my comment, it depends on what you want to do with n ultimately. If you just want it to show the user a message, you can update the DOM once you've calculated this value. Your current example doesn't allow the user to delete text after they've typed/pasted it in. A better example would be stateless, i.e. don't compare n to itself, as in my example below: var t = document.getElementById('msg'); var splitSize = 10; var n = 1; t.addEventListener('input', function() { var nextN = 1; if (t.value.length &gt; 0) { nextN = Math.ceil(t.value.length / splitSize); } if (n !== nextN) { n = nextN; var label = document.getElementById('label'); if (n === 1) { label.innerHTML = ''; } else { label.innerHTML = 'The message will be split into ' + n + ' parts'; } } }); &lt;p id="label"&gt;&lt;/p&gt; &lt;textarea id="msg"&gt;&lt;/textarea&gt;
downvote count: 0

http://stackoverflow.com/a/29994480
answers question: http://stackoverflow.com/q/29994002
has comment: http://stackoverflow.com/comment/48109943
accepted answer of: http://stackoverflow.com/q/29994002
score: 0
has body: I'd say post the rest of your code. JSFiddle showing your code working before: old after: insert old
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/comment/47886667
score: 0
type: QuestionComment
has text: why not just change the php to do the images/radios instead?
type: Comment
comment on: http://stackoverflow.com/q/29856674

http://stackoverflow.com/a/29922173
upvote count: 1
score: 1
downvote count: 0
answers question: http://stackoverflow.com/q/29921951
type: Answer
has body: Why mix float left and right? Just saying float: left; on all clear: both; and margin-right: 10px; on your "leftcolumn" http://jsfiddle.net/mga6f/421/

http://stackoverflow.com/comment/48062989
comment on: http://stackoverflow.com/a/29968307
score: 0
type: AnswerComment
has text: It says `GET http://myapp.rhcloud.com/socket.io-1.3.5.js 503 (Service Temporarily Unavailable)` then. But I ran the server with `forever server.js`
type: Comment

http://stackoverflow.com/a/29986517
has body: Your mistake is the way you are calling Tabs: var tabs = new Tabs(); tabs.render(); And Table: var table = new Table(); The reason for your issue is that this refers to the global object (window) when the function is not invoked with the new operator. The first thing Tabs does is call Table, and both set this.render. When invoked with new each will have its own context and therefore its own render method.
has comment: http://stackoverflow.com/comment/48092521
type: AcceptedAnswer
score: 0
upvote count: 1
type: Answer
downvote count: 1
accepted answer of: http://stackoverflow.com/q/29986470
answers question: http://stackoverflow.com/q/29986470

http://stackoverflow.com/comment/94521120
has text: @DanielBudick Thanks! I've added that to the answer. Great suggestion.
type: Comment
score: 2
type: AnswerComment
comment on: http://stackoverflow.com/a/29951380

http://stackoverflow.com/q/29881949
has title: How to attach a content script to single tab?
answer count: 0
tagged with: sdk
type: Question
has comment: http://stackoverflow.com/comment/47888273
has body: var data = require("sdk/self").data; var tabs = require("sdk/tabs"); tabs[0].on('open', function(tab) { worker = tab.attach({ contentScriptFile: [data.url("jquery.min.js"), data.url("pagemod.js")] }); }); .when trying to use worker to send smth to scriptFile, like: worker.port.emit("doSmth", "message") i have an error "worker is undefined"... there is a syntax problem, i guess.
score: 0
has comment: http://stackoverflow.com/comment/47888051
tagged with: javascript
tagged with: mozilla
type: UnansweredQuestion

http://stackoverflow.com/a/29940512
upvote count: 6
downvote count: 1
type: Answer
has comment: http://stackoverflow.com/comment/48001982
accepted answer of: http://stackoverflow.com/q/29940467
answers question: http://stackoverflow.com/q/29940467
has comment: http://stackoverflow.com/comment/48001891
has body: data: $('#form').serialize(), should become data: $('form').serialize(), You are referencing to the wrong DOM item
score: 5
type: AcceptedAnswer

http://stackoverflow.com/a/70976847
has comment: http://stackoverflow.com/comment/125473014
type: Answer
downvote count: 2
upvote count: 2
score: 0
has body: "reload" and "refresh" aren't JavaScript functions. Try using the following code: function reload() { window.location.refresh(); }
answers question: http://stackoverflow.com/q/29884654

http://stackoverflow.com/q/29859542
has comment: http://stackoverflow.com/comment/47845228
has answer: http://stackoverflow.com/a/29882725
type: Question
tagged with: caret
upvote count: 5
answer count: 2
has comment: http://stackoverflow.com/comment/47844996
downvote count: 0
tagged with: javascript
tagged with: jquery
has title: Handle caret position in content editable div
favorite count: 0
has comment: http://stackoverflow.com/comment/47845013
tagged with: angularjs
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/30412378
score: 5
has body: I have this content editable div in HTML And heres my jquery code var rxp = new RegExp("(([0-9]+\.?[0-9]+)|([0-9]+))", "gm"); $('#TextOnlyPage').keyup(function(e){ if(e.keyCode == 13){ e.preventDefault(); $('#TextOnlyPage').children().each(function() { if ( $(this).is("div") ) { $(this).contents().unwrap(); }}); $('#TextOnlyPage').append(" "); } $('#TextOnlyPage').children().contents().unwrap(); var $this = $(this); var content = $this.html(); $this.html(content.replace(rxp, "$1"));}); Problem is the caret position, because when it apply span tags around numbers in string.replace method then cursor goes to the start of the content editable div. Also it can't goes to next line while I press enter key. I know I can handle it through range and selection objects, but can't find a useful resource to understand how these objects works. Kindly either provide me solution for this problem and it will be better if the solution in angularjs, or provide me a resource where I can understand range and selection objects with working examples.

http://stackoverflow.com/q/29899098
answer count: 1
downvote count: 1
tagged with: drop-down-menu
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has body: I need a dropdown list based on javascript source code working in HTML code. I have a code but it's based on html dropdown list but I need a javascript one. I worked on a code and i'm sharing it below. Sample: function runList(){ var select = document.getElementById('custom_state'); select.options[select.options.length] = new Option('Adres 1', 'Adres 1'); select.options[select.options.length] = new Option('Adres 2', 'Adres 2'); select.options[select.options.length] = new Option('Adres 3', 'Adres 3'); select.options[select.options.length] = new Option('Adres 4', 'Adres 4'); } var datafield; function getQuerystring(key) { var work = key.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]"); var regex = new RegExp("[\\?&]"+work+"=([^&#]*)"); var qs = regex.exec(window.location.href); if (qs == null) return null; return qs[1]; } function IsOptionInDropDown(value) { switch (value) { case "d.c.": value="dc"; break; default: break; } var lvalue=value.toLowerCase(); var dropdown = document.getElementById("custom_state"); var options = dropdown.options; var i = 0; for(i=0;i<options .length;i++) { if (options[i].value.toLowerCase() == lvalue || options[i].text.toLowerCase() == lvalue) { dropdown.value = options[i].value; SetOtherVisible(false); return true; } } return false; } function DropDownChanged(value) { if (value !== null && value!=="") { if (value.charAt(0)=='!') { StateChanged(""); return; } if (value=="other") { SetOtherVisible(true); return; } else { SetOtherVisible(false); } var os = document.getElementById("other_state"); os.value = value; StateChanged(value); } } function TextBoxChanged(value) { StateChanged(value); IsOptionInDropDown(value); return true; } function StateChanged(value) { datafield.setValue(value); } function SetOtherVisible(visibility) { var ddcell = document.getElementById("cell_dd"); var textcell = document.getElementById("cell_tb"); if (visibility) { ddcell.style.width="50%"; textcell.style.display="table-cell"; textcell.style.width="50%"; } else { t…
upvote count: 0
has answer: http://stackoverflow.com/a/29915547
has comment: http://stackoverflow.com/comment/47921194
type: Question
has comment: http://stackoverflow.com/comment/47921122
has comment: http://stackoverflow.com/comment/47921105
tagged with: javascript
score: -1
has title: Javascript dropdown list in html source code

http://stackoverflow.com/q/29900551
answer count: 3
has answer: http://stackoverflow.com/a/33844402
tagged with: button
has answer: http://stackoverflow.com/a/56626397
has title: How to add a download video button to HTML5 player?
tagged with: download
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: video
type: Question
has body: I'm working on this site: http://animevid-episode.webflow.io/ I'd like to give users the possibility to download the video I put in the player. Do you know how to add a "download video" button to this player or any other generic HTML5 video player? Actually, I can only find on Google about tools to download video and how to prevent downloading. I guess it's possible with JavaScript, but really can't find how. Any suggestions or tips are welcome.
tagged with: javascript
has answer: http://stackoverflow.com/a/29965788
score: 0

http://stackoverflow.com/comment/47992503
has text: do you already have the connection to database, please provide more info
score: 0
comment on: http://stackoverflow.com/q/29935078
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29949020
has body: ! Latest I've tried. I put it in my head.php which I just include. I'll send over my files if you'd want to see them personally. Directory of my folder Main_Folder -Main_files -- JS_Folder ---- Js Files -- Includes_Folder ---- Head.php is here Whole sidebar: Dashboard Employees Students Scheduling Foreign Languages ESL Local Summer Workshops Enroll Foreign Languages ESL Local Summer Workshops class="sub-menu" is needed to make it dropdown menus drop. So the active version is class="sub-menu active". In case of a 2 level dropdown menu, both the main bar and sub bar are to be set to active. This is my side bar. Overview Employees I've tried the following below but none works on my case: Update class attribute based on page URL https://css-tricks.com/snippets/jquery/add-active-navigation-class-based-on-url/ First sample code $('.menu li a').each(function(){ //check thru all elements inside inside .menu var pagename= location.pathname.split('/').pop(); // get current pages filename (just filename) if($(this).prop("href") == pagename){ $('.menu li').removeClass("active"); // remove all active class $(this).parent("li").addClass("active"); //put active in parent of which is } }); In the first one, I've changed the menu to collapse navbar-collapse navbar-ex1-collapse and collapse only but neither works. In the second sample code, I've tried doing the following: $(function() { $('nav a[href^="/' + location.pathname.split("/")[2] + '"]').addClass('active'); }); I put [2] since I'm currently in the localhost. So it would be localhost/folder_name/index.php. I also tried putting "/index.php"/ but when I click that it directs me to localhost/index.php instead of localhost/folder_here/index.php. Third sample code jQuery(function($) { var path = window.location.href; // because the 'href' property of the DOM element is the absolute path $('ul a').each(function() { if (this.href === path) { $(this).addClass('active'); } }); }); Still doesn't work. I've change $('ul a) to $('div ul …
has comment: http://stackoverflow.com/comment/48018981
answer count: 3
downvote count: 0
has answer: http://stackoverflow.com/a/29950875
favorite count: 0
linked to: http://stackoverflow.com/q/17576484
upvote count: 2
has answer: http://stackoverflow.com/a/29949188
type: UnansweredQuestion
tagged with: php
score: 2
has answer: http://stackoverflow.com/a/29949101
type: Question
has comment: http://stackoverflow.com/comment/48019119
has title: javascript - update class based on url
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/29975975
answer count: 2
possible better answer: http://stackoverflow.com/a/30025976
accepted answer: http://stackoverflow.com/a/29976388
has body: I have got a question to a consistent but also counterintuitive behavior of handlebars.js. When a member function of a variable of the context is referenced from the template, it is called in the resolving process with the current context set to this. This is the same behavior as it is with (block) helpers and therefore it is somehow consistent. When we are inside an each or with block, this is also exactly what one would expect when writing the context / model. Here is a toy example: var a = { name: "Alice", greet: function () { return "Hello " + this.name; } }; var resultA = a.greet(); // resolves to "Hello Alice" var templateB = Handlebars.compile("{{person.greet}}"); var resultB = templateA({ person: a }); // resolves to "Hello undefined" var templateC = Handlebars.compile("{{#with person}} {{greet}} {{/with}}"); var resultC = templateB({ person: a }); // resolves to "Hello Alice" http://jsfiddle.net/mischmit/2papau0L/9/ Currently I use the workaround using with - but I don't like it at all. Is there any better way of accomplishing this behavior (besides the obvious replacing this by that in the member function)?
downvote count: 0
tagged with: templates
favorite count: 0
has answer: http://stackoverflow.com/a/29976388
tagged with: handlebars.js
score: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/30025976
type: Question
has title: Binding of member functions in Handlebar context entries
tagged with: javascript
upvote count: 2

http://stackoverflow.com/comment/47960993
type: Comment
type: QuestionComment
has text: @DontVoteMeDown not to mention on this very site...
score: 0
comment on: http://stackoverflow.com/q/29919875

http://stackoverflow.com/comment/48020644
has text: okay great! what about " if there is 2.5 million(for instance) different localstorage keys with only one character as the keyname, would that equal one key with a keyname of 2.5 million characers in space?"
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29949360

http://stackoverflow.com/comment/48058967
type: QuestionComment
has text: You really need a smart container (like isotope or masonry) to layout items with any intelligence. A D.I.Y. alternative is using a table with rolspan and colspans set.
comment on: http://stackoverflow.com/q/29969638
score: 0
type: Comment

http://stackoverflow.com/q/29996350
has answer: http://stackoverflow.com/a/54058496
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/44874289
has answer: http://stackoverflow.com/a/30007684
tagged with: html5-audio
has answer: http://stackoverflow.com/a/44874289
type: Question
has answer: http://stackoverflow.com/a/79083330
has title: Speech Recognition - Run continuously
has answer: http://stackoverflow.com/a/54643781
tagged with: javascript
score: 27
accepted answer: http://stackoverflow.com/a/30007684
upvote count: 27
downvote count: 0
tagged with: speech-recognition
favorite count: 0
answer count: 5
tagged with: http://stackoverflow.com/tag/html
has body: I'm trying to create an HTML5-powered voice-controlled editor using the Speech Recognition API. Currently, the problem is when you start recording, it only lasts for a certain amount of time (basically until the user stops talking). I can set continuous and interimResults to true, but that doesn't keep it recording forever. It still ends. I can also tell it to start again during the end event, but then it asks for permission every time, which is highly disruptive. Is there a way to allow it to go continuously while only having to ask a user once?

http://stackoverflow.com/a/35093350
has comment: http://stackoverflow.com/comment/60529192
has body: I had problem with a similar presentation, in that it appeared to load the module but I didn't get validation of the input. I found my problem was that the intlTelInput.js wasn't fully loaded when I tried to access the input field that was using it. I tested it by allowing the page to fully load, and the validation worked as expected. Any time I used the quickly, however, validation didn't work. Further, the getNumber method would also return "" even if the input field had a value. Check two things: 1) Is intlTelInput.min.js fully loaded when you use the field? If not, delay access to the field until the script is loaded. 2) Is the path for utilScript correct? This library is required for validation. BTW, when the validation code is working properly, the field contents will format in the style of the country you have selected from the 'flags' dropdown. For example, when I select "US" my default format is (202) 555-1212
has comment: http://stackoverflow.com/comment/58562773
score: 1
upvote count: 2
downvote count: 1
type: Answer
has comment: http://stackoverflow.com/comment/60526118
answers question: http://stackoverflow.com/q/29886381
has comment: http://stackoverflow.com/comment/58497984

http://stackoverflow.com/comment/47878432
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29877016
score: 1
has text: any particular reason you want to use js/jquery? This can be achieved with css :before and :last-child psuedoselectors

http://stackoverflow.com/q/29980920
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has body: question: how/where to send HTML objects from individual users to common (accessible) database? how/where to host? context: In a browser game, the states of many in-game objects constantly change. These states are useful to know, and you can go check the objects to see their states in plain HTML, but it is costly, in terms of time and in-game resources. Many players cooperate, each checking various objects and reporting their findings, but there is a lot of overhead (typing) involved, and it is generally difficult to organize. I want to write code that will eliminate the overhead AND organize the data. It will gather HTML data from individual users, as they encounter in-game objects, and send the latest state of each object to a common database, where it will be time-stamped and organized, available for participating user to query/view. But where/how can I store such a database? Is there a utility already built into chrome extensions, for this purpose?
type: UnansweredQuestion
tagged with: hosting
has answer: http://stackoverflow.com/a/29987092
type: Question
has title: chrome extension: where/how to host user-contributed data?
tagged with: javascript
score: 0
tagged with: google-chrome-extension

http://stackoverflow.com/q/29988770
has comment: http://stackoverflow.com/comment/48097009
score: 2
downvote count: 0
tagged with: wordpress
has comment: http://stackoverflow.com/comment/48102203
tagged with: post
type: Question
upvote count: 2
has title: $.post is not working in combination with $J = jQuery.noConflict();
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
has body: I am having a problem with posting data from javascript to php.I am using the $.post method, though due to conflicts with wordpress I am alos using $J = jQuery.noConflict(). Therefore consequently I have the following, in javascript: $J = jQuery.noConflict() x=1 $J.post('/the directory',{x: x}, function(data){ }); alert($J.cookie("y")); In php I have: if(isset($_POST['x'])) { setcookie("y", 1); } else{ setcookie("y", -1); } Every time I get to see that y = -1, indicating that x in php is not found. What am i doing wrong? What did I try so far, which all did not work: Connecting the post to different events (when submit is pressed, or when page is loaded) Putting the alert ($J.cookie("y")) between the brackets which are behind the function (data) Trying to remove the J after the $ or adding them up front in php I am a bit afraid that the problem of the post is because I added $J = jQuery.noConflict(). Though I used many other functionality and then I did not have any problem, do you maybe know the solution or can you help me into the right direction? Thanks in advance!
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29988859
tagged with: php
has comment: http://stackoverflow.com/comment/48096911

http://stackoverflow.com/a/29846992
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29845877
has body: CasperJS has the mouse module which has the move() function. It either takes a coordinate or a selector. CasperJS will use the underlying PhantomJS sendEvent() function to create a native event. casper.mouse.move(someCSSSelector); or var x = require('casper').selectXPath; ... casper.mouse.move(x(someXPathExpression)); It may be necessary to wait a little after moving the mouse if the page loads something after that: casper.mouse.move(someCSSSelector); casper.waitUntilVisible(expectedElementSelector, function(){ this.click(expectedElementSelector); }); Almost all functions work with XPath expressions as well as with CSS selectors.
upvote count: 5
type: Answer
downvote count: 0
score: 5
accepted answer of: http://stackoverflow.com/q/29845877

http://stackoverflow.com/q/29935278
has comment: http://stackoverflow.com/comment/48201801
has body: At the moment I am coding in sharepoint(office 360), and I am having so many issues with the site considering that its my first week to use it. First of all when i tried to use a < script > tag in my codes, sharepoint seems to block this, and does not recognize my scripts. I know that there is a way to unblock the < script > tag, but I want to concentrate on the coding part. OK, now to the issue, at the moment I am using every codes that I can gather to put < script > tags inside my javascript/jquery. I am putting my codes inside an onclick event, considering that the site does not allow me to use < script > tag. I tried to use this: <input type="hidden" name="new_workflow_doc_handler" onclick=" Unfortunately all the codes i have tried was no success. and one of the big issues that I dont like about this is that when inside the onclick event I cant use double qoutes. If you are wondering why I a want to put a < script > tag inside the javascript, as what I have said in the first place, sharepoint does not allow me to use < script > tags and I want to use script tag because I want to source something. like this: What syntax do i use to put a < script > tag inside my onclick event? or is there other ways to "src" without using the < script > tag in javascript/jquery on an onclick event. or is it possible, because sharepoint is kinda fussy when it comes to syntax coding. so many does and dont.
answer count: 0
type: UnansweredQuestion
type: Question
has title: tag inside a javascript or jquery (in Sharepoint (office 360))
tagged with: onclick
tagged with: src
score: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/47996946
tagged with: jquery

http://stackoverflow.com/comment/48123750
type: Comment
type: QuestionComment
has text: Also finding very odd that this has 3 upvotes when this is pretty broad.
comment on: http://stackoverflow.com/q/30000903
score: 0

http://stackoverflow.com/comment/47912821
score: 0
type: QuestionComment
has text: Do you have a live example of this?
type: Comment
comment on: http://stackoverflow.com/q/29894994

http://stackoverflow.com/comment/47954441
has text: Glad to know it worked.
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29912773

http://stackoverflow.com/a/29912013
score: 0
type: Answer
answers question: http://stackoverflow.com/q/29896917
has body: This is how the default editing works by default - the user has to click the "Save Changes" button to submit all changes to the server. You can do one of the following Set the autoSync option of the data source to true Use a different editing mode - for example inline. Handle the remove event of the grid and call this.dataSource.sync() to automatically sync the changes.

http://stackoverflow.com/comment/47847102
score: 0
type: QuestionComment
has text: does https://github.com/FREE-FROM-CMS/AutoComplete solve the autocomplete problem? Ask me for help if you need it, because I'm still working on it a little bit.
type: Comment
comment on: http://stackoverflow.com/q/29847281

http://stackoverflow.com/comment/48010533
score: 0
type: Comment
type: QuestionComment
has text: so it should be given to the generated code manually..?
comment on: http://stackoverflow.com/q/29944248

http://stackoverflow.com/comment/48099111
has text: Maybe the „only once” for ngRepeat is valid only when in ngRepeat we use another custom directive?
type: Comment
comment on: http://stackoverflow.com/a/29989258
score: 0
type: AnswerComment

http://stackoverflow.com/q/29944918
answer count: 3
has answer: http://stackoverflow.com/a/29945277
tagged with: angularjs
tagged with: angular-resource
has body: I have a form that uses &lt;input type="datetime-local" ng-bind="course.endDate".. and sets a variable of the model. Before sending the date to the server I've to convert the date 2015-04-04T22:00:00.000Z to a integer given by the getTime(). In the controller i added this: course.endDate = course.endDate.getTime(); it works for the server side but angular complains in the console with this error. (as said, it works, but I would like to avoid errors) Error: [ngModel:datefmt] Expected `1325458800000` to be a date http://errors.angularjs.org/1.3.15/ngModel/datefmt?p0=1325458800000 at REGEX_STRING_REGEXP (angular.js:63) at Array.&lt;anonymous&gt; (angular.js:19938) at Object.ngModelWatch (angular.js:23419) at Scope.$get.Scope.$digest (angular.js:14300) at Scope.$get.Scope.$apply (angular.js:14571) at done (angular.js:9698) at completeRequest (angular.js:9888) at XMLHttpRequest.requestLoaded (angular.js:9829) How can i do then? I had the idea of adding some fields that are used in the form (formEndDate) and convert to another one (endDate = formEndDate.getTime()) for the server side, but in this way the server refuse the call since the parameter formEndDate is not allowed, and if I remove the formEndDate then everything breaks. additional problem: When i fetch data from the server I have an integer that needs to be converted into a date to be used in the form. so I've to convert the date also before allowing an edit. how can I do this? (the data fetched are into an array, so would be terrific to have the conversion without having to iterate on the whole array) solution thanks to the two answers (I set correct the first that came) I also (somehow) solved the problem of the form when editing. I did so by creating an extra field and use it for the form when editing (I do inline editing). I created a gist here
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29945128
accepted answer: http://stackoverflow.com/a/29945128
possible better answer: http://stackoverflow.com/a/29945277
has answer: http://stackoverflow.com/a/29945308
type: Question
has title: AngularJS convert Date to getTime() before sending to server
has comment: http://stackoverflow.com/comment/48010863
tagged with: javascript
score: 0

http://stackoverflow.com/q/29857179
answer count: 2
has answer: http://stackoverflow.com/a/29900181
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/32799410
tagged with: android
possible better answer: http://stackoverflow.com/a/32799410
favorite count: 0
accepted answer: http://stackoverflow.com/a/29900181
upvote count: 1
tagged with: titanium
type: AnsweredQuestion
score: 1
has title: Titanium Android app crashes upon updating ScrollableView
has body: First of all: everything works exactly as intended in iOS. The issue I believe is some Java object generated by titanium isn't getting a parameter that updates the size of the scrollable view. Error log: [WARN] : ResourceType: No known package when getting name for resource number 0xffffffff [WARN] : dalvikvm: threadid=1: thread exiting with uncaught exception (group=0xa4d57b20) [ERROR] : TiApplication: (main) [674,5584] Sending event: exception on thread: main msg:java.lang.IllegalStateException: The application's PagerAdapter changed the adapter's contents without calling PagerAdapter#notifyDataSetChanged! Expected adapter item count: 1, found: 0 Pager id: ffffffff Pager class: class ti.modules.titanium.ui.widget.TiUIScrollableView$1 Problematic adapter: class ti.modules.titanium.ui.widget.TiUIScrollableView$ViewPagerAdapter; Titanium 3.5.0,2015/01/12 15:33,0014f83 [ERROR] : TiApplication: java.lang.IllegalStateException: The application's PagerAdapter changed the adapter's contents without calling PagerAdapter#notifyDataSetChanged! Expected adapter item count: 1, found: 0 Pager id: ffffffff Pager class: class ti.modules.titanium.ui.widget.TiUIScrollableView$1 Problematic adapter: class ti.modules.titanium.ui.widget.TiUIScrollableView$ViewPagerAdapter [ERROR] : TiApplication: at android.support.v4.view.ViewPager.populate(ViewPager.java:962) [ERROR] : TiApplication: at android.support.v4.view.ViewPager.populate(ViewPager.java:914) [ERROR] : TiApplication: at android.support.v4.view.ViewPager.onMeasure(ViewPager.java:1436) [ERROR] : TiApplication: at android.view.View.measure(View.java:16497) [ERROR] : TiApplication: at org.appcelerator.titanium.view.TiCompositeLayout.constrainChild(TiCompositeLayout.java:398) [ERROR] : TiApplication: at org.appcelerator.titanium.view.TiCompositeLayout.onMeasure(TiCompositeLayout.java:278) [ERROR] : TiApplication: at android.view.View.measure(View.java:16497) [ERROR] : TiApplication: at org.appcelerator.titanium.view.TiCompositeLayo…
type: Question

http://stackoverflow.com/a/29945479
score: 0
answers question: http://stackoverflow.com/q/29944622
type: Answer
has body: As KidA said in the comment try this: console.log(jqXHR.status); Also, just make sure you are pulling from the right destination (url, listname, etc.) along with the proper data type pull (POST, GET, UPDATE, DELETE, etc.)

size
type: Tag
tag name: size
tags question: http://stackoverflow.com/q/29975421

http://stackoverflow.com/comment/47831402
type: AnswerComment
comment on: http://stackoverflow.com/a/29852466
type: Comment
has text: Ah okay, that makes sense. Thank you both for clarifying.
score: 0

http://stackoverflow.com/comment/48115450
has text: daspek-thank you for the reply. "Mobile or desktop client app" is set to No- it is a web app. Target domain is blank, "restrict JWT issuing" is No, "redirect urls" is set to http://www.myname.com.au/redirect.html - which is a page on the domain. Still no joy.
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29973283

http://stackoverflow.com/q/29938085
has comment: http://stackoverflow.com/comment/47998691
answer count: 2
tagged with: api
accepted answer: http://stackoverflow.com/a/29938823
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: angularjs
score: 4
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47998298
possible better answer: http://stackoverflow.com/a/39761255
has answer: http://stackoverflow.com/a/39761255
has comment: http://stackoverflow.com/comment/47997542
tagged with: ruby-on-rails
has answer: http://stackoverflow.com/a/29938823
type: Question
has body: Situation: Using a Rails app, and $http.get in AngularJS to PULL the photos from Edmunds.com MEDIA API. TASK TRYING TO COMPLETE: ng-repeat through the vehicle photos. CONDITIONS: I am getting the response successfully and able to load one image, but how can I have it repeat through the photos array and do all the images. Apologies for unclear explanation, and any help appreciated. index.html: &lt;h1&gt; Wheel Tire Family &lt;/h1&gt; &lt;!-- CAR IMAGES --&gt; &lt;div ng-init="carImages"&gt; &lt;img src="https://media.ed.edmunds-media.com/{{carImages}}"&gt; &lt;/div&gt; catalog_controller.js: $scope.photos = {}; $scope.carImages = {}; //GET the edmunds media api for the //Make Model Year photos $http.get("https://api.edmunds.com/api/media/v2/audi/a3/2015/photos?title=&amp;category=exterior&amp;provider=oem&amp;width=1280&amp;shottype=S&amp;pagenum=1&amp;pagesize=10&amp;view=basic&amp;api_key=api_key&amp;fmt=json") .success(function (data) { var photos = data; console.log(photos); $scope.carImages = photos.photos[0].sources[0].link.href; console.log($scope.carImages); });
has title: AngularJS and Edmunds Media API to pull vehicle images
upvote count: 4

http://stackoverflow.com/comment/48086189
type: Comment
type: QuestionComment
has text: You should `console.log(IDCounter.match(IDCounter));` before the `var src = ...` line. My point was that you probably want to use `+ IDCounter.match(IDCounter)[someIndex]` instead of just `+ IDCounter.match(IDCounter)`, which is the same as `+ IDCounter.match(IDCounter).toString()`, which will produce something like `+ "[something,something,something]"`
comment on: http://stackoverflow.com/q/29957932
score: 0

http://stackoverflow.com/q/29859505
tagged with: slideshow
tagged with: javascript
has title: Using Kenb (Ken Burns) Slider on WordPress - How to make slides load in random order
answer count: 1
downvote count: 0
accepted answer: http://stackoverflow.com/a/29859783
tagged with: wordpress-theming
favorite count: 0
tagged with: slider
has body: I'm using the Kenb effect slider on WordPress. I would like the slides to load in a random order. Is that possible? I think this is the relevant js below. You can also see the site at: http://goo.gl/yBGZAk (function($){ $.fn.kenburns = function(options) { var $canvas = $(this); var ctx = this[0].getContext('2d'); var start_time = null; var width = $canvas.width(); var height = $canvas.height(); var image_paths = options.images; var display_time = options.display_time || 7000; var fade_time = Math.min(display_time / 2, options.fade_time || 1000); var solid_time = display_time - (fade_time * 2); var fade_ratio = fade_time - display_time var frames_per_second = options.frames_per_second || 30; var frame_time = (1 / frames_per_second) * 1000; var zoom_level = 1 / (options.zoom || 2); var clear_color = options.background_color || '#000000'; var images = []; $(image_paths).each(function(i, image_path){ images.push({path:image_path, initialized:false, loaded:false}); }); function get_time() { var d = new Date(); return d.getTime() - start_time; } And this is in the theme's function.php file: function kenres() { jQuery('#kenburns').kenburns({ //Functionality images: [ &lt;?php $tti = 0; while (have_posts()): the_post(); ?&gt; &lt;?php if ($tti) echo ','; $tti++; $full = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full'); $title = get_post_meta(get_the_ID(), '_slide_title_value', true); echo "'"; echo $full[0]; echo "'" ?&gt; &lt;?php endwhile ?&gt; &lt;?php wp_reset_query(); ?&gt;
has answer: http://stackoverflow.com/a/29859783
type: AnsweredQuestion
score: 1
tagged with: wordpress
upvote count: 1
type: Question

http://stackoverflow.com/comment/122329600
type: Comment
type: QuestionComment
has text: I think you're handling replacing properly. It seems all the answers show you how to replace text, when the real problem seems to be how the data is rendering. It all depends how you render/set this text. It seems if you set the `innerHTML` to your string it'll render properly, but if you set the `innerText` or `textContent` it will render the `` tags literally rather than render them as HTML.
comment on: http://stackoverflow.com/q/29896907
score: 1

http://stackoverflow.com/q/29983159
linked to: http://stackoverflow.com/q/5872815
has comment: http://stackoverflow.com/comment/48085725
tagged with: internet-explorer-8
tagged with: javascript
type: UnansweredQuestion
duplicate of: http://stackoverflow.com/q/5872815
tagged with: jquery
has comment: http://stackoverflow.com/comment/48085823
has comment: http://stackoverflow.com/comment/48085649
has comment: http://stackoverflow.com/comment/48085854
has title: Open and display a .txt file on div on user's computer
tagged with: http://stackoverflow.com/tag/html
answer count: 0
favorite count: 0
type: Question
has body: I am trying to add a functionality where a user can browse a file and display the content of the file on the div. Submit Hello JS: $('#submit').click(function() { $.get($('#inputFile').val(), function(data) { $('#content').html(data); }); } Nothing is getting updated in the div element and no error is returned. Please suggest. UPDATE: I recently discovered that $.get() basically does an http request. But my file is present locally in the system, so is the reason above JS code is not working. But I can't use HTML5 File or FileReader API as I am working on IE-8, it doesn't support HTML5. So should I copy the file to the server and then use $.get() to get the file contents to div. Please suggest.
has comment: http://stackoverflow.com/comment/48085835
upvote count: 2
score: 0
downvote count: 2

http://stackoverflow.com/comment/47830571
comment on: http://stackoverflow.com/q/29852323
score: 1
type: Comment
type: QuestionComment
has text: use a window perhaps?

http://stackoverflow.com/q/29885017
type: Question
possible better answer: http://stackoverflow.com/a/57351747
score: -1
has answer: http://stackoverflow.com/a/29885093
answer count: 2
downvote count: 2
upvote count: 1
has body: i want to show the error messages next to the input element and if there's no error messages then send the data to the server (clear data from form) so fire the function on submit http://codepen.io/anon/pen/RPNpNw the problem is the error messages showed and disappeared quickly (blink) but when change the input type to button http://codepen.io/anon/pen/EjaZqe will work but the data will be still in form and not cleared as input type="submit" will do first name age user name country select your country egypt usa
has title: form validation javascript (error message showed and disappeared quickly)
accepted answer: http://stackoverflow.com/a/29885093
tagged with: forms
type: AnsweredQuestion
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/57351747

http://stackoverflow.com/q/29864655
has answer: http://stackoverflow.com/a/29864860
has body: I am trying to hack my ar drone 2.0, i am following this tutorial: http://www.instructables.com/id/Autonomous-AR-Parrot-Drone-20-Flying/?ALLSTEPS I have installed node on my D: drive and installed the ar-drone module on in the node_modules folder. I tried the var arDrone = require('ar-drone'); command it says "undefined". I tried writing a .js file and executing that from the cmd, and it responds with "Error cannot find module 'ar-drone'" I moved the ar-drone folder to different places(in the node_modules folder but also in the folder where i saved the .js file) but my drone is still standing on the ground with all four of his legs :( I am of course connected to the drones WiFi, but I don't think the problem lies there.
type: UnansweredQuestion
tagged with: ar.drone
tagged with: javascript
type: Question
has title: ar-drone module not found, where to place it?
score: 0
answer count: 1

http://stackoverflow.com/comment/48022799
comment on: http://stackoverflow.com/q/29950809
type: Comment
type: QuestionComment
has text: Why are you using float for a dollar amount?
score: 0

http://stackoverflow.com/comment/47835295
has text: because i only know this way @Andy
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29854522
score: 0

http://stackoverflow.com/q/29869782
score: 0
type: Question
has body: I am writing a JS script with 2 classes(Object, ClientUser), where ClientUser inhertrce from Object: function Object() { this.className; this.properties; this.editableproperties; this.set = function(key, value) { if (this.properties != undefined) { this.properties[key] = value; } } this.get = function(key) { if (this.properties != undefined) { return this.properties[key]; } } this.init = function(objectID, completionHandler) { var getObjectURL = "/get_object_by_id"; perfromPostCall(getObjectURL, { objectId: objectID, className: this.className }, function(result) { if (result.success == true) { for (var key in this.properties) { alert("Find key:" + key); this.set(key, result.object.get(key)); } completionHandler(result); } else { completionHandler(result); } }); } } function ClientUser() { ParseObject.prototype.constructor.apply(this); this.className = "User"; this.properties = { createdAt: null, updatedAt: null, objectId: null, username: null, password: null, email: null, dateOfBirth: null, emailVarified: null, address: null, name: null, type: null }; } function perfromPostCall(post_url, object, completionHandler) { $.ajax({ url: post_url, type: "post", data: { object: object }, success: function(result) { completionHandler(result); }, error: function(error) { var result = { "succes": false, "msg": error }; completionHandler(result); } }); } So actually every thing works as expected except: In the init method, after I performed the post call I want to iterate over the properties: this.properties, which should contain the values declared in ClientUser, but it´s null. Since I can call this.className(which returns the right value), before I call performPostCall, I guess it´s some problem regarding the inheritance strategy I use. I would really be pleased if you guys could help me out, thanks ;)
linked to: http://stackoverflow.com/q/20279484
tagged with: javascript
tagged with: inheritance
duplicate of: http://stackoverflow.com/q/20279484
has comment: http://stackoverflow.com/comment/47864851
has comment: http://stackoverflow.com/comment/47865848
has comment: http://stackoverflow.com/comment/47864879
has title: JS inheritance failure
type: UnansweredQuestion
tagged with: node.js
answer count: 0
linked to: http://stackoverflow.com/q/24398699

http://stackoverflow.com/comment/47971186
type: QuestionComment
has text: I just tried and it doesn't work. Nothing happens
comment on: http://stackoverflow.com/q/29924366
score: 0
type: Comment

http://stackoverflow.com/q/29920223
tagged with: javascript
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/47962055
tagged with: http://stackoverflow.com/tag/html
has body: I have a little question : Is it possible to remove the auto focus on the online filemanager elfinder ? Edit : you can test it on the official site home page : http://elfinder.org/ I mean : when the page loads, elfinder automaticaly get the focus. The problem is that I can't (for example) use F5 to reload the page, unless I click outside the file manager. I tried to get the focus on another element using : $().ready(function() { document.getElementById("getFocus").focus; $( "#getFocus" ).focus(); console.log(document.activeElement); }); But it doesn't work. console.log(document.activeElement); is giving me : &lt;body&gt;...&lt;/body&gt; Which is what I actually want, but the keyboard stay focused on elfinder. Is it any way to do that without simulating a click on an element ?
has title: Remove auto focus on elfinder
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47962104
upvote count: 1
answer count: 0
tagged with: elfinder
score: 1
type: Question
downvote count: 0

http://stackoverflow.com/comment/47942473
score: 0
type: QuestionComment
has text: yes, into jsdom. my other tests are working ok
type: Comment
comment on: http://stackoverflow.com/q/29867314

http://stackoverflow.com/a/29889852
has comment: http://stackoverflow.com/comment/47943728
score: 0
answers question: http://stackoverflow.com/q/29889094
has comment: http://stackoverflow.com/comment/47948881
has comment: http://stackoverflow.com/comment/47947318
has comment: http://stackoverflow.com/comment/47945674
type: Answer
has body: You've to use Ajax Function. Try the code given below and you are done with this:- function check_ava(){ var username = $('#username').val(); $.ajax({ type: "POST", url: "xhr/chk_user.php", data: { username : username }, success: function(html) { if(html == 1){ $("#ava_result").html('Username not available'); $('#username').val(''); }else{ $("#ava_result").html('Username is available'); } } }); } and in chk_user.php put this code $username = $_POST['username']; $result = mysql_query("select Name from User where Name = '$username'"); echo $usrcount = mysql_num_rows($result); exit;

http://stackoverflow.com/a/29877396
answers question: http://stackoverflow.com/q/29877139
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 1
upvote count: 1
has body: $( ".fileInput" ).each(function( index ) { console.log( "file name: " + $( this ).val() ); }); should work fine within loop for multiple fields. About sending file to server via Ajax is different problem. Here is a great example which suits your needs( Ajax/Jquery - PHP )
accepted answer of: http://stackoverflow.com/q/29877139

http://stackoverflow.com/comment/47850482
type: QuestionComment
comment on: http://stackoverflow.com/q/29862318
score: 0
has text: Yes it was:( now it works.
type: Comment

http://stackoverflow.com/comment/47867792
comment on: http://stackoverflow.com/q/29871415
has text: I know of the need for backslash when double and signle quotes are used, but thats not the problems here. I'll edit it
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47975204
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/29924588
has text: I posted samples of my work but I don't know if it's really relevant... Now that I think about it, may the problem be because of my onBefore and onAfter on my routes.js ? May it prevent the package from working properly ?
type: Comment

task
type: Tag
tag name: task
tags question: http://stackoverflow.com/q/29929606

http://stackoverflow.com/comment/47833682
has text: @hmt - What do you mean "can't do anything outside the interval"? I don't understand that part of the problem. If you are destroying DOM elements that have event handlers on them with code like `$('#controls').empty();`, then those event handlers are also destroyed. You will have to either reattach the event handlers to the newly created DOM elements or use delegated event handling to attach the event handlers to higher level DOM elements that are not replaced.
type: Comment
comment on: http://stackoverflow.com/a/29853638
type: AnswerComment
score: 0

http://stackoverflow.com/comment/48056988
has text: Thanks @Robert. This helped me a lot to understand how to do this the javascript way. Unfortunately it didnt work for me so I turned to php and finally solved the problem.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29948268

http://stackoverflow.com/comment/48032861
comment on: http://stackoverflow.com/a/29954350
score: 0
type: AnswerComment
type: Comment
has text: Nothing wrong with the code you wrote for the resources you're using, however the resources you chose aren't the same that I'm currently using. So all in I can't use what you posted up above, because it won't work with what I have. Part of the answer to my problem is in using something like > now.valueOf() ? 'disabled' : ' ' As for the rest of the code to use associated with it before the > I'm not sure how to apply it.

http://stackoverflow.com/comment/47940387
has text: See below, I commented and provided more info. Thanks.
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29908839

http://stackoverflow.com/q/29887054
has body: I had issues with another question for a resolution Here, three.js webgl custom shader sharing texture with new offset.. After reading i am concluding i may have to use the clone method();. Simple enough but i am sure im missing something as im getting a black rendered result on my mesh. originalM = new THREE.ShaderMaterial({ uniforms: uniforms, vertexShader: document.getElementById( 'vShader' ).textContent, fragmentShader: document.getElementById( 'fShader' ).textContent, wireframe: true, side: THREE.FrontSide } ); for ( j = 0; j &lt; row; j ++ ) { var shader2 = originalM.clone(); shader2.uniforms = THREE.UniformsUtils.clone( originalM.uniforms ); shader2.needsUpdate = true; shader2.uniforms.tX.value = 0.20 * t; shader2.uniforms.tY.value = 0.20 * j; for ( i = 0; i &lt; geometry.length; i ++ ) { var mesh = new THREE.Mesh( geometry[ i ][ 0 ], shader2); group.add(mesh); } }
has title: Clone shader Material three.js
downvote count: 0
tagged with: javascript
linked to: http://stackoverflow.com/q/29877032
favorite count: 0
tagged with: three.js
score: 2
answer count: 0
upvote count: 2
type: UnansweredQuestion
type: Question

http://stackoverflow.com/comment/47871622
type: Comment
has text: @realph: yes, which is what the post I linked (and the ones that in turn links to) explains. Put a few `console.log('1');`, `console.log('2');`, etc in there and you can easily see what the order of execution is.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/29872125

http://stackoverflow.com/a/29967218
type: AcceptedAnswer
type: Answer
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/29965882
has body: I suppose that you posted not exact the data which returns the controller. You call Json twice which is the first error. The jsonObj have already System.Web.Mvc.JsonResult type. So it have the required data inside of Data property. Then you use Json(jsonObj, JsonRequestBehavior.AllowGet); which wraps the returned results and the GetAllMovies will returns the data like { "ContentEncoding":null, "ContentType":null, "Data":[{"Id":66,"Title":"BibUtt",...},...], "JsonRequestBehavior":1, "MaxJsonLength":null, "RecursionLimit":null } instead of JSON data which you posted. So you should fix the code of GetAllMovies to the following [HttpGet] public JsonResult GetAllMovies() { return Json(movieAccessLayer.GetAllMovies(), JsonRequestBehavior.AllowGet); } After the fix you should already see the results. I would recommend you to make additionally some simple changes in the code which creates the grid. For example $("#list").jqGrid({ url: "/Movies/GetAllMovies", datatype: "json", loadonce: true, gridview: true, autoencode: true, jsonReader: { id: "Id" }, colNames: ["Id", "Title", "Director", "Date"], colModel: [ { name: "Id", sorttype: "int" }, { name: "Title" }, { name: "Director" }, { name: "ReleaseDate", align: "right", formatter: "date", sorttype: "date" } ], viewrecords: true, pager: "#pager", rowNum: 5, rownumbers: true, rowList: [5, 10, "10000:All"], height: "auto", width: 500, caption: "My first grid", });
answers question: http://stackoverflow.com/q/29965882
upvote count: 1

http://stackoverflow.com/a/29969941
has comment: http://stackoverflow.com/comment/48059486
has body: Im pretty sure that you will need to return undefined instead of null: window.onbeforeunload = function() { if( !gdymc.info.isSaved &amp;&amp; !gdymc.info.isSaving ) { return jQuery('#gdymc_adminbar').attr('data-unload'); } else { // returns undefined return void 0; } } The above is testet in IE8 and it works.
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/29969909
answers question: http://stackoverflow.com/q/29969909
has comment: http://stackoverflow.com/comment/48060058
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/48059676
type: Answer

http://stackoverflow.com/comment/47870598
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29872745
has text: Thank you. I could've sworn I checked that. Perhaps when I was testing, I didn't refresh the cache properly.
type: AnswerComment

http://stackoverflow.com/a/29951208
upvote count: 0
accepted answer of: http://stackoverflow.com/q/29902467
score: -1
answers question: http://stackoverflow.com/q/29902467
has body: You write that you want to get the value of type of 2ndCol and 3rdCol [you write it in the comments ] console.log(row.2ndCol.type); // It shows the Error You also write that shows error. I give blocks of code. That should work. angular.forEach($scope.auditJSON.workflows, function(workflow, workflowIndex) { angular.forEach(workflow, function(workflowValue, workflowKey) { angular.forEach(workflowValue, function(value, roleKey) { angular.forEach(value.sections, function(section, sectionIndx) { angular.forEach(section.rows, function(row, rowIndx) { if(row['2ndCol'].type === 'select' &amp;&amp; row['3rdCol'].type === 'select'){ if(row['2ndCol'].value != row['3rdCol'].value){ console.log(row['2ndCol'].value); console.log(row['3rdCol'].value); } } }); }); }); }); }); If it solve your problem, accept as answer.
type: AcceptedAnswer
downvote count: 1
type: Answer

http://stackoverflow.com/q/29982565
has body: I have tried several ways to try and update this session variable more than once (i.e to make it increment for EACH click rather than just the first one), but it is not working. &lt;script&gt; $(document).ready(function(){ $('.nextWeek').on('click', function(){ $.post ('incrementWeek.php', function (response) { location.reload(); }); location.reload(); }); }); &lt;/script&gt; I'm trying to increment the $_SESSION['idn'] variable for reuse after makes a click on a certain button/link. "incrementWeek.php" is simply: &lt;?php session_start(); $session = $_SESSION['idn']; $session++; $_SESSION['idn'] = $session; ?&gt; Few quick answers to common questions: session_start() is the first thing under the first PHP tag, the $_SESSION['idn'] variable is set earlier in the file, but I use an if structure like this: if (isset($_SESSION['idn'])) { } else { $id = getIDFromDate($connection, $currentSunday); $_SESSION['idn'] = $id; } I tried using an alert to see if the variable changes, but it stayed the same. After the first page load, AJAX (I suppose?) does not even acknowledge that I am clicking the "nextWeek" class button. The page does not reload meaning location.reload() was not executed. Any ideas are appreciated. EDIT: Thank you. I have edited the code above from everyone's feedback and now it does not reload the page at all and the $_SESSION variable does not update. Is there something wrong syntactically?
has title: Cannot increment session variable more than once using AJAX/PHP
tagged with: ajax
has answer: http://stackoverflow.com/a/29982997
type: UnansweredQuestion
tagged with: php
answer count: 4
has answer: http://stackoverflow.com/a/29982631
has answer: http://stackoverflow.com/a/29982912
has comment: http://stackoverflow.com/comment/48084548
has comment: http://stackoverflow.com/comment/48084869
has answer: http://stackoverflow.com/a/29982585
type: Question
has comment: http://stackoverflow.com/comment/48084486
tagged with: session
tagged with: javascript
linked to: http://stackoverflow.com/q/16153396
has comment: http://stackoverflow.com/comment/48084521
score: 0
tagged with: jquery

http://stackoverflow.com/comment/47915254
type: Comment
type: QuestionComment
has text: Why PHP should have another tool to do the same as header??
comment on: http://stackoverflow.com/q/29896314
score: 0

http://stackoverflow.com/q/29957721
has comment: http://stackoverflow.com/comment/48036185
has comment: http://stackoverflow.com/comment/48036235
tagged with: if-statement
has answer: http://stackoverflow.com/a/29970493
tagged with: image-preloader
tagged with: javascript
tagged with: loadimage
has body: I found a very nice code here to preload images into application. Which works great. // PRELOAD IMAGES var images = {}; function loadImages(sources, callback) { var loadedImages = 0; var numImages = 0; // get num of sources for(var src in sources) { numImages++; } for(var src in sources) { images[src] = new Image(); images[src].onload = function() { if(++loadedImages &gt;= numImages) { callback(images); } }; images[src].src = sources[src]; } } var sources; sources = { img1: "....../img1.png", img2: "....../img2.png", }; When loadImages() called it works just fine. loadImages(sources, function(images) { ctxLogo.drawImage(images.img1, 0, 0, 10, 10); }); But when i try to call loadImages() from if statement inside for loop, for whatever reasons the function is not called. I am pulling image names from the array. Everything else works as intented i.e. iteration, conditions, etc. Code is below: loadImages(sources, function (images) { for (var j = 0; j &lt; data.length; j++) { if (data[j].FlImg === 'img2') { alert (j) // just to be sure it gets here, it does. alert(j +'-this line is not') ctxGameBoard.drawImage(images.img2, 0, 0, 100, 100); } }); I ran it locally. Any suggestions greatly appreciated. Solved. My problem was that object variable were not declared within if block. once I changed the code to run loop and condition inside loadImages function. Everything works as intended. Thanks for pointing it out.
score: 0
answer count: 3
has comment: http://stackoverflow.com/comment/48036284
has title: Javascript if statement, function is not called
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29957891
has answer: http://stackoverflow.com/a/29958533
has comment: http://stackoverflow.com/comment/48036244
has comment: http://stackoverflow.com/comment/48036212
has comment: http://stackoverflow.com/comment/48036219
has comment: http://stackoverflow.com/comment/48036148
has comment: http://stackoverflow.com/comment/48036210
type: Question

http://stackoverflow.com/a/61340507
type: Answer
score: 1
upvote count: 1
has body: One of my simplest implementations is down below. It can even survive page reloads. :- Code pen: https://codepen.io/shivabhusal/pen/abvmgaV $(function() { var TTimer = { startedTime: new Date(), restoredFromSession: false, started: false, minutes: 0, seconds: 0, tick: function tick() { // Since setInterval is not reliable in inactive windows/tabs we are using date diff. var diffInSeconds = Math.floor((new Date() - this.startedTime) / 1000); this.minutes = Math.floor(diffInSeconds / 60); this.seconds = diffInSeconds - this.minutes * 60; this.render(); this.updateSession(); }, utilities: { pad: function pad(number) { return number < 10 ? '0' + number : number; } }, container: function container() { return $(document); }, render: function render() { this.container().find('#timer-minutes').text(this.utilities.pad(this.minutes)); this.container().find('#timer-seconds').text(this.utilities.pad(this.seconds)); }, updateSession: function updateSession() { sessionStorage.setItem('timerStartedTime', this.startedTime); }, clearSession: function clearSession() { sessionStorage.removeItem('timerStartedTime'); }, restoreFromSession: function restoreFromSession() { // Using sessionsStorage to make the timer persistent if (typeof Storage == "undefined") { console.log('No sessionStorage Support'); return; } if (sessionStorage.getItem('timerStartedTime') !== null) { this.restoredFromSession = true; this.startedTime = new Date(sessionStorage.getItem('timerStartedTime')); } }, start: function start() { this.restoreFromSession(); this.stop(); this.started = true; this.tick(); this.timerId = setInterval(this.tick.bind(this), 1000); }, stop: function stop() { this.started = false; clearInterval(this.timerId); this.render(); } }; TTimer.start(); }); 00 : 00
answers question: http://stackoverflow.com/q/29971898
downvote count: 0

http://stackoverflow.com/q/29988204
upvote count: 3
has body: I'm attempting to display something (ultimately a menu) when a point is clicked in a DevExtreme chart. I've started by using a bar chart for simplicity. What I want to do is, when the user clicks on a bar to display something else in the DOM at that particular point. I've tried to set this up and got most of the way, the problem I've got that I'm not sure how to solve is regarding the co-ordinates. The example above shows where I clicked, and the red circle that I've appended which appears at the top of the bar. The code to add this is quite simple: var clicked = function(p) { var element = p.element[0]; var group = d3.select(element) .select("svg") .append("g") .attr("transform", "translate("+ [p.target.x, p.target.y] +")") .append("circle") .attr({ cx : 0, cy: 0, r: 10, class: "circle"}); }; Simply taking the co-ordinates of the target clicked element. Obviously this seems to be the top corner. Is there any way that anyone can think of to obtain the actual clicked location? I've got a demonstration fiddle forked off one of their examples here: http://jsfiddle.net/IPWright83/ho2euurh/2/
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/29988268
score: 3
answer count: 1
downvote count: 0
favorite count: 0
accepted answer: http://stackoverflow.com/a/29988268
has title: Detecting click location
tagged with: devextreme
type: AnsweredQuestion

http://stackoverflow.com/a/29960629
has comment: http://stackoverflow.com/comment/48042720
score: 0
answers question: http://stackoverflow.com/q/29960404
type: Answer
has body: Why this doesn't work? Lets take it here: Click me oink As you can see in your markup there is one li in the markup but that is not a valid way to put any list item outside of ul/ol. Only ul/ols can have the list items. This is just a simple info but in your code the issue seems to be here: $(".button").on("click",function(){ var result = $('li').clone(); //______No descendant selector $("ul").append(result); }); This line: var result = $('li').clone(); returns you a collection of list items available in the page. So if you have one list item at first click then it returned only one li then append gets executed. so there is now two lis, now if you click then you would see two lis are getting appended. Solution: so the simplest solution is to use :first: $(".button").on("click",function(){ var result = $('li:first').clone(); //______No descendant selector $("ul").append(result); }); now this line: $('li:first').clone(); always returns you the first element found in the structure.
has comment: http://stackoverflow.com/comment/48043000

http://stackoverflow.com/comment/47862470
comment on: http://stackoverflow.com/q/29868635
has text: That's precisely what require is for.
score: 1
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29955889
answers question: http://stackoverflow.com/q/29943363
has comment: http://stackoverflow.com/comment/48036177
has body: Keep in mind that they doesn't work in the same way, visibility: hidden; Conserve the space that the object is using, so if your object size is for example: Width: 250px, Height:200px, will show a blank space. By the other hand: display:none; won't show the blank space, your object still be there but at Width:0px Height:0px Bye!
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/48035001
score: 0
has comment: http://stackoverflow.com/comment/48034756
downvote count: 1
has comment: http://stackoverflow.com/comment/48035445

http://stackoverflow.com/comment/47985254
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29931406
has text: Correct, if you read through the page I linked, you'll see "More than one class may be added at a time, separated by a space"

http://stackoverflow.com/a/29863457
type: Answer
has body: You can use angular.element and jqLite.scope to get the scope object. Remember that angular and your app need to be initialized for this to work, so you'd better call parseDate in a callback. parseDate( angular .element('[ng-controller="TodoCtrl"]') // but you'd rather give it an ID / class name / whatever .scope() .test );
score: 0
answers question: http://stackoverflow.com/q/29863382

http://stackoverflow.com/q/29846212
answer count: 3
tagged with: javascript
tagged with: openlayers
score: 0
has answer: http://stackoverflow.com/a/32112512
has body: I am using Opnelayers control for selection of feature OpenLayers.Control.SelectFeature when I triggered the single click event then feature get selected and its working fine for me. Now I want to use double click event for another operation. I have get the idea from this link feature to have both a single click and double click event? I have used the same code and both click events working fine but I cannot get the feature on which click event performed. This is the code handler = new OpenLayers.Handler.Click( select, { click: function(evt) { var feature = this.layer.getFeatureFromEvent(evt); console.log(feature); // output null if(this.layer.selectedFeatures){ this.unselect(this.layer.selectedFeatures[0]); } }, dblclick: function(evt) { // some other operation } }, { single: true, double: true, stopDouble: true, stopSingle: true } ); handler.activate(); Any idea which thing is missing in this code? Thank you
has answer: http://stackoverflow.com/a/30049789
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29907137
has title: OpenLayers - how to use single and double click event on feature
type: Question

http://stackoverflow.com/comment/48005140
comment on: http://stackoverflow.com/a/29939343
has text: @codelife Could you please try to explain your comment again? The timeout doesn't need to be delayed by one second. That's the whole point of a timeout - it doesn't execute until after one second.
type: AnswerComment
type: Comment
score: 0

http://stackoverflow.com/comment/48021560
type: QuestionComment
comment on: http://stackoverflow.com/q/29950100
score: 0
has text: shouldn't have to use `JSON.parse()` if your headers are set at server properly or you use `dataType` option. jQuery will do it for you
type: Comment

http://stackoverflow.com/comment/47990427
comment on: http://stackoverflow.com/q/29933410
score: 0
type: Comment
type: QuestionComment
has text: @Jonathan from page 1 to page 2 i think i dont need to make server side scripting anymore because i already dont the server things needed before hand in page 1

http://stackoverflow.com/comment/48012416
type: AnswerComment
score: 0
has text: @Darren-Sweetney Oh sorry, I wasn't clear enough... :D I meant why it's 0, I made 0 bold but the system blocked it... But actually I also didn't understand that thing of yours :) So thank you anyways I'll watch that == vs ===.
type: Comment
comment on: http://stackoverflow.com/a/29945686

http://stackoverflow.com/comment/48035159
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29957204
has text: There are many anwsers alreay, please check[Set a breakpoint in XHR in Chrome][1] or [How do I debug Javascript which was loaded via AJAX (specifically jQuery)][2] [1]: https://stackoverflow.com/questions/3249696/set-a-breakpoint-in-xhr-in-chrome [2]: https://stackoverflow.com/questions/13129904/how-do-i-debug-javascript-which-was-loaded-via-ajax-specifically-jquery
type: Comment

http://stackoverflow.com/comment/127920821
type: Comment
comment on: http://stackoverflow.com/a/46524650
score: 0
type: AnswerComment
has text: What if I have class A built in, and class B built in which extends A, and then make class D extend A. I want all my further classes to extend D, except that I need one class "E" to have B as the original base class, not A? What path of single inheritances can cause E to extend both B and D, and does it matter that it would seem necessary to essentially extend A twice, indirectly, i.e. would this cause issues?

http://stackoverflow.com/q/29977128
tagged with: javascript
answer count: 1
tagged with: jquery
has body: I'm looking to do the following: Have an auto-playing slider that moves 2 slides at a time. The left/top slide will contain live text within a div, and the right/bottom will be just an image. When the browser resizes I'd like the left section to stack on top. When they slide, they'll be replaced by 2 different slides set up the exact same way. Is there a plug-in or jquery that would make this possible? Or a simple one that I could manipulate? thank you, Jordana
type: UnansweredQuestion
tagged with: slider
score: 0
has title: Responsive stacking multi-image slider
tagged with: responsive-slides
has answer: http://stackoverflow.com/a/29977641
type: Question
tagged with: mobile

http://stackoverflow.com/comment/47971944
score: 1
type: Comment
comment on: http://stackoverflow.com/q/29925093
type: QuestionComment
has text: @adeneo that returns a a massive string with no key/pairs, I need each array to be an own object I guess?

http://stackoverflow.com/comment/47907135
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/29891684
score: 0
has text: @CasimiretHippolyte: Is "an equivalent of `/[a-z0-9_]/i`" better?

http://stackoverflow.com/q/29944622
has body: The jQuery.ajax() function I use works correctly most of the time. However sometimes it is not returning any data. Instead the error() function is called. $.ajax({ [...] , error: function(jqXHR, textStatus, errorThrown) { console.log(jqXHR); console.log(textStatus); console.log(errorThrown); } }); I can see in there that in those cases textStatus is 'error' and errorThrown is '' (empty). The jQuery documentation just lists the possible values of textStatus ("timeout", "error", "abort", and "parsererror"). However it does not describe, what 'error' means. jqXHR returns an object but it does not seam to reveal any additional insights. How can I investigate what the source to this issue is?
has comment: http://stackoverflow.com/comment/48010353
answer count: 3
has answer: http://stackoverflow.com/a/29944834
downvote count: 0
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/29945479
tagged with: ajax
possible better answer: http://stackoverflow.com/a/29944834
has answer: http://stackoverflow.com/a/29946254
tagged with: xmlhttprequest
upvote count: 6
has comment: http://stackoverflow.com/comment/48013354
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29946254
linked to: http://stackoverflow.com/q/4807572
score: 6
type: Question
tagged with: javascript
has title: jQuery.ajax() error with textStatus=error

http://stackoverflow.com/a/30129953
type: Answer
answers question: http://stackoverflow.com/q/29993448
score: 8
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29993448
upvote count: 8
has body: http://jsfiddle.net/sjvc_phil/s7432z8L/ Make sure you include the youtube iframe api &lt;script src="//www.youtube.com/iframe_api"&gt;&lt;/script&gt; You need to modify the Magnific Popup iFrame code a bit. The mark up needs to include id="player" next to class="mfp-iframe". This lets the YouTube API know which video you want to monitor. You will also need to a the parameter &amp;enablejsapi=1 in the youtube url after the ?autoplay=1 parameter. The magic is in the Magnific Popup callback. callbacks: { open: function () { new YT.Player('player', { events: { 'onStateChange': onPlayerStateChange } }); } } And the function that closes Magnific Popup when the video ends: function onPlayerStateChange(event) { if (event.data == YT.PlayerState.ENDED) { $.magnificPopup.close(); } }
type: AcceptedAnswer

http://stackoverflow.com/a/46359859
answers question: http://stackoverflow.com/q/29949552
upvote count: 11
downvote count: 0
has body: To copy all elements of one object to another object, use Object.assign: var myObject = { apple: "a", orange: "o" }; var anothObject = Object.assign( { lemon: "l" }, myObject ); Or, more elegantly ES6 style using spread ... operator: let myObject = { apple: "a", orange: "o" }; let anothObject = { lemon: "l", ...myObject };
type: Answer
score: 11

http://stackoverflow.com/q/29865158
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29865207
has body: I have a text box where user enters numbers which are mostly in float data type . This value is then added to some previous value . When a user adds float number like 0.123 it is added fine but when he adds it like .123 it throws error Nan . I am using following code. var labor_cost = Number($("#labor_cost").val()); var other_cost = Number($("#other_cost").val()); var profitValue = Number($("#profitValue").val()); var ingCost = Number($("#productTotalcost").val()); profitAmount = ((ingCost+other_cost+labor_cost)*profitValue/100); $("#showproposedprice").html((ingCost+other_cost+labor_cost+Number(profitAmount)).toFixed(2)); $("#proposedprice").val((ingCost+other_cost+labor_cost+Number(profitAmount)).toFixed(4)); Please help me how can I skip or manipulate a float number .123 to 0.123 ? Thanks.
upvote count: 0
type: Question
has comment: http://stackoverflow.com/comment/47855355
tagged with: javascript
tagged with: jquery
score: -1
has comment: http://stackoverflow.com/comment/47855448
has comment: http://stackoverflow.com/comment/47855392
downvote count: 1
answer count: 1
favorite count: 0
has title: How to manipulate a float value which starts from .somevalue to 0.somevalue in javascript/jquery?

http://stackoverflow.com/comment/47916680
type: QuestionComment
score: 1
has text: Not sure about your exact situation, but a possible alternative would be to use browserify with the es6ify transform (which transpiles with traceur). That would transpile your modules and bundle them all into a single browserify bundle file.
comment on: http://stackoverflow.com/q/29882004
type: Comment

http://stackoverflow.com/comment/47855841
has text: @charlietfl as told in the previous comment, i have a small image viewer in a webapp which has a button to open the viewer in a new window (this feature is so that the user can open the document in a new full sized window also navigate to other views in the webapp). My viewer partial does not contain the import of jQuery,angular,etc .. so the partial does not render in the new window. Hope i made it clear , let me know if further explanation required. thanks
comment on: http://stackoverflow.com/q/29863988
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29982881
has title: How to destroy/disable slider from ratchet?
accepted answer: http://stackoverflow.com/a/30159077
type: Question
has answer: http://stackoverflow.com/a/29984607
tagged with: javascript
tagged with: jquery
answer count: 2
possible better answer: http://stackoverflow.com/a/29984607
tagged with: slider
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/30159077
tagged with: ratchet-bootstrap
type: AnsweredQuestion
score: 2
upvote count: 2
tagged with: ratchet-2
has body: I use ratchet.js to slider many images. But now I want to click an element 'a'/'button' trigger the 'slider' method . And I want to destory browser method when we drag/touch page to left .It will turn to next tab . Only allow people to jump by clicking on the button. The html code like this: I try to use code like this to solve this problem. document.body.addEventListener('slide', function (e) { e.preventDefault(); return false; }); but it does not work ... how to solve this problem ~~

http://stackoverflow.com/comment/47845212
has text: FYI, you don't need `javascript:` in `onclick` attributes. That's only needed in `href`, to distinguish it from normal URLs.
score: 1
comment on: http://stackoverflow.com/q/29859674
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29906103
favorite count: 0
has title: self=this weird behavior in nested viewmodel with knockout
type: AnsweredQuestion
score: 3
accepted answer: http://stackoverflow.com/a/29906153
upvote count: 3
has answer: http://stackoverflow.com/a/29906319
tagged with: knockout.js
linked to: http://stackoverflow.com/q/1335851
type: Question
possible better answer: http://stackoverflow.com/a/29906319
tagged with: javascript
has body: I am trying to get to grips with knockout.js, but I seem to be running into a javascript quirck I am not aware of. Html &lt;ul data-bind="foreach: someList"&gt; &lt;li data-bind="text: number"&gt;&lt;/li&gt; &lt;/ul&gt; Javascript function NestedViewModel(number) { self = this; self.number = ko.observable(number); } function ViewModel() { self = this; self.someList = []; for (i=0;i&lt;10;i++) { var vm = new NestedViewModel(i); self.someList.push(vm); } } ko.applyBindings(new ViewModel()); When I run this code, nothing happens. The console shows an error: Uncaught TypeError: Cannot read property 'push' of undefined When I remove the self = this; line from the NestedViewModel, and I replace self.number by this.number, everything works fine! I have no clue what javascript is doing under the hood here... Does somebody have an explanation for this? And a solution? jsFiddle
answer count: 2
has comment: http://stackoverflow.com/comment/47935052
has answer: http://stackoverflow.com/a/29906153
downvote count: 0

http://stackoverflow.com/comment/47839215
score: 0
has text: so i need to check every element by itself or is my example solution even working?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29856573

checkbox
tags question: http://stackoverflow.com/q/29976168
tag name: checkbox
tags question: http://stackoverflow.com/q/29859474
tags question: http://stackoverflow.com/q/29902140
tags question: http://stackoverflow.com/q/29931386
tags question: http://stackoverflow.com/q/29937924
tags question: http://stackoverflow.com/q/29919763
tags question: http://stackoverflow.com/q/29982993
tags question: http://stackoverflow.com/q/29913997
tags question: http://stackoverflow.com/q/29936688
tags question: http://stackoverflow.com/q/29928862
tags question: http://stackoverflow.com/q/29989987
tags question: http://stackoverflow.com/q/29916417
tags question: http://stackoverflow.com/q/29933292
tags question: http://stackoverflow.com/q/29981383
tags question: http://stackoverflow.com/q/29933303
tags question: http://stackoverflow.com/q/29889981
tags question: http://stackoverflow.com/q/29934565
tags question: http://stackoverflow.com/q/29906261
tags question: http://stackoverflow.com/q/29970372
tags question: http://stackoverflow.com/q/29860777
tags question: http://stackoverflow.com/q/29846241
tags question: http://stackoverflow.com/q/29965702
tags question: http://stackoverflow.com/q/29868723
type: Tag
tags question: http://stackoverflow.com/q/29995715
tags question: http://stackoverflow.com/q/29873913
tags question: http://stackoverflow.com/q/29969344
tags question: http://stackoverflow.com/q/29897729
tags question: http://stackoverflow.com/q/29932668
tags question: http://stackoverflow.com/q/29945365
tags question: http://stackoverflow.com/q/29930552

http://stackoverflow.com/a/29948916
has body: Here are some tips. By default, make sure all li elements have normal font-weight Set a class for the selected li element, lets call it .selected If you're animating the list into view on click, hide the ul under any list item CSS: ul li { font-weight: normal; } li.selected { font-weight: bold; } li &gt; ul { display: none; } As you can see from above, we're using CSS specificity to our advantage. Then, you'll need to clean up the JavaScript. Here's what that would look like. JavaScript: $('li').on('click', function (event) { event.preventDefault(); event.stopPropagation(); var $li = $(this); $li.toggleClass("selected"); // toggle the selected class on the clicked element $li.children().toggle("slow"); // Get the ul and toggle its display }); Hopefully, this should get you on the right track. Demo: JsFiddle
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/29948343
upvote count: 1
type: Answer

http://stackoverflow.com/q/29851441
type: Question
score: 5
upvote count: 5
has comment: http://stackoverflow.com/comment/47829062
tagged with: javascript
has comment: http://stackoverflow.com/comment/47842519
has comment: http://stackoverflow.com/comment/47845821
has answer: http://stackoverflow.com/a/29851951
has title: I have multiple iframes, how to detect the first one that loads
has comment: http://stackoverflow.com/comment/47833282
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/47828851
downvote count: 0
favorite count: 0
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/3142837
has body: I'm creating iframes dynamically to display documents obtained via a url. Each document is in an iframe which is, in turn, in a div. I have a tab bar that allows any document to be displayed while hiding the rest, a typical tabbed page. I would like to display the div containing the iframe that receives the first response, i.e. display the first that loaded and hide the rest. There is no way to predict which will load first so I need a way to detect the first and display it and hide all of the rest. I think I can do this by having the iframe onload function check a global boolean that is set to true when the first onload handler runs. I'm not sure why, but this feels error prone. Is there a better way to do this? var firstDocumentReceived = false ; function buildFileTabs(evt) { firstDocumentReceived = false ; var files = evt.target.files; // files is a list of File objects. for (var i = 0, f; f = files[i]; i++) { addTab ( files[i].name ); } // create a div to display the requested document function addTab ( fileName ) { var newDiv = document.createElement("div"); newDiv.id = fileName.replace(".","_") + newRandomNumber() ; // create an iframe to place in the div var newIframe = document.createElement("iframe"); newIframe.onload=iframeLoaded ; newIframe.setAttribute("seamless", true ); newIframe.setAttribute("div_id" , newDiv.id) ; newIframe.src = url ; // the iframe will contain a web page returned by the FDS server // nest the iframe in the div element newDiv.appendChild(newIframe) ; // nest the div element in the parent div document.getElementById("documentDisplay").appendChild(newDiv) ; ... function iframeLoaded ( event ) { if ( firstDocumentReceived === false ) { firstDocumentReceived = true ; // show the div associated with this event } else { // hide the div associated with this event }
tagged with: iframe

http://stackoverflow.com/q/29973815
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/48067605
score: 1
upvote count: 1
type: Question
tagged with: jakarta-ee
has comment: http://stackoverflow.com/comment/48067635
accepted answer: http://stackoverflow.com/a/30002366
tagged with: javascript
has title: Authentication headers with JQuery and Tomcat
has body: My goal is to have a web-service, using an Apache Tomcat 7, and to communicate with it using ajax request from another domain. The web-service is working, but I'm having troubles with the JavaScript part. My problem is when I'm trying to do any request with basic auth, the headers are removed when the Tomcat give me the request : String basicAuth = request.getHeader("Authorization"); The string is always to null. I've tried to look for answers, and I'm guessing the problem come from my web.xml configuration (and because I'm using cross-domain requests). The javaScript part looks like this: $.ajax({ type: 'GET', url: 'http://localhost:8080/Test/endpoint/to/test', dataType : 'json', beforeSend: function (request) { request.withCredentials = true; request.setRequestHeader("Authorization", "Basic " + btoa('test' + ":" + 'test')); }, success: function(data) { console.log(data); }, error: function(data) { console.log(data); } }); And my web.xml file looks like this: File Explorer File Explorer Test fr.vuzi.controller.FrontController FrontController /* CorsFilter org.apache.catalina.filters.CorsFilter cors.allowed.origins cors.allowed.methods GET,POST,HEAD,OPTIONS,PUT cors.allowed.headers Content-Type,X-Requested-With,accept,Origin,Access-Control-Request-Method,Access-Control-Request-Headers cors.exposed.headers Access-Control-Allow-Origin,Access-Control-Allow-Credentials cors.support.credentials true cors.preflight.maxage 10 CorsFilter /* (I'm using only one endpoint for every request). I've tried pretty much anything I could find, and I don't know if the problem is on the client or server side. I know there is similar questions: Authentication headers are not sending JQuery Ajax but none of the solutions seems to work for me... Thanks in advance.
answer count: 1
downvote count: 0
tagged with: jquery
tagged with: tomcat
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/48070556
has comment: http://stackoverflow.com/comment/48067974
linked to: http://stackoverflow.com/q/18889983
has answer: http://stackoverflow.com/a/30002366

http://stackoverflow.com/q/29955270
has body: I'm setting the value of a dijit/form/NumberTextBox programatically and when I debug I see that the displayedValue has been set, not the value. Any idea why it would behave this way? My NumberTextBox is located on a template widget, maybe that has something to do with it? Template: &lt;input type="text" style="width: 50px; height:20px;" data-dojo-type="dijit/form/NumberTextBox" required="true" data-dojo-attach-point="tbDiam" data-dojo-props="constraints:{min:6,max:100,places:0}, invalidMessage:'Please enter numeric value, no decimals.', rangeMessage:'Invalid diameter.' ""/&gt; Setting the value: this.tbDiam.set("value", "25"); getting the value: this.tbDiam.value; //undefined this.tbDiam.displayedValue();//"25" Thanks
answer count: 1
tagged with: dijit.form
tagged with: dojo
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29957243
has title: setting value of dijit/form/numbertextbox sets displayedValue -- not value
type: Question
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29957243
score: 0

http://stackoverflow.com/comment/48008986
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29915793
has text: @confile Well, generate a factory with `if…else` or `switch…case` whose conditions are based on _something_ that you can know at runtime (in a GWT environment, that could be `GWT.isClient()`, `LocaleInfo.getCurrentLocale().isRTL()`, some property of `Window.Navigator`, or`GWT.create(UserAgent.class).getCompileTimeValue()`; or `System.getProperty()` starting with GWT 2.8; or anything you pass as argument to the factory)

http://stackoverflow.com/comment/47986138
comment on: http://stackoverflow.com/q/29931900
type: Comment
type: QuestionComment
score: 0
has text: What do you expect the `test(stooges, 'name')` to return?

http://stackoverflow.com/q/29873659
has answer: http://stackoverflow.com/a/29873696
has answer: http://stackoverflow.com/a/29873680
accepted answer: http://stackoverflow.com/a/29873680
has answer: http://stackoverflow.com/a/29873785
has answer: http://stackoverflow.com/a/29873750
type: Question
score: -2
tagged with: javascript
has answer: http://stackoverflow.com/a/29873863
upvote count: 2
downvote count: 4
possible better answer: http://stackoverflow.com/a/29873785
tagged with: jquery
favorite count: 0
answer count: 5
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion
has title: Auto Arrange box in css or javascript
has body: I am creating a template and I want to know how to Auto Arrange multiple height box in css or javascript. I already tried to change the CSS and Javascript and I've also searched on Google but I've had no luck yet. I am giving here image for clear to know what i am looking for i am showing in this image... please check image before replay what i need thank you

http://stackoverflow.com/comment/47986982
type: Comment
comment on: http://stackoverflow.com/a/29931984
score: 0
has text: There no error showing anymore but the the hidden content is not showing.
type: AnswerComment

http://stackoverflow.com/q/29898889
has body: My understanding of the .on() function is that you call the function on the parent element of the target. The original jQuery I am changing is this: $(document).live('keydown',function(event) { if (event.ctrlKey==true &amp;&amp; (event.which == '80')) { //cntrl + p event.preventDefault(); printOrder(); } }); So it is called directly on the document. My understanding is that I should be calling it like this: $(PARENT OF DOCUMENT).on('keydown', document, function(event) { if (event.ctrlKey==true &amp;&amp; (event.which == '80')) { //cntrl + p event.preventDefault(); printOrder(); } }); I found plenty of answers on the .live() to .on() conversion, but they all referenced using a parent element. How can you reference the parent element of the document?
has comment: http://stackoverflow.com/comment/47920512
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/47920582
type: Question
has answer: http://stackoverflow.com/a/29898993
accepted answer: http://stackoverflow.com/a/29898993
has comment: http://stackoverflow.com/comment/47920923
has comment: http://stackoverflow.com/comment/47920697
has title: How to replace .live() with .on() when targeting the document rather than an element within
upvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/47920541
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47920993
has comment: http://stackoverflow.com/comment/47920749
favorite count: 0
has comment: http://stackoverflow.com/comment/47920614
type: AnsweredQuestion

http://stackoverflow.com/comment/47906799
type: QuestionComment
score: 2
has text: `p` is a word, `)` isn't.
comment on: http://stackoverflow.com/q/29891640
type: Comment

http://stackoverflow.com/q/29893291
has comment: http://stackoverflow.com/comment/47911595
tagged with: arrays
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/29893899
has comment: http://stackoverflow.com/comment/47912554
has title: Filter array of objects for unique elements
has body: Given an array of objects: var arr = [ {a: "foo", b: "bar", c: "baz" }, {a: "foo", b: "bar", c: "qux" }, {a: "foo", b: "bar", c: "baz" }, {a: "foo", b: "bar", c: "qux" }, {a: "bar", b: "foo", c: "qux" }, {a: "bar", b: "qux", c: "foo" }, {a: "bar", b: "foo", c: "qux" } ]; The array shall be filtered so only the unique objects remain: var arr = [ {a: "foo", b: "bar", c: "baz" }, {a: "foo", b: "bar", c: "qux" }, {a: "bar", b: "foo", c: "qux" }, {a: "bar", b: "qux", c: "foo" } ]; For arrays of plain strings, I use arr.filter(function (value, index, self) { return self.indexOf(value) === index; } but this doesn't work on objects. All properties must be compared in my case. I guess some sort of deep comparision is needed?
answer count: 3
has comment: http://stackoverflow.com/comment/47931636
has comment: http://stackoverflow.com/comment/47911443
favorite count: 0
has comment: http://stackoverflow.com/comment/47925031
has comment: http://stackoverflow.com/comment/47910324
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47911874
has answer: http://stackoverflow.com/a/29893756
has comment: http://stackoverflow.com/comment/47922511
has comment: http://stackoverflow.com/comment/47912893
has comment: http://stackoverflow.com/comment/47909861
has comment: http://stackoverflow.com/comment/47912964
has comment: http://stackoverflow.com/comment/47935417
score: 3
linked to: http://stackoverflow.com/q/1068834
has comment: http://stackoverflow.com/comment/47912408
upvote count: 3
has comment: http://stackoverflow.com/comment/47935055
has answer: http://stackoverflow.com/a/29893361
has comment: http://stackoverflow.com/comment/47911901
duplicate of: http://stackoverflow.com/q/1068834
type: Question
has comment: http://stackoverflow.com/comment/47910466

http://stackoverflow.com/q/29884101
has answer: http://stackoverflow.com/a/29904345
tagged with: ms-word
type: AnsweredQuestion
has title: Output SQL Results into a 2 Column Table in MS Word
type: Question
accepted answer: http://stackoverflow.com/a/29904345
tagged with: javascript
score: 0
has body: I really need your help. I am designing an HTA and I would like to have the code amended below, such that I would be able to output SQL recordset results broken down in a 2 column table using MS Word. It also seems that current code inserts a blank row. How do I also get rid of that? Here is the code in question: function test() { var wordApp = new ActiveXObject("Word.Application") var doc = wordApp.Documents.Add() doc.Tables.Add(Range=doc.Range(0, 0), numrows=1, numcolumns=2) doc.Tables(1).Borders.Enable = true i = 1 while (!rs.eof) { doc.Tables(1).Columns(1).Cells.Add() doc.Tables(1).Columns(1).Cells(i + 1).Range.Text = rs.Fields("firstname").value i++ rs.movenext } wordApp.Visible = true wordApp.Activate(); //wordApp.WindowState = 1 } And here is screen grab of the problem and the expected result:
answer count: 1

http://stackoverflow.com/comment/48039794
has text: @Justinas yes... that can be done like `My Site` then `$($(this).data('target')).click();`
comment on: http://stackoverflow.com/a/29959599
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/47891003
comment on: http://stackoverflow.com/a/29857475
score: 0
type: AnswerComment
type: Comment
has text: You add them one by one. Then you complain my splice/slice suggestion was accepted? I abandoned the loop I wrote about 5 minutes before you wrote yours

http://stackoverflow.com/q/29966347
has answer: http://stackoverflow.com/a/29966481
score: 0
answer count: 1
type: UnansweredQuestion
has body: I have a JSON object in the JSP side say "names", whose contents are: { "employees": [ { "firstName": "John", "lastName": "Doe" }, { "firstName": "Anna", "lastName": "Smith" }, { "firstName": "Peter", "lastName": "Jones" } ] } I want to pass this JSON object and its contents to a the javascript part in the same page. I have tried usual method of passing variables i.e var v = &lt;%= variable %&gt;; But that did not work. I would like to know if there is a working alternative.
has comment: http://stackoverflow.com/comment/48054763
has comment: http://stackoverflow.com/comment/48052417
tagged with: java
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/48052605
has comment: http://stackoverflow.com/comment/48052368
type: Question
has title: How to pass a json object from the jsp part of a jsp page to the javascript part i.e from server side to client side?
tagged with: jsp
tagged with: javascript

http://stackoverflow.com/comment/47936935
has text: Is your controller associated to the view ok? Do you get anything if you just do {{user}} ?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29906926

http://stackoverflow.com/comment/48029243
has text: Please clarify whats the actual question and problem code. The one shown doesnt call get backgroundPage. Also the linked s.o. answer IS correct as it talks about a popup calling it. When it doenst work and requires messaging is when you try to use it from a content or injected script.
comment on: http://stackoverflow.com/q/29953109
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29998770
downvote count: 0
has body: //for iframes: $.each($('iframe'), function() { this.contentWindow.open = function (url, windowName, windowFeatures) { //iframe window.open caught! }; }); //for window: window.open = function (url, windowName, windowFeatures) { //window.open caught! };
has comment: http://stackoverflow.com/comment/89669735
answers question: http://stackoverflow.com/q/29998470
type: Answer
score: 9
upvote count: 9

http://stackoverflow.com/comment/48010421
type: Comment
comment on: http://stackoverflow.com/q/29944387
type: QuestionComment
has text: What response is it getting Emrys
score: 0

http://stackoverflow.com/comment/48117914
score: 0
type: AnswerComment
type: Comment
has text: no I have form tag in the complete code man...I have given here just the core part
comment on: http://stackoverflow.com/a/29991883

http://stackoverflow.com/a/29908071
type: Answer
upvote count: 3
accepted answer of: http://stackoverflow.com/q/29906870
answers question: http://stackoverflow.com/q/29906870
has body: For me the most natural place is in the model because it contains the data. The GRASP Expert Principle says that you should assign responsibilities to an object that has the information to fulfill them. We could argue that the controller may have all the information (data) required to do the validation but for me controllers should be light. Moreover, I think that "all the information" means not only having the data you must validate, but also knowing its format, and that's the model's concern. The controller may know how the data that a certain model needs should be, but that model could also be used outside that controller scope, so it should not rely on the controller's validation to work well as the model is (almost) your last chance to detect invalid data (you can, and must, also do that on the database, but data should be validated and sanitised before it goes into it, although normally there's a direct match between the database schema and the validation you should do in the model). Every time you do CRUD operations with a model you will probably need to validate the data and you will be ensuring that your data is almost always correct. Moreover, the controller could also change the data that then goes into that model, so even if the controller validated it previously, it may produce invalid data. However, think about that. The controller may change the data and in fact a lot of time they do so. It is unusual to always have a direct map between the fields in a form and a model and sometimes you will have inputs that have nothing or little to do with any model, so you should validate them outside the model. For example, think about the "Repeat password" field. It has nothing to do with the model! Only the "Password" field should reach it. Other people would say that they prefer anemic models and that may fit best than rich models in some scenarios, but they also have some drawbacks and rich ones fit best in general. You should also consider having validation i…
score: 3
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/29845687
tagged with: javascript
possible better answer: http://stackoverflow.com/a/29845827
has answer: http://stackoverflow.com/a/29845827
score: 0
answer count: 3
has comment: http://stackoverflow.com/comment/47817100
tagged with: jquery
has comment: http://stackoverflow.com/comment/47817221
tagged with: ajax
has answer: http://stackoverflow.com/a/29845833
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29848998
type: AnsweredQuestion
has body: I have the following code which will refresh my web part every 60 seconds and its working great. The problem I have is that on top of the refresh code I also have a script that will highlight certain parts of my data and as soon as the refresh kicks in it breaks my scripts. What will happen is I load the page and I can see my script doing its thing my highlighting my data, a minute later the highlights are gone leaving me with just my data. I removed my refresh code and confirmed that my scripts stays intact afterwards. Reload code: &lt;script type="text/javascript"&gt; function reload() { $.ajax({ async: false, cache:false, url: "http://ensemble-mtl.ent.cginet/sites/SERVIPCManagement/imc/Shared%20Documents/Whiteboard/Whiteboard.aspx", complete: function (xData, Status) { var DVWPMarkup = $(xData.responseText).find("#reload_me").html(); $("#reload_me").html(DVWPMarkup); } }); } $(document).ready(function(){ reload(); var auto_refresh = setInterval(function(){reload();}, 60000); }); &lt;/script&gt; Highlighting code: &lt;script language="javascript" type="text/javascript"&gt; $('.IM_last_modified').each(function () { var dtSt = $(this).html().split(" "); var dtAr = dtSt[0].split("/"); var when = new Date(dtAr[1] + "/" + dtAr[0] + "/" + dtAr[2] + " " + dtSt[1]); console.log(when); var now = Date.now(); if (now - when &gt; 3600000) { $(this).addClass('min60'); } else if (now - when &gt; 1800000) { $(this).addClass('min30'); } else if (now - when &gt; 1000) { $(this).addClass('min1'); } }); &lt;/script&gt;
type: Question
accepted answer: http://stackoverflow.com/a/29845833
has title: Javascript - Reloading page breaks my conditional formatting
has comment: http://stackoverflow.com/comment/47817245

http://stackoverflow.com/comment/48000483
type: Comment
has text: Possible duplicate of: http://stackoverflow.com/questions/17295901/firefox-window-event-is-undefined-error and http://stackoverflow.com/questions/9813445/why-ff-says-that-window-event-is-undefined-call-function-with-added-event-list
score: 1
comment on: http://stackoverflow.com/q/29939748
type: QuestionComment

remote-debugging
tag name: remote-debugging
type: Tag
tags question: http://stackoverflow.com/q/29922837

handlebarshelper
tags question: http://stackoverflow.com/q/29965750
type: Tag
tag name: handlebarshelper
tags question: http://stackoverflow.com/q/29929744

http://stackoverflow.com/q/29908008
has comment: http://stackoverflow.com/comment/47938659
tagged with: submit-button
has comment: http://stackoverflow.com/comment/47938456
type: AnsweredQuestion
tagged with: form-submit
tagged with: disabled-control
has comment: http://stackoverflow.com/comment/47938620
score: 0
tagged with: forms
has answer: http://stackoverflow.com/a/29908145
type: Question
has comment: http://stackoverflow.com/comment/47938599
tagged with: javascript
has body: <?php echo ' Ad: Soyad: Yas: E-Mail '; ?>
has title: how can make disable if the texts are empty with?
accepted answer: http://stackoverflow.com/a/29908145
answer count: 1

http://stackoverflow.com/comment/47933312
comment on: http://stackoverflow.com/q/29905139
score: 0
has text: @Chris Baker. I do not receive the request for the new uri. It is a small picture. Yes. I would wait forever but it does not seem to respond!
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/47949196
score: 1
has text: can you explain what you needs?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29913295

http://stackoverflow.com/comment/48120909
has text: I have start and end point . thisMatchStart is the start point of tag .
comment on: http://stackoverflow.com/q/30000671
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/47824661
score: 1
comment on: http://stackoverflow.com/q/29849285
has text: the complement to `!(a == b)` is `a != b`, likewise `!(a === b)` is equivalent to `a !== b`.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47829477
type: Comment
score: 0
type: AnswerComment
has text: forget echo var d = '<?php json_encode($my_values); ?>
comment on: http://stackoverflow.com/a/29851731

http://stackoverflow.com/a/29869168
has body: Added style hidden to the button, and added the following if the two variables were equal to eachother: $('.deletebutton').show();
score: 0
answers question: http://stackoverflow.com/q/29865795
type: Answer

http://stackoverflow.com/comment/48021260
type: AnswerComment
score: 0
has text: Yeah, it seems like it.
type: Comment
comment on: http://stackoverflow.com/a/29949360

http://stackoverflow.com/comment/47831481
score: 0
type: Comment
has text: Ah yes, missed that. I removed it and the .parentNode but now it only adds a new div inside the DIV#derp, it doesnt replace/remove the TODO write content . Any ideas?
comment on: http://stackoverflow.com/a/29852734
type: AnswerComment

http://stackoverflow.com/comment/48049035
comment on: http://stackoverflow.com/q/29963882
score: 0
type: Comment
has text: are you just making a group of these? and will they always be connected with a '+' symbol?
type: QuestionComment

http://stackoverflow.com/a/29979918
accepted answer of: http://stackoverflow.com/q/29979864
has comment: http://stackoverflow.com/comment/48080130
has comment: http://stackoverflow.com/comment/48080275
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/48080255
has comment: http://stackoverflow.com/comment/48080073
type: Answer
has comment: http://stackoverflow.com/comment/48079911
score: 3
upvote count: 3
answers question: http://stackoverflow.com/q/29979864
has body: var buttons = document.getElementsByClassName("CSS"); for (var i = 0; i < buttons.length; i++) { // Generate strings associated with the button ids and the event handlers for each button var buttonID = "button" + i; var clickHandlerID = "clickHandler" + i; var buttonEH = document.getElementById(buttonID); // Identify the button elements by id // As clickHandlerID is a string, to get the browser to recognise it as a function name var clickHandler = window[clickHandlerID]; console.log(clickHandler); buttonEH.addEventListener("click", clickHandler, false); } /*****************************************************************************/ // Why does this work? // clickHandler1, clickHandler2, etc are not referenced in my event handler. // My botched attempt to create them in the event handler (var clickHandler = window[clickHandlerID];) // resulted in "undefined" values (from console.log(clickHandler)). // Yet it worked?!?! (I did eventually find the correct approach, a simple 10 line solution, // but I am troubled that I don't understand what is going on here. Any help would be greatly appreciated!!) /*****************************************************************************/ function clickHandler0 () { if (pt0.style.display === "block") { pt0.style.display = "none"; } else { pt0.style.display = "block"; } } function clickHandler1 () { if (pt1.style.display === "block") { pt1.style.display = "none"; } else { pt1.style.display = "block"; } } function clickHandler2 () { if (pt2.style.display === "block") { pt2.style.display = "none"; } else { pt2.style.display = "block"; } } #pt0, #pt1, #pt2, #pt3 { display: none; } button 1 button 2 button 3 PT1 PT2 PT3 All functions and variables defined at the top-level scope become properties of the window object. So window['clickHandler1'] is equivalent to clickHandler1. Your code does: var clickhandler = window[clickHandlerID]; when clickHandlerID is set to a string like "clickHandler1", "clickHandler2", etc.

http://stackoverflow.com/comment/47821998
type: Comment
comment on: http://stackoverflow.com/a/29847690
score: 0
has text: Take a look at the fiddle.
type: AnswerComment

http://stackoverflow.com/q/29909400
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/29909941
has body: I want to call my code when the width of the block I listen to changes. How to? onresize is invoked only when the size of the window changes.
answer count: 3
upvote count: 10
tagged with: http://stackoverflow.com/tag/html
has title: Is there a event invoked when a block's width changes?
score: 8
has answer: http://stackoverflow.com/a/29931534
accepted answer: http://stackoverflow.com/a/29931534
has comment: http://stackoverflow.com/comment/47941389
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47941373
possible better answer: http://stackoverflow.com/a/54642735
type: Question
downvote count: 2
has answer: http://stackoverflow.com/a/54642735

http://stackoverflow.com/q/29966811
answer count: 1
tagged with: arrays
downvote count: 0
has comment: http://stackoverflow.com/comment/48053712
tagged with: inheritance
favorite count: 0
has title: JavaScript inheritance and Array object (need explanation for understanding)
has comment: http://stackoverflow.com/comment/48053568
has comment: http://stackoverflow.com/comment/48053757
upvote count: 3
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/3261587
has comment: http://stackoverflow.com/comment/48054038
has answer: http://stackoverflow.com/a/29967215
score: 3
tagged with: javascript
has comment: http://stackoverflow.com/comment/48053421
type: Question
has body: I've been trying to understand inheritance in Javascript and so far I've read many sites about that (including javascript.info and Crockford's Javascript Good parts) - yet I can't seem to understand something as simple as Array inheritance. Maybe if I demonstrate with an example, somebody can correct me and teach me what I'm getting wrong. function ExtendedArray() { Array.call(this, arguments); this.test = function () { return 'something'; } } //I think this is the most standard way to extend a class? ExtendedArray.prototype = []; ExtendedArray.prototype.constructor = ExtendedArray; $scope = {}; $scope.arr = new Array(1, 2, 3); $scope.concatArr = [].concat($scope.arr); $scope.x = new ExtendedArray(1, 2, 3); //empty | instanceof Array = true $scope.concatX = [].concat($scope.x); //empty $scope.y = new ExtendedArray(); //instanceof Array = true $scope.y.push(1, 2, 3); //works - elements are added! $scope.concatY = [].concat($scope.y); //concats it like a object Here is a JS-Fiddle for the same: http://jsfiddle.net/superasn/pq2j139c/ Some questions: How do I fix this code so that ExtendedArray behaves as Array? As you can see $scope.x is empty. Why is the constructor not working? The push functions works!? But then concat fails? How to make concat work? I see there are some libraries to extend Classes, is that a better approach to JS inheritance? Your advise is appreciated!

http://stackoverflow.com/comment/48000670
type: QuestionComment
has text: What does `Meteor.users.find().fetch()` give you? If it's only the current user and you're dead certain that `autopublish` is on, then I would assume you have only one user in database.
score: 0
comment on: http://stackoverflow.com/q/29938436
type: Comment

gnome-3
tags question: http://stackoverflow.com/q/29993531
tag name: gnome-3
type: Tag

http://stackoverflow.com/q/29854384
has title: What to do with escaped unicode characters when calling JSON.parse?
type: UnansweredQuestion
upvote count: 1
score: 1
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/29854458
type: Question
has body: I have some strings that I am writing out as JSON. One of the strings contains the character \u001a. Calling JSON.parse('"\u001a"') results in JSON.parse: bad control character in string literal at line 1 column 2 of the JSON data. What am I supposed to do about this character? Thanks!
downvote count: 0
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/47834625
answer count: 1

http://stackoverflow.com/a/29942741
has comment: http://stackoverflow.com/comment/48015658
accepted answer of: http://stackoverflow.com/q/29942144
answers question: http://stackoverflow.com/q/29942144
has comment: http://stackoverflow.com/comment/48039032
type: AcceptedAnswer
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/48008693
has body: change 'mouseenter' --&gt; 'click' , as 'click' will do it for you with significantly less brain damage. Still I see that your problem statement is not complete If you want complete solution for what you want to achieve,then perhaps you have to give some more details on the problem statement as the statement what you want to achieve and please provide the full html. Use Fiddler and upload the html and scripts and share the link.
type: Answer
has comment: http://stackoverflow.com/comment/48012141
upvote count: 1

http://stackoverflow.com/comment/48031735
has text: @FredMan - Also, what I show in my answer is just an example. I realize you are dealing with time values for your scheduler.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29955109

http://stackoverflow.com/q/29943485
tagged with: javascript
tagged with: popover
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/48021789
has answer: http://stackoverflow.com/a/29945855
has title: Showing Popover in a Table element using Codeigniter
type: UnansweredQuestion
tagged with: php
tagged with: codeigniter
type: Question
has body: Can anyone explain how to use popover on a table element using Codeigniter? &lt;td&gt; &lt;span id="popover" data-toggle="popover" data-content="&lt;?php echo $userData[$i]-&gt;name; ?&gt;"&gt;&lt;/span&gt;&lt;?php echo custom_echo($userData[$i]-&gt;name,15); ?&gt;&lt;/td&gt; And javascript code is &lt;script&gt; $(document).ready(function() { $("#popover").popover({ html: true, animation: false, placement: "bottom" }); }); &lt;/script&gt;

http://stackoverflow.com/q/29961688
has answer: http://stackoverflow.com/a/29961816
has comment: http://stackoverflow.com/comment/48043790
tagged with: facebook
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
upvote count: 0
has comment: http://stackoverflow.com/comment/48043764
type: UnansweredQuestion
tagged with: php
has body: I have game which is on html 5. All the script in js. So i want o fetch the game score result and display in my webpage (php or html tag) I want to share that score by twitter and facebook. this is the javascript I want to display this by php on my webpage. I just need to share that js score to facebook and twitter. thanks
type: Question
has title: i want to share the score of my html 5 game by facebook and twitter
downvote count: 2
score: -2
answer count: 1
tagged with: javascript

http://stackoverflow.com/comment/48061277
comment on: http://stackoverflow.com/q/29970740
type: Comment
type: QuestionComment
has text: First thing: move your js right before the closing body tag, not after.
score: 0

http://stackoverflow.com/a/29857651
answers question: http://stackoverflow.com/q/29856976
score: 0
has body: Well, I just found a possible way of doing this; I don't currently have time to thoroughly test it, but it appears to work on a basic level. &lt;script src="myMasterScript.js" type="text/definitelynotjavascriptnopenosir"&gt;&lt;/script&gt; This works in an interesting way. I can see that the request is made for the script source, AND if it's valid JavaScript, it will execute. (As found from just referring to the JQuery CDN) However, the browser's console will essentially squelch any kind of errors that occur from running it; ie, "Oh. Maybe I wasn't supposed to run that". For my own purposes, I still need to figure out, based on the JQuery scenario, whether this might still mess up the page to some degree.
type: Answer

http://stackoverflow.com/a/29922346
accepted answer of: http://stackoverflow.com/q/29922247
has body: It is normal, because of the prev element is .subtitle, so if you want to access on .slots, use the following method: var $count = $(this).prev().find('.slots .in');
has comment: http://stackoverflow.com/comment/47966055
downvote count: 0
has comment: http://stackoverflow.com/comment/47966210
type: AcceptedAnswer
upvote count: 2
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/47966405
answers question: http://stackoverflow.com/q/29922247

http://stackoverflow.com/q/29866604
type: Question
type: AnsweredQuestion
score: 1
has body: How can I add my values owdid and visited id after clicking below link by ajax? &lt;a href="index.php" onclick="insertvisit(&lt;?php echo $interestid;?&gt;)"&gt;member1&lt;/a&gt; Below is my insertvisit function. I have defined owdid and interestid function insertvisit(visitedid) { $.ajax({ type: "POST", url: 'insertvisit.php', data:{'field1' : owdid, 'field2' : visitedid}, success:function(html) { } }); } and below is insertvisit.php global $pdo; $ownid = $_GET['field1']; $interestid =$_GET['field2']; $query = $pdo-&gt;prepare("UPDATE tablem SET field1= ? WHERE field2= ?"); $query -&gt; bindValue(1, $ownid); $query -&gt; bindValue(2, $interestid); $query -&gt; execute(); Please help thanks.
has answer: http://stackoverflow.com/a/29866827
accepted answer: http://stackoverflow.com/a/29866827
has comment: http://stackoverflow.com/comment/47858095
upvote count: 1
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: ajax
tagged with: pdo
downvote count: 0
has comment: http://stackoverflow.com/comment/47858113
tagged with: php
has title: Post and Get value by jquery ajax

http://stackoverflow.com/comment/48450342
comment on: http://stackoverflow.com/a/30134616
type: Comment
has text: @Kaiido Yes. Attempted to suggest utilizing `data URI` of background "bars" inline , instead of linked to external resource. Did not attempt , here, to do so; unaware of any possible licensing , etc. attached to that specific image ? Also considered suggesting creating linear-gradient as substitute for external link . Tried to open `svg` , with data-uri as src of "bars" at http://stackoverflow.com/a/30135485/2801559; `svg` appear not to have `namespace` of `svg`, `xlink` included at `svg` ? Which image at http://stackoverflow.com/a/30135485/3702797 renders resultant `svg` as `png` ?
type: AnswerComment
score: 0

http://stackoverflow.com/q/30000057
type: AnsweredQuestion
score: 1
accepted answer: http://stackoverflow.com/a/30000854
tagged with: knockout.js
has body: in parse.com I opened up this account g2840904@trbvm.com/12345678. I forked https://github.com/tachang/knockout_tasklist which synchronizes knockout to parse.com and when i start up the app i do see as the only item sometitle1 however if I change sometitle1 to sometitle2 in parse.com task class i don't see this being relfected automatically in the webapp. isn't that what knockout supposed to do when the variable title is defined as observabale? this.title = ko.observable(data.title); What should I do so it does reflect automatically changes in model? meaning changing for example sometitle1 to sometitle2 in parse.com would update the web page to reflect that change auotmatically and present sometitle2 instead of sometitle1?
type: Question
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: knockout-2.0
has answer: http://stackoverflow.com/a/30000854
has title: why knockout does not auto update by model changes?
upvote count: 1
has comment: http://stackoverflow.com/comment/48122058

http://stackoverflow.com/q/29902603
upvote count: 1
type: Question
tagged with: hapi.js
tagged with: javascript
has comment: http://stackoverflow.com/comment/47953166
has body: I have a main route handler in Hapi.js that I need to send control to another handler based on the parameters sent. For instance, if I POST a message with a type of 'twilio' I want to forward the request to a route handler contained in my twilio routes file. How do I forward the handler to another handler?
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/48024216
has comment: http://stackoverflow.com/comment/47998139
favorite count: 0
has answer: http://stackoverflow.com/a/29951785
tagged with: node.js
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29951785
has title: Can I transfer control to another handler in Hapi.js?
score: 1

http://stackoverflow.com/a/29923726
accepted answer of: http://stackoverflow.com/q/29923542
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29923542
score: 1
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/47972233
has body: You should define right route for DELETE article, like this: Route::delete('/article/{id}', ['as' =&gt; 'article-delete', 'uses' =&gt; 'HomeController@deleteArticle']); In the HomeController $id variable (article ID) will be available as a method parameter: function deleteArticle($id) { … } In PHP side you defined DELETE route, it means you should make DELETE request on JS side using the ajax method: $.ajax({ url: '/article/' + articleId, type: 'DELETE', success: function(result) { // Do something with the result } });
downvote count: 0

http://stackoverflow.com/a/29951888
upvote count: 1
downvote count: 1
type: Answer
has body: The CSS declaration that you inject into the DOM after the AJAX request has been completed doesn't modify the background color of the body because it doesn't reload the page. If you want to change the background color after the request without reloading the page, you should probably use JavaScript. Like so: document.getElementById("elementId").style.backgroundColor = "blue"; Hope it helps.
answers question: http://stackoverflow.com/q/29950975
score: 0

http://stackoverflow.com/comment/47954275
type: QuestionComment
has text: @Grimbode Were you able to spot anything? :)
comment on: http://stackoverflow.com/q/29880200
score: 0
type: Comment

http://stackoverflow.com/comment/47942000
has text: Can you supply an example where it doesn't work?
type: Comment
type: QuestionComment
score: 2
comment on: http://stackoverflow.com/q/29909868

http://stackoverflow.com/a/29999008
answers question: http://stackoverflow.com/q/29998777
type: Answer
has comment: http://stackoverflow.com/comment/48140559
score: 0
has body: Try this : in_Inputs = some_email.getElementsByTagName("input"); var model = { index: 0, ret_val: false } function check_this_email(in_Inputs, model) { if(model.index &gt; in_Inputs.length){ return model.ret_val; } bad_email_check(in_Inputs, model, check_this_email); } function bad_email_check(in_Inputs, index, callback){ //check email in_Inputs[model.index] //if valid email model.ret_val = true model.index++ if(model.ret_val){ do_something(callback, in_Inputs, model); } else{ callback(in_Inputs, model); } } function do_something(callback, in_Inputs, model){ //do something callback(in_Inputs, model); } Working example on jsfiddle: https://jsfiddle.net/d81wmm61/

http://stackoverflow.com/q/29954407
downvote count: 2
answer count: 3
has comment: http://stackoverflow.com/comment/48029982
tagged with: boolean-logic
favorite count: 0
type: AnsweredQuestion
duplicate of: http://stackoverflow.com/q/24778909
has answer: http://stackoverflow.com/a/29954449
has body: As the title said, I can't quite understand why (true &amp;&amp; {}) gives me {}, but the reverse is not the same. Edit: As a followup, since I'm using a boolean operator, why does this expression not give me a boolean when evaluated?
has answer: http://stackoverflow.com/a/29954445
accepted answer: http://stackoverflow.com/a/29954445
type: Question
has answer: http://stackoverflow.com/a/29954457
upvote count: 6
tagged with: javascript
linked to: http://stackoverflow.com/q/24778909
score: 4
has title: Why does (true && {}) evaluate to {}, but ({} && true) evaluates to true?
possible better answer: http://stackoverflow.com/a/29954449
tagged with: boolean

http://stackoverflow.com/comment/47914893
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29886534
has text: @SMcCrohan wavv you are right! I updated it, I think it should be working now.

http://stackoverflow.com/comment/99776993
score: 0
type: Comment
comment on: http://stackoverflow.com/a/49963912
has text: This solved it to me, and it also remove another error that says "Uncaught TypeError: Cannot read property 'fn' of undefined" that is was just showing in the console.
type: AnswerComment

http://stackoverflow.com/q/29978069
accepted answer: http://stackoverflow.com/a/29978223
has comment: http://stackoverflow.com/comment/48076329
has comment: http://stackoverflow.com/comment/48075908
has comment: http://stackoverflow.com/comment/48075860
upvote count: 0
has comment: http://stackoverflow.com/comment/48075966
tagged with: arrays
has comment: http://stackoverflow.com/comment/48076004
tagged with: javascript
has comment: http://stackoverflow.com/comment/48076009
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/48075972
has answer: http://stackoverflow.com/a/29978223
has comment: http://stackoverflow.com/comment/48075882
has comment: http://stackoverflow.com/comment/48075791
favorite count: 0
score: -1
tagged with: angularjs
has comment: http://stackoverflow.com/comment/48075952
type: Question
has body: app.factory('Shop', function() { var price = 0; var cart = new Array(); return { totalPrice: function() { return price; }, setTotalPrice: function(newPrice) { price = newPrice; }, addToPrice: function(addedPrice) { price += addedPrice; }, getCart: function() { return cart; }, setCart: function(c) { cart = c; for (product in cart) { if (product.price) { addToPrice(product.price); } } }, addToCart: function(product) { console.log(typeof(cart)); cart.push(product); addToPrice(product.price); }, emptyCart: function() { cart = []; } }; }); this actually is angularJS, however I am initialising cart = new Array(); and when I console.log(typeof(cart)); it logs object. and also the cart.push fails with an error because it is of type object. Any idea how I can get an actually array of it?
has title: Javascript new Array() returns object type
has comment: http://stackoverflow.com/comment/48075830
has comment: http://stackoverflow.com/comment/48075990
answer count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/48075899
linked to: http://stackoverflow.com/q/931872
has comment: http://stackoverflow.com/comment/48076220

http://stackoverflow.com/q/29954425
downvote count: 0
tagged with: javascript
answer count: 1
tagged with: menu
favorite count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29954780
has title: Responsive Select Menu - Javascript only with onChange
score: 1
upvote count: 1
type: Question
tagged with: mobile
has body: I encountered a strange issue today. My responsive menu does not seem to be working on all mobile devices. On the Samsung S5 when I click on any option, the page loads, but the menu does not disappear/close. When I select something else, it does not redirect again. I am trying to use a simple onchange script. Any help is appreciated. Navigation Menu Home Services Testimonials Faq

http://stackoverflow.com/a/29918469
accepted answer of: http://stackoverflow.com/q/29918400
score: 8
answers question: http://stackoverflow.com/q/29918400
has body: Appreciate that you are taking initiative to learn PHP, jQuery and AJAX. Just some modifications and you are on track: Javascript (jQuery): Content of ajax.php is: <?php //echo ' '; // Change above line to: echo "hello world"; ?>
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/104126003
upvote count: 8
type: Answer

http://stackoverflow.com/comment/48069239
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/29974316
type: Comment
has text: This is pretty slick. The first time I click "Left" the transition effect does not happen. If I click "Right" first though, things seem to work. Should I explicitly call `$images.css("left", -150);` when the page loads to workaround this or is there a better solution?

http://stackoverflow.com/a/29894090
upvote count: 2
has comment: http://stackoverflow.com/comment/47911531
answers question: http://stackoverflow.com/q/29893885
has comment: http://stackoverflow.com/comment/47911613
has body: jQuery uses timeouts internally to animate, there's no other way to do this. Generally you get better flow if you use the timers in Window.requestAnimationFrame instead of window.setTimeout, as it's built for animating and has higher precision.. What you really should be doing is looking at libraries like GSAP from Greensock, or consider using CSS3 for the animation, which would give you a much smoother animation most of the time. Also note that you're really calling eval on the function as you're passing in a string to setTimeout that is evaluated, you should just reference the function setTimeout(moveObject, 10); and 10 milliseconds is a really low number, that used to be the absolute minimum, these days HTML5 sets it to 4ms, but not all browser follow that, only a few years back most browsers couldn't go below 50ms.
downvote count: 0
type: Answer
score: 2

http://stackoverflow.com/comment/48169978
type: Comment
comment on: http://stackoverflow.com/a/29966883
has text: Hmm I'm getting a "Error: JSON.parse: unexpected non-whitespace character after JSON data at line 1
type: AnswerComment
score: 0

http://stackoverflow.com/q/29868569
has answer: http://stackoverflow.com/a/29868598
tagged with: javascript
possible better answer: http://stackoverflow.com/a/29868604
score: 0
answer count: 2
accepted answer: http://stackoverflow.com/a/29868598
has answer: http://stackoverflow.com/a/29868604
has title: Open only the dropdown that was clicked
tagged with: jquery
type: AnsweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/47862221
has body: I'm trying to make a dropdown. Here is my code: FIDDLE However it opens each dropdown when it's been clicked, instead of just the one that was clicked. How can I isolate it? This is the full JS: $(function () { $('.click-nav &gt; ul').toggleClass('no-js js'); $('.click-nav .js ul').hide(); $('.click-nav .js').click(function (e) { $('.click-nav .js ul').toggle(); $('.clicker').toggleClass('active'); e.stopPropagation(); }); $(document).click(function () { if ($('.click-nav .js ul').is(':visible')) { $('.click-nav .js ul', this).slideUp(); $('.clicker').removeClass('active'); } }); });

http://stackoverflow.com/comment/48121748
score: 0
type: Comment
has text: @Keaire No problem, if you need any help understanding it feel free just to ask.
comment on: http://stackoverflow.com/a/30001425
type: AnswerComment

http://stackoverflow.com/comment/47967536
type: QuestionComment
comment on: http://stackoverflow.com/q/29917249
score: 0
has text: I rolled back your last update as my answer (and answers in general...) will stop making sense if you remove the original code and question. Please leave the original as it is and add new details below it.
type: Comment

http://stackoverflow.com/comment/48082568
type: QuestionComment
comment on: http://stackoverflow.com/q/29981500
score: 0
has text: i saw the duration property of voices but couldn't make them work. Can you show, what you mean?
type: Comment

http://stackoverflow.com/comment/47826960
score: 0
comment on: http://stackoverflow.com/q/29850407
type: Comment
type: QuestionComment
has text: Why not just cut the last character? Smth like this: `text.substr(0, -1)`

http://stackoverflow.com/comment/48057084
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/29967933
has text: @SalmanA This isn't valid HTML markup as i'm aware of, i meant having same class on same element twice doesn't make sense
type: Comment

http://stackoverflow.com/comment/48130361
comment on: http://stackoverflow.com/q/29994139
score: 0
type: Comment
type: QuestionComment
has text: Here, I posted a JsFiddle https://jsfiddle.net/surfaspen/yz87b53d/

http://stackoverflow.com/comment/47877216
has text: Which module name is failing?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29876454
score: 0

http://stackoverflow.com/a/29981871
answers question: http://stackoverflow.com/q/29981726
downvote count: 0
type: Answer
has body: $el.click(tst); function tst(e) { e.preventDefault(); var id = $(this).attr('id'); }
upvote count: 1
has comment: http://stackoverflow.com/comment/48083309
score: 1

http://stackoverflow.com/comment/47898782
comment on: http://stackoverflow.com/q/29887272
has text: Thanks, But function assigned to (dynamic) field is anonymous. what I want is to retrieve is field name.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29891458
upvote count: 36
tagged with: webpack
downvote count: 0
tagged with: javascript
has title: webpack require every file in directory
has body: This is my file structure -main.js -SomeDir -fileA.js -fileB.js What should I do if I want to load (inside main.js) every file in someDir without specifying the file names - something like: require(./someDir/*.js) ?
has answer: http://stackoverflow.com/a/31770875
answer count: 4
favorite count: 0
has answer: http://stackoverflow.com/a/41410938
has answer: http://stackoverflow.com/a/34252626
has answer: http://stackoverflow.com/a/70223513
possible better answer: http://stackoverflow.com/a/41410938
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/31770875
type: Question
score: 36

http://stackoverflow.com/comment/48004839
has text: Plugin Name is WP Responsive Menu. Or suggest me other plugin. I am new to wordpress.
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29941976

http://stackoverflow.com/comment/48111425
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29995428
has text: @vasilenicusor you implement your website code, I'll do mine :) You never know when some genius at Google will find a new Chrome optimsation that causes your code to fail. If it's not in the spec, then relying on the behavior is an obvious (and, really, pointless) risk.

http://stackoverflow.com/a/29902420
score: 4
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29902394
has comment: http://stackoverflow.com/comment/47931699
has comment: http://stackoverflow.com/comment/47931438
type: Answer
answers question: http://stackoverflow.com/q/29902394
has comment: http://stackoverflow.com/comment/47927460
has comment: http://stackoverflow.com/comment/47930431
has body: Just remove the parentheses and the argument, this will be available in the callback $(".loadMore").on("click", loadMoreClicked); function loadMoreClicked(){ var elementID = this.id; }
upvote count: 4

http://stackoverflow.com/q/29879199
favorite count: 0
has answer: http://stackoverflow.com/a/29879983
has body: I have a rather tricky situation. In short, I need to find a way to add an image overlay, onto an image, using only a single image tag. More specifically I am trying to add a resize icon to the bottom right of an image alerting the user that they can resize the image by cliking and dragging at the markers position. I am using inline CKEditor, with Interact.js to allow images to be resized inline. All works fine, but without this image marker it isn't very obvious that you can resize the image. Unfortunately :before and :after on img tags does not work. If I could just do that, it would be fine. I can not wrap the image in a container because that disrupts the image editing features like dragging and dropping into another position. The entire effect must be contained within the img tag. The best I have been able to come up with is adding a css border image of the resize icon and collapsing the left and top borders. It adds the marker in a way which will work, but I would prefer the marker to be on the image, and not positioned outside of it like in my preview. Also, because it is a border image I can't add a custom cursor to let the user know that they can click there. So any ideas? I might have to just settle for this and move on. I would prefer a pure CSS solution to this, but I am not opposed to using javascript and/or jquery to achieve it. I tried doing something where when you moused over it the image would get a wrapper with an image that I positioned, but it doesn't work as one would expect. #foo{ padding:0 16px 16px 0} #foo:hover{ border: 10px solid transparent; padding: 0; -webkit-border-image: url(/templates/client/js/ckeditor/plugins/compuimage/images/resize.png) 50 round; /* Safari 3.1-5 */ -o-border-image: url(/templates/client/js/ckeditor/plugins/compuimage/images/resize.png) 50 round; /* Opera 11-12.1 */ border-image: url(/templates/client/js/ckeditor/plugins/compuimage/images/resize.png) 50 round; border-width:0 16px 16px 0; padding:0; } Thanks
has comment: http://stackoverflow.com/comment/47884584
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47884263
tagged with: css
has title: Adding Image Overlays on Images Using A Single Image
has comment: http://stackoverflow.com/comment/47882538
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/47883626
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/47882700
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/47883858

http://stackoverflow.com/comment/48438934
type: Comment
comment on: http://stackoverflow.com/a/30018407
has text: @Mr.Wonko, what line-endings do you use in [your example](http://stackoverflow.com/questions/30000950/documenting-javascript-code-in-vscode-for-intellisense/30018407#comment48384397_30018407) above?
type: AnswerComment
score: 0

http://stackoverflow.com/q/29912285
tagged with: requirejs
has title: How can I mock RequireJs loader plugin responses in unit tests
tagged with: unit-testing
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29917570
tagged with: squirejs
type: Question
score: 0
tagged with: mocking
linked to: http://stackoverflow.com/q/11439540
answer count: 1
tagged with: javascript
has body: The code I'm trying to test relies on RequireJs loader plugins. Example with requirejs/text: require(['text!templates/foo'], function (data) { // handle loaded data }); For a specific unit test, I'm trying to mock the response for text!templates/foo and override with one relevant for the test: it('should load a template', function (done) { // TODO: mock 'text!templates/foo' here to return 'mock_data' // templateViewer uses the text plugin internally to do the actual loading templateViewer.templateFor('foo', function (error, templateData) { expect(templateData).toEqual('mock_data'); done(); }); }); I've looked at RequireJs dependency mock solutions, especially Squire.js but it seems they are all suited for mocking regular dependencies and not plugin responses. I've also looked at stub libraries like sinon to maybe replace the actual require call but that seems problematic. What's the recommended practice? I prefer not to replace the entire text plugin with a mock one in my requirejs configuration, just override some of its responses in specific tests. My setup is node+mocha+requirejs Edit Please see this example fiddle project to see my issue with Squire: http://runnable.com/VUBoI0ex6v9Gs-BJ/squirejs-with-plugins-for-node-js-and-hello-world
has answer: http://stackoverflow.com/a/29917570

http://stackoverflow.com/comment/47993350
type: AnswerComment
has text: I have set same thing but it shows error `cboxphoto.setAttribute is not a function`
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29935491

http://stackoverflow.com/comment/47935227
has text: *"Quotes are a good practice when using non-standard identifiers"* That's the first time I here about this good practice. Either way, your answer suggests that quotes are required, which is not the case (and the point of my comment).
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/29906058
type: Comment

http://stackoverflow.com/a/29923796
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29923661
score: 4
answers question: http://stackoverflow.com/q/29923661
type: Answer
upvote count: 4
has body: This is one of those amusing situations where the answer is: Use more jQuery. :-) If you want to consistently get an array-like thing (specifically: a jQuery instance), instead of document.searchCridResults.psn use $(document.searchCridResults).find("[name=psn]") The issue is that when there's only one, document.searchCridResults.psn is a reference to that one element. When there's more than one, the DOM creates an array-like thing (a NodeList) instead. jQuery, on the other hand, is always set-based (which is a big part of its power). For instance, that loop creating the commaSepVals string can be converted to: commaSepVals = $(document.searchCridResults).find("[name=psn]").filter(function() { return this.checked; }).map(function() { return this.value; }).get().join(","); Live Example: $("[name=psn]").on("click", function() { var commaSepVals = $("#searchCridResults").find("[name=psn]").filter(function() { return this.checked; }).map(function() { return this.value; }).get().join(","); $(" Selected: " + commaSepVals + " ").appendTo(document.body); }); Click checkboxes below first second third fourth Side note: It's invalid to use the same id value on more than one element. The same name is fine, but not the same id.
downvote count: 0

http://stackoverflow.com/comment/47879803
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29877777
has text: I forgot to add there’s one other subtle change, which i’ve now edited to include: `onclick=“ApricotWheat(this); return false;”>` (Instead of `onclick="$(this).parents('form').submit(); return false;”>`)

http://stackoverflow.com/a/29897458
answers question: http://stackoverflow.com/q/29897405
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/47918052
score: 1
has body: str is an array since .split('?'); creates an array of strings, and you cannot apply .substring() on an array. You need to apply it to its elements: for(i=0;i&lt;str.length;i++){ var res = str[i].substring(6,14); alert(res); } or var res = str[1].substring(6,14);
downvote count: 0

http://stackoverflow.com/a/29971649
downvote count: 0
type: AcceptedAnswer
has body: You should try this jquery solution: var colors = ['blue', 'green', 'red'], timer = 1000; setInterval(function() { for(var c in colors) { var $current = $('.' + colors[c]), $next = $current.next('li'); if($next.length == 0) { $next = $('ul li:first-child'); } $current.removeClass(colors[c]); $next.addClass(colors[c]); } }, timer); .red { color: red; } .blue { color: blue; } .green { color: green; } lorem ipsum dolor hello world again
upvote count: 3
accepted answer of: http://stackoverflow.com/q/29971093
answers question: http://stackoverflow.com/q/29971093
type: Answer
score: 3

http://stackoverflow.com/a/29914954
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/29914259
has comment: http://stackoverflow.com/comment/47954611
accepted answer of: http://stackoverflow.com/q/29914259
type: Answer
has comment: http://stackoverflow.com/comment/47953384
has body: Have a look at: https://jqueryui.com/draggable/#visual-feedback Create a helper function resulting in Html representing your selected items and use it as 'visual feedback' when setting up your draggable.
upvote count: 1
has comment: http://stackoverflow.com/comment/47951597
has comment: http://stackoverflow.com/comment/47953188
type: AcceptedAnswer

page-lifecycle
type: Tag
tags question: http://stackoverflow.com/q/29931998
tag name: page-lifecycle

http://stackoverflow.com/q/29891944
score: 0
has answer: http://stackoverflow.com/a/29892580
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47908157
accepted answer: http://stackoverflow.com/a/29892580
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/html
has title: Begin body scrolling, after Head Container reached min-height
linked to: http://stackoverflow.com/q/4770025
has comment: http://stackoverflow.com/comment/47907646
has comment: http://stackoverflow.com/comment/47907576
type: Question
has body: I have a pretty simple page, if I scroll down, the height of my header reduces until its min-height, this works as I want. But the body scrolls simultaneously to decreasing the Height of my Head-Container. I'd like to let begin body scrolling after, Head-Container reached its min-height. I added something like into the first if of my script: if(st < 100) { $("#Head").scrollTo(0); } but this doesn't work, as I override the right scrolling values. Any suggestions? Thanks in advance, Johannes My Head Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla sodales lorem et mauris feugiat eu interdum neque imperdiet. In ullamcorper laoreet blandit. Phasellus quis leo quam, ac adipiscing lectus. Aenean vulputate pharetra lorem sit amet scelerisque. Aliquam erat volutpat. Nullam ac ante mauris. Integer et diam ante. Aenean eu elit vel sem semper sagittis quis sit amet erat. Praesent fermentum, justo nec suscipit rhoncus, massa metus varius dolor, ac sollicitudin lectus risus nec est. Nunc venenatis justo at enim iaculis nec sagittis eros imperdiet. Fusce porta venenatis sodales. Curabitur molestie quam in arcu porttitor sollicitudin. Proin egestas luctus sapien nec auctor. Aenean ut sapien leo, et euismod nulla. Suspendisse ac feugiat orci. Vestibulum vitae magna diam, non fringilla dui. Vivamus auctor mi ut eros egestas ut malesuada orci lobortis. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Proin ut ipsum feugiat ligula sagittis malesuada a vel orci. Sed sit amet nisl id risus sollicitudin venenatis. Donec lobortis facilisis mauris, sed eleifend nunc laoreet quis. Nulla neque orci, aliquam eget rhoncus ut, feugiat id erat. Duis orci sapien, dictum non pretium non, egestas in nisl. Aenean felis turpis, aliquet ac consectetur ac, pulvinar vitae dui. Aenean lacus lorem, rhoncus id dictum sit amet, luctus quis metus. Nullam posuere dignissim hendrerit. Nam tristique urna non neque laoreet nec porta tortor vestibulum. Ut varius …
tagged with: css
answer count: 1

http://stackoverflow.com/q/29951458
tagged with: ember.js
has body: I started looking on embedded record mixin for serialising/deserialising records with hasMany/belongs to relationship. Model: App.Post= DS.Model.extend({ comment: DS.belongsTo('comment'), name: DS.attr('string') }); App.Comment =DS.Model.extend({ post: DS.belongsTo('Post'), value: DS.attr('string') }); Serializer: App.PostSerializer = DS.RESTSerializer.extend(DS.EmbeddedRecordsMixin, { attrs: { comments: {embedded: 'always'} } }); When i try to save the model,i got the following error. var model = this.store.createRecord('post'); model.get('comments').pushObject(this.store.createRecord('comment')); model.setProperties({ name: 'test' }); model.save(); Error: Assertion Failed: You must include an id for App.Comment in an object passed to push . Only the error in browser console but to the backend ,data goes as expected. So, i started looking for workaround and found something interesting in https://gist.github.com/vampolo/8f8237cce2b8a52ab9d4. source : http://vincenzo-ampolo.net/2014/09/21/ember-data-embedded-records-without-ids-ready-to-go/ On following that link, i changed my serialiser as follows. Serializer (changed): App.PostSerializer=DS.RESTSerializer.extend(DS.EmbeddedRecordsMixin,DS.NoKeyMixin, { attrs: { comments: {embedded: 'always',noKey: true} } }); But when i save the model now, i am getting the floowing error. Uncaught TypeError: embeddedRecord.serialize is not a function. I am stuck on this and looking for help. Thanks in advance.
answer count: 0
has comment: http://stackoverflow.com/comment/55957709
type: Question
has comment: http://stackoverflow.com/comment/83022270
tagged with: ember-data
tagged with: javascript
score: 4
upvote count: 4
tagged with: mixins
downvote count: 0
tagged with: jquery
favorite count: 0
has title: Serialize records without id in embedded record mixin
type: UnansweredQuestion

http://stackoverflow.com/a/29847233
type: Answer
has comment: http://stackoverflow.com/comment/47820344
has body: Try like:
score: 0
answers question: http://stackoverflow.com/q/29846162

http://stackoverflow.com/a/42531527
has body: in ES6 you could go with generator: var obj = {1: 'a', 2: 'b'}; function* entries(obj) { for (let key of Object.keys(obj)) { yield [key, obj[key]]; } } let generator = entries(obj); let step1 = generator.next(); let step2 = generator.next(); let step3 = generator.next(); console.log(JSON.stringify(step1)); // {"value":["1","a"],"done":false} console.log(JSON.stringify(step2)); // {"value":["2","b"],"done":false} console.log(JSON.stringify(step3)); // {"done":true} Here is the jsfiddle. In the output you will get an object with the "value" and "done" keys. "Value" contains everything you want it to have and "done" is current state of the iteration in bool.
type: Answer
answers question: http://stackoverflow.com/q/29885220
score: 0

http://stackoverflow.com/a/58404595
has body: For those of you checking this in 2019+ According to the knex documentation To run a specific seed file, execute: $ knex seed:run --specific=seed-filename.js
has comment: http://stackoverflow.com/comment/129738914
score: 24
upvote count: 24
has comment: http://stackoverflow.com/comment/105007987
downvote count: 0
has comment: http://stackoverflow.com/comment/105019046
answers question: http://stackoverflow.com/q/29918989
type: Answer

http://stackoverflow.com/q/29845679
type: UnansweredQuestion
score: 1
upvote count: 1
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/29849841
has title: Foundation Interchange not changing background image
tagged with: zurb-foundation
answer count: 1
downvote count: 0
tagged with: jquery
has body: I'm trying to use Foundations Interchange plugin to change the background image on a div dependant on the screen size but I'm unable to figure out why it's not working correctly. Foundation is initialised fine and when I resize the screen data-uuid is updated, but there is no background-image style. I've created a jsfiddle to show you what I'm doing: &lt;div data-interchange="[image1.png, (large)],[image2.png, (medium)]"&gt;&lt;/div&gt; https://jsfiddle.net/rb90qq08/6/ This is exactly how it should be according to the documentation.
favorite count: 0

http://stackoverflow.com/comment/48009784
type: QuestionComment
comment on: http://stackoverflow.com/q/29934813
score: 0
type: Comment
has text: I believe that the question isn't hard to understand Xan. I know there are many other limits, but I need to solve one in a proper way first in order to replicate that on the others analogically

http://stackoverflow.com/q/29981644
downvote count: 0
tagged with: javascript
tagged with: jquery
tagged with: kendo-ui
has answer: http://stackoverflow.com/a/29982025
tagged with: kendo-scheduler
answer count: 1
favorite count: 0
upvote count: 1
has title: Kendo Scheduler same start and end date for all day event
has body: I want to make start date and end date same for Kendo UI Scheduler when All day event set to false. I tried this on edit: edit: function (e) { e.event.set("isAllDay", false); a = e.event.start; a.setHours(a.getHours() + 1) e.event.set("end", new Date(a)); } But it is not making end same as start. Can anyone help?
type: AnsweredQuestion
score: 1
type: Question
accepted answer: http://stackoverflow.com/a/29982025

http://stackoverflow.com/comment/47932196
comment on: http://stackoverflow.com/a/29859309
score: 0
type: AnswerComment
has text: Maybe open Developer Tools in IE before you start it up?
type: Comment

http://stackoverflow.com/comment/48091029
comment on: http://stackoverflow.com/q/29975968
score: 0
type: QuestionComment
type: Comment
has text: This is a duplicate of http://stackoverflow.com/questions/29831885/how-to-deploy-aurelia-to-github-pages-gh-pages/

http://stackoverflow.com/q/29966509
type: AnsweredQuestion
has body: I am having trouble with the built-in slider in this theme: Eda Opencart Theme I relised after purchase that it doesn't move automatically. Is there a way to change the javasript code to make it move eevry, let's say 4 seconds? That's the code: /* * jQuery FlexSlider v2.2.0 * Copyright 2012 WooThemes * Contributing Author: Tyler Smith */(function(e){e.flexslider=function(t,n){var r=e(t);r.vars=e.extend({},e.flexslider.defaults,n);var i=r.vars.namespace,s=window.navigator&&window.navigator.msPointerEnabled&&window.MSGesture,o=("ontouchstart"in window||s||window.DocumentTouch&&document instanceof DocumentTouch)&&r.vars.touch,u="click touchend MSPointerUp",a="",f,l=r.vars.direction==="vertical",c=r.vars.reverse,h=r.vars.itemWidth>0,p=r.vars.animation==="fade",d=r.vars.asNavFor!=="",v={},m=!0;e.data(t,"flexslider",r);v={init:function(){r.animating=!1;r.currentSlide=parseInt(r.vars.startAt?r.vars.startAt:0);isNaN(r.currentSlide)&&(r.currentSlide=0);r.animatingTo=r.currentSlide;r.atEnd=r.currentSlide===0||r.currentSlide===r.last;r.containerSelector=r.vars.selector.substr(0,r.vars.selector.search(" "));r.slides=e(r.vars.selector,r);r.container=e(r.containerSelector,r);r.count=r.slides.length;r.syncExists=e(r.vars.sync).length>0;r.vars.animation==="slide"&&(r.vars.animation="swing");r.prop=l?"top":"marginLeft";r.args={};r.manualPause=!1;r.stopped=!1;r.started=!1;r.startTimeout=null;r.transitions=!r.vars.video&&!p&&r.vars.useCSS&&function(){var e=document.createElement("div"),t=["perspectiveProperty","WebkitPerspective","MozPerspective","OPerspective","msPerspective"];for(var n in t)if(e.style[t[n]]!==undefined){r.pfx=t[n].replace("Perspective","").toLowerCase();r.prop="-"+r.pfx+"-transform";return!0}return!1}();r.vars.controlsContainer!==""&&(r.controlsContainer=e(r.vars.controlsContainer).length>0&&e(r.vars.controlsContainer));r.vars.manualControls!==""&&(r.manualControls=e(r.vars.manualControls).length>0&&e(r.vars.manualControls));if(r.vars.randomize){r.slides.sort(functi…
type: Question
tagged with: javascript
has title: How I can make my jquery Flexslider move automatically?
has answer: http://stackoverflow.com/a/29967450
score: 0
answer count: 2
tagged with: jquery
tagged with: opencart
tagged with: slider
tagged with: flexslider
accepted answer: http://stackoverflow.com/a/29967450
possible better answer: http://stackoverflow.com/a/29966842
has answer: http://stackoverflow.com/a/29966842

http://stackoverflow.com/comment/104586405
type: QuestionComment
comment on: http://stackoverflow.com/q/29867862
has text: Does this answer your question? [How do you display JavaScript datetime in 12 hour AM/PM format?](https://stackoverflow.com/questions/8888491/how-do-you-display-javascript-datetime-in-12-hour-am-pm-format)
type: Comment
score: 0

http://stackoverflow.com/comment/48113490
has text: I've tried for a while now but haven't been able to figure it out. The Todo app just complicated it as they don't even initialize Parse in it.
comment on: http://stackoverflow.com/a/29958603
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/47883746
type: Comment
has text: I was actually vaguely hoping that despite the fact that the classes just add some much begotten syntax on top of existing patterns, they would do something to subclass a series of mixins. I've seen the spec use a lot of {Something as Something} syntax, so I thought it may have required something like that, but I did not realize that extends was actually just evaluating an expression as opposed to searching for an actual functional argument or series of functional arguments. Thanks!
comment on: http://stackoverflow.com/a/29879374
type: AnswerComment
score: 0

http://stackoverflow.com/comment/48013423
type: Comment
has text: @Growler maybe you can find answer here http://stackoverflow.com/a/22407031/1331425
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29945848

http://stackoverflow.com/q/29945447
has comment: http://stackoverflow.com/comment/48012461
tagged with: overriding
tagged with: javascript
linked to: http://stackoverflow.com/q/4933288
type: AnsweredQuestion
downvote count: 0
has answer: http://stackoverflow.com/a/29955623
score: 1
favorite count: 0
has body: I would like to override a function of a JS object by adding it to its prototype. var originalObject = function(){ this.someFun = function(){ // ... } } var otherObj = function(){ this.otherFun = function(){ originalObject.prototype.fun = function(){ return 'This is the overwritten function.'; } var o = new originalObject(); return o.fun() } } This way when I execute new otherObj().otherFun() I have the expected result ('This is the overwritten function.'), but if the function I'm trying to add is already part of originalObject var originalObject = function(){ this.fun = function(){ return 'This is the original function'; } this.someFun = function(){ // ... } } Then the result is not the expected one, infact new otherObj().otherFun() returns 'This is the original function'. so, is this the only way to add the method to the prototype and override it? And most important why I can't "overwrite" the function in the prototype?
type: Question
possible better answer: http://stackoverflow.com/a/29955890
has answer: http://stackoverflow.com/a/29955890
tagged with: node.js
has comment: http://stackoverflow.com/comment/48011942
linked to: http://stackoverflow.com/q/6885404
accepted answer: http://stackoverflow.com/a/29955623
answer count: 2
has title: why I can't "overwrite" a method in javascript?
upvote count: 1

http://stackoverflow.com/comment/48044693
has text: Why not just `$(function(){ video.play()); })` ?
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/29962095
type: Comment

http://stackoverflow.com/comment/48120079
has text: make it correct nChange='getSection it would be onchange='getSection
score: 0
comment on: http://stackoverflow.com/q/30000616
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47877171
comment on: http://stackoverflow.com/a/29874212
score: 0
type: AnswerComment
type: Comment
has text: Thank you for your example Tom! Actually it works well, but it's kind constraining in my example to list allll items number in the html. Sometimes, I can have more than 20 items in my slider, that's why I thought about a solution based on a clone to prepare the next slide number.

http://stackoverflow.com/a/29975638
has comment: http://stackoverflow.com/comment/48167601
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/48169624
answers question: http://stackoverflow.com/q/29972119
has comment: http://stackoverflow.com/comment/48169973
type: Answer
has body: Updated Fiddle I changed the push pushItems function to increment a 'clicks' key I added to 'attributes', then I bound that to the view: $scope.pushItems = function pushItems(attribute, items) { items.clicks++ //do stuff.. } If you can't modify your model to add the 'clicks' key server side, adding this if statement will either add to the clicks key, or set it if it doesn't exist: $scope.pushItems = function pushItems(attribute, items) { if (items.clicks) { items.clicks++ } else { items.clicks = 1 } // do stuff }
accepted answer of: http://stackoverflow.com/q/29972119
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/48166114
has comment: http://stackoverflow.com/comment/48172865
has comment: http://stackoverflow.com/comment/48167083
has comment: http://stackoverflow.com/comment/48167013
has comment: http://stackoverflow.com/comment/48170084
has comment: http://stackoverflow.com/comment/48167637

http://stackoverflow.com/q/29951442
type: Question
has comment: http://stackoverflow.com/comment/48025548
has comment: http://stackoverflow.com/comment/48024519
has body: I have a simple code segment that was meant to work along with AngularJS, but it simply does not. &lt;form ...&gt; ... &lt;div class="fieldcontain option-handler" style="display: none;" ng-controller="DynamicTable as table"&gt; &lt;label for="opcoes"&gt; Opcoes &lt;/label&gt; &lt;ul class="one-to-many"&gt; &lt;pre&gt;{{table.rows}}&lt;/pre&gt; &lt;table&gt; &lt;thead&gt; &lt;th&gt;Enunciado&lt;/th&gt; &lt;th&gt;Score&lt;/th&gt; &lt;th&gt;&amp;nbsp;&lt;/th&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;tr ng-repeat="row in table.rows"&gt; &lt;td&gt;&lt;input type="text" name="questoes[${i}].opcoes[{{row}}].enunciado" /&gt;&lt;/td&gt; &lt;td&gt;&lt;input type="number" name="questoes[${i}].opcoes[{{row}}].score" /&gt;&lt;/td&gt; &lt;td&gt;&lt;input type="button" value="Delete" ng-click="table.delRow()" /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;input type="button" value="Add" ng-click="table.addRow()" /&gt; &lt;/ul&gt; &lt;/div&gt; ... &lt;/form&gt; The {{table.rows}} excerpt works fine, just as well as the ng-repeat="row in table.rows" directive. Both ng-click directives don't work, though. Even when I tried changing it to ng-click="alert('Hello, World!');" it did not work. Here's the script code that should be ran: var app = angular.module("DynamicForm", []); app.controller("DynamicTable", function(){ this.rows = [0]; this.addRow = function() { this.rows.push(this.rows.length); alert("Added row" + (this.rows.length - 1).toString()); }; this.delRow = function() { this.rows.splice(-1, 1); }; }); It generates a row for the table, with the right value for {{row}} and {{table.rows}} displays correctly within &lt;pre&gt;. This is ran within a Grails 2.4.4 .gsp file, with AngularJS 1.3.15.
tagged with: javascript
tagged with: grails
score: 0
has comment: http://stackoverflow.com/comment/48024387
has comment: http://stackoverflow.com/comment/48024506
tagged with: angularjs
type: UnansweredQuestion
tagged with: angularjs-ng-click
has title: AngularJS Ng-Click directive not triggering
answer count: 0
linked to: http://stackoverflow.com/q/11605917
has comment: http://stackoverflow.com/comment/48024399
has comment: http://stackoverflow.com/comment/48024757
has comment: http://stackoverflow.com/comment/48024208

http://stackoverflow.com/a/29956301
upvote count: 1
answers question: http://stackoverflow.com/q/29955732
has body: your code works in my modal I assume there is something wrong with styles, not with JS check styles
downvote count: 0
has comment: http://stackoverflow.com/comment/48033635
type: Answer
score: 1

http://stackoverflow.com/q/29971736
has title: Trigger url after success of order placed in magento
downvote count: 0
type: UnansweredQuestion
tagged with: php
score: 1
tagged with: magento-1.9
has comment: http://stackoverflow.com/comment/48063633
type: Question
upvote count: 1
answer count: 1
tagged with: javascript
tagged with: jquery
tagged with: magento-1.8
has answer: http://stackoverflow.com/a/40908779
has body: I am using magento 1.8.1 and I am working on sms integration. I am trying to trigger a api url after clicking on placed order button. But as I new on magento I don't know where I put that url. After finding, I get these code of button &lt;div class="clear"&gt;&lt;/div&gt; &lt;button style="float:left" onclick="oscPlaceOrder(this);" id="onestepcheckout-button-place-order" type="button" title="&lt;?php echo $this-&gt;__('Place Order') ?&gt;" class="btn-proceed-checkout onestepcheckout-btn-checkout onestepcheckout-place"&gt; &lt;span&gt; &lt;span&gt;&lt;?php echo $this-&gt;__('Place order now') ?&gt;&lt;/span&gt; &lt;/span&gt; &lt;/button&gt; &lt;/div&gt; now here is one function oscPlaceOrder: function oscPlaceOrder(element) { var validator = new Validation('one-step-checkout-form'); var form = $('one-step-checkout-form'); if (validator.validate()) { if (($('p_method_hosted_pro') &amp;&amp; $('p_method_hosted_pro').checked) || ($('p_method_payflow_advanced') &amp;&amp; $('p_method_payflow_advanced').checked)) { $('onestepcheckout-place-order-loading').show(); $('onestepcheckout-button-place-order').removeClassName('onestepcheckout-btn-checkout'); $('onestepcheckout-button-place-order').addClassName('place-order-loader'); $('ajaxcart-load-ajax').show(); checkAjax('&lt;?php echo $this-&gt;getUrl('onestepcheckout/index/saveOrderPro', array('_secure' =&gt; true)); ?&gt;'); } else { if (checkpayment()) { element.disabled = true; var already_placing_order = true; disable_payment(); $('onestepcheckout-place-order-loading').show(); $('onestepcheckout-button-place-order').removeClassName('onestepcheckout-btn-checkout'); $('onestepcheckout-button-place-order').addClassName('place-order-loader'); //$('one-step-checkout-form').submit(); var options = document.getElementsByName('payment[method]'); for (var i = 0; i &lt; options.length; i++) { if ($(options[i].id).checked) { if (options[i].id.indexOf("tco") != -1) { var params = Form.serialize('one-step-checkout-form'); var request…
favorite count: 0

http://stackoverflow.com/a/56486401
answers question: http://stackoverflow.com/q/29853255
score: 24
downvote count: 0
type: Answer
has body: So I'm a little late to the game here...4 years late, but this solution should work. So this issue is arising because another program has that file open and could change its contents at any time (theoretically) and so your Operating System won't let you try to make changes too. This is typical to all OS's. You wouldn't want multiple copies of the same file open with different programs, because then you wouldn't really know which copy is the file of truth, or how to merge the changes properly, etc. Essentially you need to stop the program that is currently using that file so that you can read/write to it. Anyways. If anyone looking for an answer here is using a Linux/Unix based OS, refer to this post. If you're running into this issue on a Mac, the post above may work for you also since OSX is Unix based. SOLUTION If you're on Windows 10 (might work for older versions), you can just go to the file location in the file explorer, and try to move it to another folder. Don't try to delete it because it might actually work, but moving it should bring up a popup saying "File In Use" looking like this: So the popup here says "the file is open in Java(TM) Platform SE Binary". That's your ticket. Now go into Task Manager (Ctrl + Shift + ESC in Windows), and find and select the program has the file open, and click 'End Task'. Now you should be free to use/alter/run the file that you couldn't before. Also, in the end restarting your computer will do the same thing generally. But this is faster IMO. Hope this helps some people. Cheers.
upvote count: 24

http://stackoverflow.com/comment/47877119
type: QuestionComment
comment on: http://stackoverflow.com/q/29876081
score: 0
has text: Hi. The full Js can be found here: http://christianbullock.org/jstest/jquery.scrolly.js . Thanks :)
type: Comment

http://stackoverflow.com/a/29872061
answers question: http://stackoverflow.com/q/29871971
score: 0
type: Answer
has body: As-written, no that's not possible. If, instead you were to use a queue, delays in that manner are trivial. jQuery's .queue() and .delay() functions are a good example of how this works, so I will use them as an example, however the general point stands for any queueing library. Instead of: //code delay(time) //more code With a queue, you'd write: $('...') //some selector to act on for jQuery .queue(function (next) { //code //Indicate that the queued call is finished. next(); //This allows async code to be executed in the queue, //such as ajax and animations }) .delay(time) .queue(function (next) { //more code next(); }); Now, even if you ignore the lines used for comments, you can tell that there's a bit more boilerplate to achieve the desired behavior. I don't feel that it's excessive, because I find it relatively easy to read: queue something to happen wait for some number of milliseconds queue something else to happen

http://stackoverflow.com/q/29913327
score: 0
has comment: http://stackoverflow.com/comment/47949358
has body: I'm noob to k-means, but I need to predict some data using k-means in javaScript. I found some example codes here and here and here. As you can see, I have no problem with code, but with how to use it. My problem: I have this database, and I want to predict the boolean value. It works like this: I have many users, for each one I have some data stored from a game (tableA). Each game can be played by more than one user. When I get some data from new game (all corresponding to tableA, and I have the option of knowing some data from relation table), I want to predict value of boolean value (win) for that user. Please, I want to understand how the k-means works (an example will be great) so I can know what data do I need to send to k-means algorithm so I get the % of getting 1 in win Thanks
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47957022
answer count: 0
has comment: http://stackoverflow.com/comment/47953404
type: Question
has comment: http://stackoverflow.com/comment/56229511
tagged with: algorithm
tagged with: k-means
tagged with: cluster-analysis
tagged with: javascript
has title: Understanding how to use k-means in JavaScript

http://stackoverflow.com/comment/47876657
score: 0
type: AnswerComment
type: Comment
has text: Thanks for the answer. I am actually trying to have the effect to change the background when you select a link from the list, and then keeping it until you switch to another link. In order to show to the user the state of where he is browsing in that moment.
comment on: http://stackoverflow.com/a/29876103

http://stackoverflow.com/comment/48065946
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29972417
has text: @Bergi swapping the `new` for `Object.create(Object.getPrototypeOf(obj))` doesn't seem to work in my browser: it always returns an object.
score: 0

http://stackoverflow.com/q/29977053
has body: I have a client-side Javascript function similar to this: function LoadParent() { var objParent = window.opener; if (objParent) { objParent.location.reload(); } self.close(); } Now, here's my scenario: this code is in a page that I'll call CHILD.aspx. This page is opened in a new window from what I'll call PARENT.aspx. Here's my problem: this needs to run even if PARENT.aspx is closed (in other words, CHILD.aspx is orphaned). In this scenario, it skips over the IF statement (because it doesn't find PARENT.aspx) and just closes the window. It works in all browsers . . . EXCEPT INTERNET EXPLODER. I am testing in IE10. I added an alert(objParent); line after the var objParent declaration to see what was going on. I found that when this scenario came up in Firefox, it returned NULL (as expected). But when I ran it in IE, it returned an object (NOT expected). So it blows right through the IF stop sign and tries to reload the parent -- which, of course, blows up because the parent is no longer there. Anyone have any ideas? This is a problem that has me VERY frustrated. Note: opening CHILD.aspx as modal is NOT an option. PARENT.aspx needs to be accessible even after CHILD.aspx is opened.
accepted answer: http://stackoverflow.com/a/29995156
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/48100260
type: Question
tagged with: internet-explorer
tagged with: window.opener
tagged with: javascript
score: 0
has title: Check for parent window using window.opener not working in IE
has answer: http://stackoverflow.com/a/29995156
answer count: 1

http://stackoverflow.com/comment/73669920
comment on: http://stackoverflow.com/a/39242515
type: Comment
has text: what if I want to fill the rows inside each column?
score: 0
type: AnswerComment

http://stackoverflow.com/comment/47947435
type: Comment
score: 0
has text: You're right, but it's nice to be aware that the option is there, perhaps I should have added it as a comment
type: AnswerComment
comment on: http://stackoverflow.com/a/29906319

http://stackoverflow.com/q/29920428
upvote count: 1
has answer: http://stackoverflow.com/a/29920729
type: Question
score: 1
has comment: http://stackoverflow.com/comment/47962392
tagged with: hyperlink
answer count: 6
has answer: http://stackoverflow.com/a/29921789
accepted answer: http://stackoverflow.com/a/29921789
has answer: http://stackoverflow.com/a/29920508
has answer: http://stackoverflow.com/a/29920482
has comment: http://stackoverflow.com/comment/47962821
possible better answer: http://stackoverflow.com/a/29920462
has comment: http://stackoverflow.com/comment/47962964
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/47962941
has comment: http://stackoverflow.com/comment/47962513
has comment: http://stackoverflow.com/comment/47962438
has title: How to insert hyperlink into text using jQuery?
has comment: http://stackoverflow.com/comment/47963085
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29920462
has answer: http://stackoverflow.com/a/29920755
has body: I'd like to make an Insert Link button. Here is what I came up with: $(document).ready(function(){ function HyperLink(elementID, openTag, closeTag) { var textArea = $('#' + elementID); var len = textArea.val().length; var start = textArea[0].selectionStart; var end = textArea[0].selectionEnd; var selectedText = textArea.val().substring(start, end); var replacement = openTag + selectedText + closeTag; textArea.val(textArea.val().substring(0, start) + replacement + textArea.val().substring(end, len)); } $('#btnHyperlink').click(function() { HyperLink("id_description", "&lt;a&gt;", "&lt;/a&gt;"); }); }); The snippent above embraces text with &lt;a&gt;...&lt;/a&gt;, however I don't know how to insert href to the text. Appreciate your help. Note: I want links to be dynamically added to the text, as this button is going to be used in a simple text editor.

http://stackoverflow.com/comment/47856053
score: 1
has text: I created a scene with the same revision of three.js and OBJLoader and had the same issue, I used your code. I think your using is out-dated for the OBJloader... Try ObjectMTL as this worked for me with no problems also i think you may need matarial added to your objloader could be a cause
comment on: http://stackoverflow.com/q/29859926
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/48002455
type: Comment
type: QuestionComment
has text: Quota is not the only limit for `sync` storage - you're just as likely to run into throttling. That said, I'm unsure what your question is.
comment on: http://stackoverflow.com/q/29934813
score: 0

http://stackoverflow.com/q/29885220
has answer: http://stackoverflow.com/a/39688735
tagged with: iterable
has answer: http://stackoverflow.com/a/42531527
has answer: http://stackoverflow.com/a/53692074
has answer: http://stackoverflow.com/a/31644949
downvote count: 1
has answer: http://stackoverflow.com/a/49457328
favorite count: 0
has answer: http://stackoverflow.com/a/74233219
has answer: http://stackoverflow.com/a/29933940
possible better answer: http://stackoverflow.com/a/29885239
has answer: http://stackoverflow.com/a/41378660
has answer: http://stackoverflow.com/a/38906599
has answer: http://stackoverflow.com/a/36615836
has answer: http://stackoverflow.com/a/43832438
linked to: http://stackoverflow.com/q/35819763
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29885239
has answer: http://stackoverflow.com/a/29885366
upvote count: 100
has comment: http://stackoverflow.com/comment/47894519
type: Question
tagged with: ecmascript-6
has answer: http://stackoverflow.com/a/51461595
linked to: http://stackoverflow.com/q/42830257
tagged with: for-loop
linked to: http://stackoverflow.com/q/11313982
has answer: http://stackoverflow.com/a/74689616
has body: Why isn't is possible to use objects in for of loops? Or is this a browser bug? This code doesn't work in Chrome 42, saying undefined is not a function: test = { first: "one"} for(var item of test) { console.log(item) }
has comment: http://stackoverflow.com/comment/65372680
has comment: http://stackoverflow.com/comment/71632141
score: 99
has title: Using Objects in For Of Loops
has answer: http://stackoverflow.com/a/32671263
accepted answer: http://stackoverflow.com/a/32671263
tagged with: javascript
answer count: 16

http://stackoverflow.com/comment/47975906
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/29926718
type: Comment
has text: Updated with PHP code.

http://stackoverflow.com/q/29865731
has body: I have a page that I use to have users press a submit button to insert MYSQL data but also capture an image and upload a .png file to a directory all from the click of one submit button. 9/10 this works perfectly. I'm not sure if it's a connectivity issue (it's being done on a wireless device) or if it's my code. That 1/10 times it will INSERT the MYSQL data but it will not upload the image to the server. Below is my upload code from my file and the upload_data.php file that the code calls. Sorry my formatting on this site isn't the greatest. &lt;script&gt; function uploadEx() { var canvas = document.getElementById("canvasSignature"); var dataURL = canvas.toDataURL("image/png"); document.getElementById('hidden_data').value = dataURL; var fd = new FormData(document.forms["form"]); var xhr = new XMLHttpRequest(); xhr.open('POST', '/inc/img/inspection/upload_data.php', true); xhr.upload.onprogress = function(e) { if (e.lengthComputable) { var percentComplete = (e.loaded / e.total) * 100; console.log(percentComplete + '% uploaded'); //alert('Succesfully uploaded'); } }; xhr.onload = function() { }; xhr.send(fd); }; &lt;/script&gt; BELOW IS UPLOAD_DATA.PHP &lt;?php $upload_dir = "upload/"; $img = $_POST['hidden_data']; $img = str_replace('data:image/png;base64,', '', $img); $img = str_replace(' ', '+', $img); $data = base64_decode($img); $id = $_POST['sub_id']; $file = $upload_dir . $id . ".png"; $success = file_put_contents($file, $data); print $success ? $file : 'Unable to save the file.'; ?&gt;
upvote count: 2
tagged with: php
answer count: 1
tagged with: safari
tagged with: mysql
type: UnansweredQuestion
has title: File doesn't always upload to server using PHP & Javascript
has answer: http://stackoverflow.com/a/29866012
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/47856409
tagged with: javascript
tagged with: ipad
has comment: http://stackoverflow.com/comment/47856697
favorite count: 0
type: Question

http://stackoverflow.com/q/29899727
type: UnansweredQuestion
score: 0
type: Question
has comment: http://stackoverflow.com/comment/47922293
tagged with: javascript
has title: AngularJS: Multiple directives [ngView, ngView] asking for transclusion on:
has comment: http://stackoverflow.com/comment/47922411
tagged with: angularjs
answer count: 0
has body: The version we use for AngularJS is 1.2.28. We also use RequireJS and a library called ocLazyLoad (0.4.0) for lazy loading of Angular stuff. The problem is very rare and there is no way to reproduce it in consistent manner. Basically, the user just opens the application, we show some loading screens and when everything is ready (files are loaded and $viewContentLoaded is fired), we show the application itself. The ugly part is that everything works just fine, but in some rare cases it just crashes saying: Multiple directives [ngView, ngView] asking for transclusion on: &lt;!-- ngView: --&gt; If the user reloads the page everything is OK. We have only one ng-view added to a div. Currently, I've tried different configs on ocLazyLoad like adding loadedModules: ['module'] Also placing the ng-view in different DOM element. None of them are working. So any ideas where the problem might be?

http://stackoverflow.com/comment/48103720
has text: This answer may be of interest: http://stackoverflow.com/a/19599501/1862339
comment on: http://stackoverflow.com/q/29991941
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/48016582
type: Comment
comment on: http://stackoverflow.com/a/29947818
type: AnswerComment
has text: Unfortunately that would not match ".1" at the beginning of the string.
score: 0

source-maps
type: Tag
tag name: source-maps
tags question: http://stackoverflow.com/q/29863070

http://stackoverflow.com/q/29914287
score: 0
answer count: 1
tagged with: django
has comment: http://stackoverflow.com/comment/47950457
linked to: http://stackoverflow.com/q/3173256
type: AnsweredQuestion
type: Question
has answer: http://stackoverflow.com/a/29914491
accepted answer: http://stackoverflow.com/a/29914491
has title: Django - Javascript does no access DOM?
tagged with: javascript
tagged with: jquery
has body: I am trying to implement this code to my Django application. I manage to get the code on the page using code blocks in my index.html. It seems like the styles from the css is displaying correctly. I also manage to play songs, but the pause button, different cover images and song titles does not change when they are clicked/changed. For me it seems like the JavaScript is not able to change the style of html elements in the DOM. I know that JS files is not processed by Django's template engine. So I am using this code, so I can reference this global variable from within the js-file. &lt;script&gt; var MEDIA_URL = "{{MEDIA_URL}}"; &lt;/script&gt; &lt;script type="text/javascript" src="{{MEDIA_URL}}/js/myscript.js" &gt;&lt;/script&gt; inside the JS file there is two places where the variable is referred, $('.player .cover').css('background-image','url(MEDIA_URL + audio/' + cover+')');; song = new Audio(MEDIA_URL+'audio/' + url); This reference do actually take place, but for the rest of the JS-file.. none of the addClass, removeClass etc. do affect the DOM. When trying this code outside the Django framework, everything works as expected.I am pretty sure that there is something I am ignoring, that is causing this problem.. but I cannot seem to figure out what it is! Please help!

http://stackoverflow.com/a/29863544
accepted answer of: http://stackoverflow.com/q/29859317
has comment: http://stackoverflow.com/comment/104504200
type: AcceptedAnswer
downvote count: 0
has body: The property that controls how the children are aligned along the main axis is justify-content .align-end { justify-content: flex-end; } plunker
type: Answer
upvote count: 3
answers question: http://stackoverflow.com/q/29859317
score: 3

http://stackoverflow.com/a/29884990
type: Answer
score: 1
has comment: http://stackoverflow.com/comment/47894036
has body: I'd skip the Javascript and use a label element and the :checked selector. #example { visibility: hidden; width: 0; } label { color: purple; } #example:checked + label { background-color: red; color: white; } The HTML would be like this: Example With this approach you wouldn't need to worry about tracking the checked variable and you can just figure it out normally. Here's a demo: http://jsbin.com/cirali/1/edit?html,css,output
upvote count: 1
answers question: http://stackoverflow.com/q/29884873
downvote count: 0
has comment: http://stackoverflow.com/comment/47895658

http://stackoverflow.com/comment/50411128
has text: James, I believe _codelife_ didn't want to delay the animation, he just wanted it to stop immediately after `l.stop()`...
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29939343
type: Comment

http://stackoverflow.com/comment/47920661
comment on: http://stackoverflow.com/a/29898869
has text: i think i understand your answer, but how do i implement it?
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/47972702
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29925133
has text: Try adding `console.log(string);` into the xyEvent handler right after `string = "hello" + myClosure();`

http://stackoverflow.com/q/29885532
has answer: http://stackoverflow.com/a/29905445
answer count: 2
has comment: http://stackoverflow.com/comment/47915999
tagged with: jquery
favorite count: 0
type: UnansweredQuestion
tagged with: wicket
has comment: http://stackoverflow.com/comment/47932714
tagged with: java
downvote count: 3
upvote count: 1
type: Question
score: -2
has title: AjaxRequestTarget doesn't exist in Button.onSubmit()
has comment: http://stackoverflow.com/comment/47929818
has body: AjaxRequestTarget given from RequestCycle is obviously null when I try to get in method Button.onSubmit(). I want to open a popup window using Ajax, but it throws ever NullPointerException. Is there a way to show a popup using AjaxRequestTarget in the onsubmit() function in Wicket? protected void onSubmit() { if (trainingmode()){ AjaxRequestTarget target = RequestCycle.get().find(AjaxRequestTarget.class); MessageDialog dialog = new MessageDialog("dialog", "Notice", "Decision Matches " , DialogButtons.OK_CANCEL, DialogIcon.WARN) { public void onClose( AjaxRequestTarget target, DialogButton button) { } }; System.out.println("2Chainz"); dialog.open(target); } } I get an error at dialog.open(target) that says : Caused by: java.lang.NullPointerException at com.googlecode.wicket.jquery.ui.widget.dialog.MessageDialog.onOpen(MessageDialog.java:170) at com.googlecode.wicket.jquery.ui.widget.dialog.AbstractDialog.open(A I am trying to have an AjaxRequestTarget modal window pop up appear however i do not have access to AjaxRequestTarget from within the onsubmit()
tagged with: javascript
has answer: http://stackoverflow.com/a/29916724

eclipse
tag name: eclipse
tags question: http://stackoverflow.com/q/29882460
tags question: http://stackoverflow.com/q/29940562
tags question: http://stackoverflow.com/q/29995316
tags question: http://stackoverflow.com/q/29891360
tags question: http://stackoverflow.com/q/29938578
type: Tag

http://stackoverflow.com/q/29903524
answer count: 2
has comment: http://stackoverflow.com/comment/48011142
has answer: http://stackoverflow.com/a/29946371
has body: I have an Array of objects: [{ "12": {"data": [{"thisID": "44"},{"thisID": "55"}], "settings": {"other":"other"}} },{ "15": {"data": [{"thisID": "66"},{"thisID": "77"}], "settings": {"other":"other"}} }] using underscore.js I would like to access Object which thisID key is 77. I did it this way but I believe there is a better way? var found = _.map(array, function (d) { return _.findWhere(d.data, {thisID: "77"}); }) .filter(function(n){ return n != undefined }) console.log(found) //[{thisID:x, a:a, ....}]
type: UnansweredQuestion
has title: search array of objects by value and return matched object
has answer: http://stackoverflow.com/a/29954510
tagged with: underscore.js
score: 0
has comment: http://stackoverflow.com/comment/47929827
has comment: http://stackoverflow.com/comment/48029813
type: Question
has comment: http://stackoverflow.com/comment/47930194
tagged with: object
has comment: http://stackoverflow.com/comment/48029765
tagged with: arrays
tagged with: javascript

prototypal-inheritance
tags question: http://stackoverflow.com/q/29885351
tags question: http://stackoverflow.com/q/29846754
tags question: http://stackoverflow.com/q/29881934
tag name: prototypal-inheritance
type: Tag
tags question: http://stackoverflow.com/q/29873269

http://stackoverflow.com/q/29885020
tagged with: race-condition
has comment: http://stackoverflow.com/comment/47894100
tagged with: arrays
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29904400
has title: shuffling cards with Javascript and inconsistent array values?
has comment: http://stackoverflow.com/comment/47894090
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/47894169
has comment: http://stackoverflow.com/comment/47894272
has comment: http://stackoverflow.com/comment/47894625
has comment: http://stackoverflow.com/comment/47894445
has comment: http://stackoverflow.com/comment/47894221
has comment: http://stackoverflow.com/comment/47894350
has answer: http://stackoverflow.com/a/29904400
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47894418
has body: I'm building a little module in javascript to act like a pack of cards. My first method works but was quite simple, and so i wanted to create some shuffle methods that mimic the idea behind real world card shuffling. Amongst some other useful functions I've create riffle, overhand and cut functions, that all seem to do there job, but when calling them repeatedly in sequence the returned pack amount is inconsistent, from running it over and over again it appears to be some sort of race condition, but can't seem to get my head around how to avoid it. The relevant private methods are : riffle : function riffle() { var top = Pack.slice(0, 26); var bottom = Pack.slice(26, 52); Pack = []; console.log('top is '+top.length+" and bottom is "+bottom.length); var hand = 'right'; var result = []; var i = 52; while (i &gt; 0) { var drop = Math.floor(Math.random()*3)+1; var cards; if (hand === 'right' ) { if (drop &gt;= top.length) { cards = top; } else { cards = top.splice(0, drop); } hand = 'left'; } else { if (drop &gt;= bottom.length) { cards = bottom; } else { cards = bottom.splice(0, drop); } hand = 'right'; } result = result.concat(cards); i -= drop; } Pack = result; console.log(Pack.length+" after riffle"); return this; }, cut : function cut(fn) { var top = Pack.slice(0, 26); var bottom = Pack.slice(26, 52); Pack = []; console.log(top); Pack = bottom.concat(top); console.log(Pack.length+" after cut"); if (fn &amp;&amp; typeof(fn) === 'function') { fn(); } return this; } Later on I have a privileged method called shuffle that calls them : shuffle : function shuffle(cb) { State.cardsOut = []; Internal.generatePack().cut().riffle().riffle() .riffle().riffle().riffle(); if (cb &amp;&amp; typeof(cb) === 'function') { cb(); } } Note : I start with a generate function that creates an arrray of objects representing a full pack of 52 cards. The results I get when I console log the pack at different times after shuffles and cuts vary and I can't seem to figure out why. you can see …
possible better answer: http://stackoverflow.com/a/30064719
type: Question
has comment: http://stackoverflow.com/comment/47894209
has answer: http://stackoverflow.com/a/30064719

http://stackoverflow.com/comment/47961014
comment on: http://stackoverflow.com/q/29918054
score: 0
type: Comment
type: QuestionComment
has text: You can add height and width to the class `.highcharts-yaxis-title` and set `overflow:hidden` and add title attribute to display tooltip over it

communication
tag name: communication
type: Tag
tags question: http://stackoverflow.com/q/29916245

http://stackoverflow.com/a/35419753
downvote count: 0
type: Answer
has body: I had a similar problem, using the AzureSDK in Xamarin and what solved my issue was in the redirect url, in the Microsoft Developer Account pages, I had specified "http". I changed it to "https" and it worked great. https://azure.microsoft.com/en-us/documentation/articles/app-service-mobile-how-to-configure-microsoft-authentication/ https://account.live.com/developers/applications/index
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/29973283

http://stackoverflow.com/comment/47869760
type: Comment
type: QuestionComment
has text: also if you base64 at server would change content type
comment on: http://stackoverflow.com/q/29872254
score: 0

http://stackoverflow.com/q/29888900
has title: sum key values of two arrays by using other key
downvote count: 5
has comment: http://stackoverflow.com/comment/47902155
tagged with: php
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/16138395
upvote count: 0
score: -5
has comment: http://stackoverflow.com/comment/47901469
has comment: http://stackoverflow.com/comment/47901749
has comment: http://stackoverflow.com/comment/47902108
has answer: http://stackoverflow.com/a/29889531
accepted answer: http://stackoverflow.com/a/29889531
type: Question
has body: Array ( [0] =&gt; Array ( [amount] =&gt; 8000 [date] =&gt; 2015-04-01 ) [1] =&gt; Array ( [amount] =&gt; 5000 [date] =&gt; 2015-04-02 ) [2] =&gt; Array ( [amount] =&gt; 5000 [date] =&gt; 2015-04-10 ) [3] =&gt; Array ( [amount] =&gt; 25000 [date] =&gt; 2015-04-20 ) ) Array ( [0] =&gt; Array ( [date] =&gt; 2015-04-01 [amount] =&gt; 1000 ) [1] =&gt; Array ( [date] =&gt; 2015-04-02 [amount] =&gt; 5000 ) [2] =&gt; Array ( [date] =&gt; 2015-04-03 [amount] =&gt; 2000 ) [3] =&gt; Array ( [date] =&gt; 2015-04-10 [amount] =&gt; 2000 ) ) I have two arrays with keys and values. sum the 'amount' key if 'date' key values is same Expected output: Array ( [0] =&gt; Array ( [date] =&gt; 2015-04-01 [amount] =&gt; 9000 ) [1] =&gt; Array ( [date] =&gt; 2015-04-02 [amount] =&gt; 10000 ) [2] =&gt; Array ( [date] =&gt; 2015-04-03 [amount] =&gt; 2000 ) [3] =&gt; Array ( [date] =&gt; 2015-04-10 [amount] =&gt; 7000 ) [4] =&gt; Array ( [date] =&gt; 2015-04-20 [amount] =&gt; 25000 ) )
tagged with: arrays
tagged with: javascript
has comment: http://stackoverflow.com/comment/47901405
has comment: http://stackoverflow.com/comment/47901403
has comment: http://stackoverflow.com/comment/47901391
answer count: 1
favorite count: 0

http://stackoverflow.com/comment/48023012
type: QuestionComment
comment on: http://stackoverflow.com/q/29950783
has text: main difference is it's easier to maintain styles in a stylesheet and also easier to test for existence of a class than check specific css properties
score: 0
type: Comment

http://stackoverflow.com/comment/47961106
type: Comment
type: QuestionComment
has text: The checkboxes are 'invisible'. They are basically stripped down to a rectangle covering the vertical panels, 4 in a horizontal row. @itzmukeshy7 I would like the checkboxes to automatically switch around without any actions from the visitor.
comment on: http://stackoverflow.com/q/29897729
score: 0

http://stackoverflow.com/q/29850027
tagged with: javascript
has answer: http://stackoverflow.com/a/29850755
score: 0
has title: What's the smart way to handle hundreds of images on a web page?
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/29850755
has comment: http://stackoverflow.com/comment/47826156
has comment: http://stackoverflow.com/comment/47826224
tagged with: css
type: AnsweredQuestion
has body: I have a simple webpage with hundreds of images. Like this... &lt;img src="img/photo00001.jpg"&gt; &lt;img src="img/photo00002.jpg"&gt; &lt;img src="img/photo00003.jpg"&gt; ... and so on I don't want to spend hours copy pasting and editing the numbers to later realize I forgot the anchor tag on them. I know Wordpress would do it but this is supposed to be a simple project and all layout and design is already done, theming it would be a complete overkill. What's the smart approach to this? custom auto built CMS? I've heard about it but don't know much Sublime plugin that generates the HTML? don't think it writes the img path Some other idea? Mind you I'm a front end guy.
type: Question
possible better answer: http://stackoverflow.com/a/29850446
answer count: 2
has answer: http://stackoverflow.com/a/29850446
tagged with: content-management-system

http://stackoverflow.com/a/29949045
score: 1
has comment: http://stackoverflow.com/comment/48188288
has comment: http://stackoverflow.com/comment/48021098
has comment: http://stackoverflow.com/comment/48023339
has body: This would be the code inside your snap. Updated seeing your comment var imgRotation = Math.round(endValue / rotationSnap) * rotationSnap; if (imgRotation == 90) { sym.$("id1").show(); } else if (imgRotation == 180) { sym.$("id2").show(); } else if (imgRotation == 270 ) { sym.$("id3").show(); } else if ((imgRotation &gt;= 360) || (imgRotation == 0)){ sym.$("id4").show(); } return imgRotation;
has comment: http://stackoverflow.com/comment/48022704
type: Answer
has comment: http://stackoverflow.com/comment/48021298
has comment: http://stackoverflow.com/comment/48180208
has comment: http://stackoverflow.com/comment/48024545
upvote count: 1
has comment: http://stackoverflow.com/comment/48182964
has comment: http://stackoverflow.com/comment/48021988
answers question: http://stackoverflow.com/q/29927709
has comment: http://stackoverflow.com/comment/48022597
has comment: http://stackoverflow.com/comment/48190057
has comment: http://stackoverflow.com/comment/48022496
downvote count: 0

http://stackoverflow.com/comment/47922270
has text: [And me](http://jsfiddle.net/n00rbqL1/2/)
score: 0
comment on: http://stackoverflow.com/q/29899757
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29955374
has comment: http://stackoverflow.com/comment/48031549
downvote count: 0
score: 6
accepted answer of: http://stackoverflow.com/q/29955315
answers question: http://stackoverflow.com/q/29955315
type: AcceptedAnswer
upvote count: 6
has body: Reduce expects you to return the partical result back in order to iterate over following items. Therefore the following code would work: var newdata=[ { foo: 'media' }, { article: 'article' } ].reduce(function(p, c, i, array) { // Add item to the array p[Object.keys(c)[0]]=c[Object.keys(c)[0]]; // And return back the object to reduce into return p; }, {}); which outputs: &gt; newdata Object {foo: "media", article: "article"}
has comment: http://stackoverflow.com/comment/48031543
has comment: http://stackoverflow.com/comment/48031559
type: Answer

http://stackoverflow.com/comment/47880503
comment on: http://stackoverflow.com/q/29872725
score: 0
type: Comment
type: QuestionComment
has text: @BenjaminGruenbaum, quite contrary, my library is not going to decide for you what you want to do with exceptions, my library will give you an option to propagate a rejection or fail with a crash immediately, it's always nicer to have a choice rather than not have one

http://stackoverflow.com/a/30622065
type: Answer
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/29881052
has body: With AngularJS First, you need to creat a project in console.google.developers. Enable the API YouTube API V3 (set to on). In credential part, creat a public access key. In the controller VideoCtrl for example: 'use strict'; function init() { window.initGapi(); // Calls the init function defined on the window } angular.module('team') .service('googleService', ['$http', '$q', function ($http, $q) { var deferred = $q.defer(); this.googleApiClientReady = function () { gapi.client.setApiKey('YOUR API KEY'); gapi.client.load('youtube', 'v3', function() { var request = gapi.client.youtube.playlistItems.list({ part: 'snippet', playlistId: 'PLila01eYiSBjOtR8oqXkY0i5c1QS6k2Mu', maxResults: 8 }); request.execute(function(response) { deferred.resolve(response.result); }); }); return deferred.promise; }; }]) .controller('VideosCtrl', function ($scope, $window, $sce, googleService) { $window.initGapi = function() { $scope.$apply($scope.getChannel); }; $scope.getChannel = function () { googleService.googleApiClientReady().then(function (data) { $scope.channel = data; }, function (error) { console.log('Failed: ' + error) }); }; }); And don't forget to init the API. Add this line at the end of your index.html &lt;script src="https://apis.google.com/js/client.js?onload=init"&gt;&lt;/script&gt; For beginners you may be interested by this answer: https://stackoverflow.com/a/25783421/2274530
downvote count: 0

http://stackoverflow.com/q/29859926
has comment: http://stackoverflow.com/comment/47851323
downvote count: 0
answer count: 1
score: 1
has comment: http://stackoverflow.com/comment/47856053
has body: I need help loading a object file from my local browser in Threejs ( Rev 71). The error I get is loadModel.html:1 Uncaught SyntaxError: Unexpected token #. I tried loading the object file by chrome --allow-file-access-from-files, but still I get a blank page with the same error. I Would like to know what I did wrong within this simple script Load Model
favorite count: 0
tagged with: three.js
upvote count: 1
accepted answer: http://stackoverflow.com/a/31128683
has comment: http://stackoverflow.com/comment/47863441
has comment: http://stackoverflow.com/comment/47848463
type: AnsweredQuestion
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/31128683
has title: Trying to Load object with ThreeJs

http://stackoverflow.com/a/32944255
upvote count: 1
answers question: http://stackoverflow.com/q/29913454
downvote count: 0
score: 1
type: Answer
has body: Guacamole uses SFTP to transfer files back and forward to the computer, so it doesn't transfer files over the VNC connection like TightVNC can. This means that you will have to setup an SFTP server on the computer running the VNC-server to be able to transfer files to the computer. If you have done that, you will have to provide the SFTP server details in your connection details page. Once everything is setup properly you can start uploading and downloading files. For uploading you need to set a "standard uploading directory" in your connection properties. To upload something to that directory simply drag a file and drop it in the view screen in your browser. A little dialog with the upload process will appear and the file will be transferred to the remote computer! For downloading open the guacamole menu while viewing your remote computer by pressing ctrl+alt+shift. If everything is setup properly you will see a device which you can browse and select the files you want to download. Good luck with this. P.S. If the VNC-server is running on a windows machine, look at freeFTPd. It's a free lightweight program that can be setup to start at windows startup. Perfect solution for using with guacamole. If you are running linux it shouldn't be too hard to find an sftp server.

http://stackoverflow.com/comment/47848851
comment on: http://stackoverflow.com/q/29860848
type: QuestionComment
type: Comment
has text: Note that Express already implements caching of views, though it's typically disabled for development -- [`"view cache"` option](http://expressjs.com/4x/api.html#app.set).
score: 1

http://stackoverflow.com/a/29938115
has comment: http://stackoverflow.com/comment/47998135
upvote count: 2
accepted answer of: http://stackoverflow.com/q/29937924
has body: In the below line: if ($(this).is(':checked')) { NewsPaperId= $('input[name="Check"]:checked').val(); You are taking the value of checked checkbox and you have already put the condition of checked in if condition. so my suggestion is to replace the NewsPaperId= $('input[name="Check"]:checked').val(); above line with following line: NewsPaperId= $(this).val(); And in the else part you need to check if there is any checked checkbox or not. here is code for it: else { $('input[name="Check"]').each(function(){ if($(this).is(':checked')){ NewsPaperId= $(this).val(); } }); if(NewsPaperId != ''){ //do your stuff} Here is the reason to make the if condition. The reason is if user click on checked checkbox and other checkbox is not checked then the value of NewsPaperId will be blank else if will take the value of other checkbox which will be checked.
answers question: http://stackoverflow.com/q/29937924
has comment: http://stackoverflow.com/comment/47998340
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/47997901
has comment: http://stackoverflow.com/comment/80859378
type: Answer
score: 2

http://stackoverflow.com/comment/48320150
type: Comment
has text: Is there a specific action you can take to trigger this error? Does it happen when you first load phpMyAdmin or after a period of use?
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29995352

tcp
type: Tag
tags question: http://stackoverflow.com/q/29903037
tags question: http://stackoverflow.com/q/29896134
tag name: tcp

http://stackoverflow.com/a/29862264
has body: <?php /* Try this code color.php */ ?> Document Footer: Header: Aside: submit <?php /* changecolor.php */ ?> <?php if(isset($_POST)){ $key=array_keys($_POST); $value=array_values($_POST); $fields="`".implode("`,`", $key)."`"; $values="'".implode("','", $value)."'"; $sql="INSERT INTO `table_name` ({$fields}) VALUES ({$values})"; echo $sql; } ?>
score: 3
type: Answer
answers question: http://stackoverflow.com/q/29860960
upvote count: 3
downvote count: 0

http://stackoverflow.com/comment/47972616
comment on: http://stackoverflow.com/a/29907066
score: 0
type: Comment
type: AnswerComment
has text: Thank's for for the trial. But nothing works. httpresponse is the variable that returns those nested object. I did something like this instead in the following line: var json = Object.keys(your_crazy_object).filter(function (key) { return key !== '_id'; })[0]; var obj = JSON.parse(json); console.log(obj.labyname); console.log(obj.data); Unfortunately, it displays "undefined"

http://stackoverflow.com/comment/48028337
comment on: http://stackoverflow.com/q/29953740
score: 0
type: QuestionComment
has text: How recent is the version of JSCS you're using? From their Github page it looks like those rules have been deprecated for a long time (a year).
type: Comment

http://stackoverflow.com/comment/48005699
has text: Thanks for the response. This is pretty much what I have already tried. My question is more about if the program policy allows me to use the alternative method outlined in my question.
comment on: http://stackoverflow.com/a/29937884
score: 0
type: AnswerComment
type: Comment

papaparse
type: Tag
tags question: http://stackoverflow.com/q/29859657
tag name: papaparse

http://stackoverflow.com/a/29890637
downvote count: 0
has comment: http://stackoverflow.com/comment/47911016
has comment: http://stackoverflow.com/comment/47918067
has comment: http://stackoverflow.com/comment/47913580
type: Answer
has comment: http://stackoverflow.com/comment/47917001
score: 1
has comment: http://stackoverflow.com/comment/47944027
has comment: http://stackoverflow.com/comment/47916500
upvote count: 1
answers question: http://stackoverflow.com/q/29889956
has comment: http://stackoverflow.com/comment/47914497
has comment: http://stackoverflow.com/comment/47918241
has body: Try to watch your parameter. Probably you trying to use before you will getting it. .directive('search', function($timeout) { return { restrict: 'AEC', scope: { items: '=', prompt:'@', title: '@', subtitle:'@', model: '=', onSelectupdate:'&amp;' }, link:function(scope,elem,attrs){ scope.handleSelection=function(selectedItem){ scope.model=selectedItem; console.warn(scope.items); scope.current=0; scope.selected=true; $timeout(function(){ scope.onSelectupdate(); },200); }; scope.$watch("items", function(newData) { console.log("Items: ", newData); }); scope.current=0; scope.selected=true; scope.isCurrent=function(index){ return scope.current==index; }; scope.setCurrent=function(index){ scope.current=index; }; }, templateUrl : TAPPLENT_CONFIG.HTML_ENDPOINT[0]+'home/genericsearch.html' } })
has comment: http://stackoverflow.com/comment/47946602

http://stackoverflow.com/comment/48378610
comment on: http://stackoverflow.com/q/29975138
score: 0
has text: And I dont know what you mean in your question
type: Comment
type: QuestionComment

http://stackoverflow.com/a/32769939
answers question: http://stackoverflow.com/q/29857285
downvote count: 0
type: Answer
score: 1
upvote count: 1
has body: Try: $('#embedurl').setSelectionRange(0, 9999); From this answer. It worked for me, although the comments on that answer do note some caveats, such as needing to trigger a focus() event first.

http://stackoverflow.com/comment/48013243
has text: something like this? http://stackoverflow.com/questions/199099/how-to-manage-a-redirect-request-after-a-jquery-ajax-call
comment on: http://stackoverflow.com/a/29946056
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/56126604
answers question: http://stackoverflow.com/q/29988335
has body: Best and easiest solution is to use Promist.all() with nodejs Example let _ = require('underscore') let response = ['some data','other data'] return Promise.all(_.map(response, function (data) { return functionName(data) })) .then((response)=&gt;{ console.log(response) }) Result ['response1','response2']
score: 0
type: Answer

http://stackoverflow.com/q/29923265
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/29923391
type: Question
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29923394
has body: I am doing a school web site project and I hit a rock with a thing that I want to do. I have a search page that uses Google Places API and searches for nearby places and displays them on the page. The name of every place (restaurant) is a paragraph tag within a link tag that leads to another page that I want to populate with information from the previews page. How can I save whatever the user has clicked in a variable, for example the Restaurant name and use this variable in another page to populate a placeholder "The Restaurant" there. This is the jQuery code of the search page that populates the search page with results: for(var i = 0;i<Object.keys(jsondata.results).length;i++){ if(jsondata.results[i].name !== undefined){ if(jsondata.results[i].photos !== undefined){ photoRef = jsondata.results[i].photos[0].photo_reference; //alert(photoRef); } //alert(searchedResultsPhotos); $(".col-md-7").append(" " +" "+jsondata.results[i].name+" </div"); } } $(".col-md-7 div").addClass("row"); Here are some screenshots of the site. Search page: Restaurant details:
score: 0
tagged with: save
answer count: 2
accepted answer: http://stackoverflow.com/a/29923394
has title: How to save a link html and transfer it to another page to use later?
has answer: http://stackoverflow.com/a/29923391
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/901115

http://stackoverflow.com/comment/47822099
has text: Yes, but you want to define your dependencies at as low a level as possible so that you have code that is (1) reusable, (2) testable, (3) refactorable. If that means you declare them several times for several different modules, so be it. RequireJS will ensure you don't load multiple copies of each dependency, so long as you use it properly.
type: Comment
score: 1
comment on: http://stackoverflow.com/q/29846401
type: QuestionComment

http://stackoverflow.com/comment/48004435
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29940354
has text: @Deb - why you downvote my long back accepted answers
score: 0

http://stackoverflow.com/comment/48114214
comment on: http://stackoverflow.com/a/29997282
type: AnswerComment
type: Comment
score: 1
has text: @safron6 that's not a solution because the ACAO header has to be added on the forecast.Io side, not yours. They're not going to do that. See my answer below, it might point you in the right direction. If you have further questions I'd be happy to help.

http://stackoverflow.com/comment/47842742
type: QuestionComment
type: Comment
has text: The response is not in the same order of starts, because ajax is async and success print to dom, when the script ends and the server set code of success. The only chance is chaining the ajax calls in the scripts. [Async: false is deprecated.]
score: 0
comment on: http://stackoverflow.com/q/29858388

http://stackoverflow.com/comment/47955507
score: 0
type: AnswerComment
has text: I put example of Php. Whichever server you have in that you can. I used cors lib for flask server
type: Comment
comment on: http://stackoverflow.com/a/29916927

http://stackoverflow.com/comment/47824287
score: 0
has text: MomentJs is gourgeous and recommended.
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29849002

http://stackoverflow.com/comment/47969092
has text: @KevinB yes, it is definitely calling it more than once (take a look at line 24). However it will only reach this if `viewName` is not a key in the `viewCache` - which it is.
comment on: http://stackoverflow.com/q/29923587
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29933474
tagged with: angularjs
upvote count: 3
type: UnansweredQuestion
has title: Angularjs using UI-Router Resolve for Authentication
linked to: http://stackoverflow.com/q/26513746
linked to: http://stackoverflow.com/q/22537311
score: 3
tagged with: angular-ui-router
has comment: http://stackoverflow.com/comment/47989244
tagged with: authentication
type: Question
linked to: http://stackoverflow.com/q/24496321
linked to: http://stackoverflow.com/q/25872219
has body: Right now I have a simple angular set up that has a login state and a cloud state. I want to make it so the cloud state can only be run if a user is authenticated. And if not, it will direct them to the login state. So far I believe I have the "resolve" setup and I have the .run() function set up to redirect to the login state if there the resolve fails. I am just having trouble figuring out how I can make authenticated: authenticated get what I need. I know I have to make an authenticated function somewhere, I just don't know the correct way at going about it. I'm new to angular, so If anyone has any suggestions, I'd gladly appreciate them. var routerApp = angular.module('app', ['ui.router']) .config(function($stateProvider, $urlRouterProvider, $locationProvider) { $locationProvider.html5Mode(true); $urlRouterProvider.otherwise('/cloud'); $stateProvider .state('login', { url: '/login', templateUrl: "pages/templates/login.html" }) .state('cloud', { url: '/cloud', templateUrl: "pages/templates/account.html", resolve: { authenticated: authenticated } }) }) .run(function ($rootScope, $state, $log) { $rootScope.$on('$stateChangeError', function () { $state.go('login'); }); });
answer count: 1
downvote count: 0
tagged with: javascript
linked to: http://stackoverflow.com/q/28149061
linked to: http://stackoverflow.com/q/28712778
favorite count: 0
has answer: http://stackoverflow.com/a/29933902
has comment: http://stackoverflow.com/comment/47990328

http://stackoverflow.com/a/29951040
answers question: http://stackoverflow.com/q/29950886
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/48023214
has comment: http://stackoverflow.com/comment/48023230
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29950886
has body: No it is not safe. Anyone who downloads you page can clearly see your API key. They could copy this key and use it for themselves. A safer approach is to keep the API key on your server and have your page make calls to your server which then uses the API key to make calls to the API.
has comment: http://stackoverflow.com/comment/48023374
upvote count: 2

http://stackoverflow.com/comment/47909000
type: Comment
score: 2
comment on: http://stackoverflow.com/a/29892535
has text: In this case, `$state.current` is a void state because states are registered after the configuration phase
type: AnswerComment

http://stackoverflow.com/comment/48039089
comment on: http://stackoverflow.com/a/29951468
type: Comment
has text: Did you check [jQuery.fadeout() documentation](http://api.jquery.com/fadeout/)? Which is your current code?
score: 0
type: AnswerComment

http://stackoverflow.com/q/29901405
type: Question
answer count: 2
has body: I'm running a JS script, which is correct but I get an error when running in Nashorn. Why is this error? When only compiled the JS and out of Nashorn, it runs correctly and no errors are displayed but this only occurs in Nashorn. JS function process(val) { var isPeso = "(?:k|m|g)b$"; var normalizado = val.trim().toLowerCase().replace(" ", ""); var unidade = ""; var numberPattern = /\d+(\.\d{1,2})?|(Livre)/i; var myArray = []; if(isPeso.test(myArray)) { myArray = normalizado.match(isPeso); } if (myArray != null) { unidade = myArray; var i; var valores = []; if(numberPattern.test(val)) { var getNumbers = val.match(numberPattern); for (i = 0; i &lt; getNumbers.length - 1; i++) { valores.push(getNumbers[i]); } } var out = ""; //Caso [X ou superior] if (normalizado.indexOf("superior") &gt; -1) { return valores[0] + unidade + " ou superior"; } //Caso [X até Y] e [até Y] else if (normalizado.indexOf("até") &gt; -1) { //Caso [até Y] if (valores.length == 1) { out = "até " + valores[0]; } //Caso [X até Y] else { out = valores[0] + " até " + valores[1]; } } //Caso [X ou Y] ou [X ou Y ou ...] else if (normalizado.indexOf("ou") &gt; -1 || normalizado.indexOf("/") &gt; -1) { out = valores[0]; for (i = 1; i &lt; valores.length - 1; i++) { out += valores[i]; } } //Caso livre else if (normalizado.indexOf("*") &gt; -1 || normalizado.indexOf("livre") &gt; -1) { out = "Livre"; } //Caso X else { if (valores.length &gt; 0) { out = valores[0]; } } if (out.length == 0 || out == null) { return ""; } return out + unidade; } } Log javax.script.ScriptException: TypeError: (?:k|m|g)b$ has no such function "test" in &lt;eval&gt; at line number 1
tagged with: javascript
has title: Why do I get error in JS script?
has answer: http://stackoverflow.com/a/29901559
has answer: http://stackoverflow.com/a/29901744
score: 1
possible better answer: http://stackoverflow.com/a/29901744
favorite count: 0
upvote count: 2
accepted answer: http://stackoverflow.com/a/29901559
downvote count: 1
tagged with: nashorn
type: AnsweredQuestion
tagged with: java

http://stackoverflow.com/comment/47854635
score: 0
type: Comment
has text: Thank @karthikmanchala , Yeah kignkero You are right, But i can handle this on server side :)
type: AnswerComment
comment on: http://stackoverflow.com/a/29864284

http://stackoverflow.com/a/29991708
has comment: http://stackoverflow.com/comment/48104093
has comment: http://stackoverflow.com/comment/48104207
has body: This is the exact same question as posted by the user "Alex Da". Render a partial view inside a Jquery modal popup To answer your question about getting the ID, you can get that value: $(".roomBookingButton").on("click", function () { var id = $(this).data("roomid"); // make call to your partial action $.get('@Url.Action("UserPartial", "Home")', { id: id }, function (view) { $("dialog-modal").html(view); }); }); And then adjust your partial view action: [HttpGet] public PartialViewResult UserPartial(int id) { var client = db.Clients.Single(id); return PartialView("UserPartial" , client); } And that's it.
has comment: http://stackoverflow.com/comment/48110244
has comment: http://stackoverflow.com/comment/48105008
score: 0
has comment: http://stackoverflow.com/comment/48104806
has comment: http://stackoverflow.com/comment/48104118
type: Answer
answers question: http://stackoverflow.com/q/29990885

http://stackoverflow.com/comment/47995133
score: 0
type: AnswerComment
has text: if i want to change [change this too] in p tag then how can i change this too
comment on: http://stackoverflow.com/a/29936470
type: Comment

http://stackoverflow.com/comment/48012264
score: 0
has text: i managed to sort out the servlet URL thingy but still my share dialog window refused to show the preview of picture and summary text. any ideas?
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/29910442

http://stackoverflow.com/q/29930633
upvote count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/29931208
favorite count: 0
has comment: http://stackoverflow.com/comment/47984538
has body: On a clients webpage, the page uses js/css to style a tree-style view to the desired look of the client. But on some of the pages with many objects it takes some time for the styles to load. So I suggested adding a loading screen. Here is an example of the issue: http://zamozuan.com/content/16-search-auto-parts-by-vehicle-chevrolet My client purchased a little animated icon they like that fits the theme of their site nicely. I have a very simple addition to the script to add a loading icon, and then on $(document).ready, hiding the load element and showing the main element. All works fine except the loading gif is not animating until AFTER the page has completely loaded. It seems that the loop for the js is too intensive so the gif is not animating. Before anyone chops my head off, I did view the similar questions on here, but those solutions do not work for me - the majority of issues are in IE and my issue is in chrome (not IE), and most of the other options are work-arounds based on clicking buttons to enable/disable, but in my case this is when the page initially loads so that is not viable. I am wondering, is there any work-around to fix this? Is it possible to pre-load the gif in to an animated status and somehow prevent JS from interfering? Or is there a way to make the js loop not be so intensive that it completely freezes the browser? As for the code, it is the exact as the link above, with only this added at the end: $('#loading').hide(); $('.mainsearch').first().css('display', 'block'); The loading element just contains: Loading, please wait... But as mentioned, the gif does not load, just freezes. For the javascript that is styling the tree, you can view it here: http://zamozuan.com/js/tree.js Any help would be greatly appreciated, as my client would not want to waste this loading icon they bought. Thanks.
tagged with: http://stackoverflow.com/tag/html
tagged with: css
downvote count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29930774
score: 1
has comment: http://stackoverflow.com/comment/47985521
type: Question
answer count: 2
has title: Loading gif is not animating?

http://stackoverflow.com/comment/48074166
type: QuestionComment
has text: It was a quick example... this is meant to figure out if I can wrap event listeners in if statements or not in some way... not critique how I set a boolean variable.
comment on: http://stackoverflow.com/q/29977241
score: 0
type: Comment

http://stackoverflow.com/q/29931900
score: 1
linked to: http://stackoverflow.com/q/11040472
type: Question
has comment: http://stackoverflow.com/comment/47986272
has title: Javascript: How to find key name in array of objects
duplicate of: http://stackoverflow.com/q/11040472
tagged with: arrays
downvote count: 0
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/47986396
has answer: http://stackoverflow.com/a/29931983
has comment: http://stackoverflow.com/comment/47986141
has comment: http://stackoverflow.com/comment/47986305
has body: I am trying to determine if a key name is present in my array of object. As an example, how would I verify if the key with a name of 'name' equals the argument passed in my function call? Below is code to further clarify. var stooges = [{name: 'moe', age: 40}, {name: 'larry', age: 50}, {name: 'curly', age: 60}]; var test = function(arr, propName){ var result = []; for(var i = 0; i &lt; arr.length; i++){ if(arr[i][propName] === propName){ result.push(arr[i][propName]); } } return result; } func(stooges, "name");
has comment: http://stackoverflow.com/comment/47986435
has comment: http://stackoverflow.com/comment/47986418
has comment: http://stackoverflow.com/comment/47986451
favorite count: 0
has comment: http://stackoverflow.com/comment/47986229
has comment: http://stackoverflow.com/comment/47986254
has comment: http://stackoverflow.com/comment/47986236
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47986138
tagged with: javascript-objects
upvote count: 1

http://stackoverflow.com/comment/47992634
has text: `but I am not able to log it outside nor use it` - log the array? Where are you trying to log?
score: 0
comment on: http://stackoverflow.com/q/29935377
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/48046861
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29962431
type: Comment
has text: Can you also try loading the page in Chrome with the F12 debug tools open and check the network tab there. See if you get a 404 for the missing file,or something else.

http://stackoverflow.com/q/29905815
has comment: http://stackoverflow.com/comment/76199590
has answer: http://stackoverflow.com/a/29905855
tagged with: node.js
has body: In node.js, when I call: throw 'no handler error'; when the error happens, I get this message from node.js: events.js:87 throw Error('Uncaught, unspecified "error" event.'); ^ Error: Uncaught, unspecified "error" event. at Error (native) at emit (events.js:87:13) How can Node.js not retrieve the message 'no handler error' ? I get the same problem when I call 'throw new Error('no handler error');' How do I create an error message that can retrieved upon invocation? Seems crazy that node.js would allow me to define the error message without ever being able to see it later?
score: 2
upvote count: 2
has title: Unnecessary Uncaught, unspecified "error" event
type: Question
has answer: http://stackoverflow.com/a/29905952
answer count: 2
downvote count: 0
tagged with: javascript
favorite count: 0
type: UnansweredQuestion

http://stackoverflow.com/a/29982241
answers question: http://stackoverflow.com/q/29982240
has body: Problem: Detect touchstart event for multi touch action on android 2.3 browsers Findings: In multi touch supported browsers, a multi touch event object will contain an array "touches", which will have all the touch points. But in Android 2.3 default browsers it contains only single touch point for multi touch action and it will trigger multiple touch start event consecutively. We can see this consecutive touch start events with only one touch point are triggered instead one touchstart with multiple touch points by logging the events. Workaround: Touchstart event can be identified bby storing the touch events in an array. And whenever a new event is occurred chekc the previous event also. If the consecutive events are touchstart, we can assume it is multi touch. Please see the references below: Google discussion on touch event issue: https://code.google.com/p/android/issues/detail?id=11909 For testing the multi touch support in browsers http://scripty2.com/demos/touch/touchspector/ http://www.paulirish.com/demo/multi https://rawgit.com/borismus/MagicTouch/master/index.html https://cdn.rawgit.com/muhammedbasil/6d49a884f6ca315614be/raw/5aed46a31d46638b15fbb0a34366346e67d0738a/index.html
score: 0
type: Answer

http://stackoverflow.com/comment/47912554
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29893291
has text: @silverwind it will not be: `for (var i = index + 1; i < arr.length - 1; ++i) {}` will never get out of bounds http://jsfiddle.net/sygrp9u0/4/
type: Comment

http://stackoverflow.com/a/29958137
accepted answer of: http://stackoverflow.com/q/29958079
answers question: http://stackoverflow.com/q/29958079
has comment: http://stackoverflow.com/comment/48037104
has comment: http://stackoverflow.com/comment/48037067
has body: It seems you don't actually need to parse this file as a csv, it's basically a plain text string? Assuming jquery: var USDEUR; $.ajax({ type: "GET", url: "http://download.finance.yahoo.com/d/quotes.csv?s=USDEUR=X&amp;f=l1", dataType: "text", success: function(data) {USDEUR = data} }); EDIT: It seems the url has access control issues, you may not be able to do this with a XHTTP request from the client. Is this data meant to be accessed as a public API?
type: AcceptedAnswer
score: 0
type: Answer

http://stackoverflow.com/a/30113653
downvote count: 0
answers question: http://stackoverflow.com/q/29982289
has body: It sounds like you want letters instead of numbers inside your pin: // Function to create the dynamic marker function pinImage(i) { var letter = String.fromCharCode(i + 65); // 'A' is 65. return new google.maps.MarkerImage( "http://www.googlemapsmarkers.com/v1/" + letter + "/" + pinColor + "/", new google.maps.Size(21, 34), new google.maps.Point(0,0), new google.maps.Point(10, 34)); } Also, you need to create objects that keep track of the address, latlng, and index of each of your markers. I suggest you use map.data to do this. https://developers.google.com/maps/documentation/javascript/reference#Data var addresses = ['New York', 'San Francisco']; addresses.forEach(function(address, i) { // Create a feature. var feature = map.data.add({ 'id': i, 'properties': {'address': address} }); // Display the feature in the list. $('.address-list').append($('&lt;div&gt;') .append($('&lt;img&gt;').attr('src', pinImage(i))) .append($('&lt;div&gt;').text(address))); // Do more fancy things here // Geocode the feature and position it on the map. geocoder.geocode({'address': address}, function(results, status) { if (status == google.maps.GeocoderStatus.OK) { feature.setGeometry(results[0].geometry.location); if (i == 0) { map.setCenter(results[0].geometry.location); } } }); }); Then you can control the display of the markers like this: map.data.setStyle(function(feature) { return { title: feature.getProperty('address'), zIndex: feature.getId(), icon: pinImage(feature.getId()), shadow: pinShadow }; });
type: Answer
score: 1
upvote count: 1

http://stackoverflow.com/q/29983150
downvote count: 0
has body: Am facing a very strange issue. I've a hidden fields as shown below. <asp:HiddenField ID="hid_test" ClientIDMode="Static" runat='server' /> And in server side am setting a value to the hidden field as follows Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load If Not IsPostBack Then hid_test.Value = "abcd" End If End Sub Very simple code. So in the first run the alert shows as "abcd" since am setting that from server side. OK.. Thats fine. Then what I did was I changed hidden field value using jquery from console as below $('#hid_test').val('12'); After this change does when I hit F5 (Page reloads) obviously my server side code hits and the hidden fields value should be changed to abcd But when the page loads the alert says 12 itself. Means its keeping the value set from client side. Any kind help appreciated. Am testing in Firefox. I disabled FF form fill feature as follows
tagged with: asp.net
favorite count: 0
possible better answer: http://stackoverflow.com/a/68416777
has answer: http://stackoverflow.com/a/68416777
linked to: http://stackoverflow.com/q/6487970
type: AnsweredQuestion
score: 3
upvote count: 3
has title: Hidden field value set from Javascript retains even after page refresh
type: Question
has answer: http://stackoverflow.com/a/29983221
tagged with: firefox
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/29983221
answer count: 2

http://stackoverflow.com/comment/48170181
score: 0
comment on: http://stackoverflow.com/a/29970010
type: Comment
type: AnswerComment
has text: You only want the string "kn" ?

http://stackoverflow.com/a/29928888
has body: You could also hide element until ajax gets loaded &amp; till then you can show some loading image, which would tell user that UI controller is loading &lt;input ng-if="bid.min &amp;&amp; bid.min" type="range" name="bidSlider" id="bidSlider" min="{{bid.min}}" max="{{bid.max}}" ng-model="bid.value" step="1"&gt; &lt;img ng-if="!bid.min || !bid.max" ng-src="loadingImg.jpg" width="50" height="50"&gt;
has comment: http://stackoverflow.com/comment/47980419
has comment: http://stackoverflow.com/comment/47980018
type: Answer
answers question: http://stackoverflow.com/q/29928723
score: 0
has comment: http://stackoverflow.com/comment/47981432

http://stackoverflow.com/comment/47978890
has text: @uʍopǝpısdn scroll a bit, there's a timeout in the img element.
comment on: http://stackoverflow.com/q/29928425
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47911707
has text: I'm sorry now I see that you used onload method, in each case after completion of the for loop (var x = 0; x <tasks.length; h ++) Set the function to create tabs BuildTabs()
type: Comment
comment on: http://stackoverflow.com/a/29894237
type: AnswerComment
score: 0

http://stackoverflow.com/comment/47868149
score: 0
type: AnswerComment
has text: Sorry but this is not what I am looking for. I was asking if there is a way of handling when the device orientation is changed from portrait to landscape view.
type: Comment
comment on: http://stackoverflow.com/a/29871577

http://stackoverflow.com/a/70782928
answers question: http://stackoverflow.com/q/29887850
has body: I give a solution for jquery daterangepicker nested in bootstrap modal (problem: selectors month/years not appearing on FF browser). The solution is to add the "parentEl" option indicating the modal in which the daterangepicker is to be initialized: $('#example-date-input').daterangepicker({ parentEl: $('.modal-where-daterangepicker-should-be-nested'), ..... });
downvote count: 0
has comment: http://stackoverflow.com/comment/135400004
type: Answer
upvote count: 1
score: 1

http://stackoverflow.com/comment/48101674
type: QuestionComment
comment on: http://stackoverflow.com/q/29940337
type: Comment
score: 0
has text: @DavidThomas Fair. I guess I meant it is an unusual selector since, in theory, element Id's should be unique to a page.

http://stackoverflow.com/a/30869412
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29945177
type: Answer
answers question: http://stackoverflow.com/q/29945177
has body: Have you tried using the attribute tabindex in your HTML? It may be worthwhile to give aria-label and role a try, too, to see if they help with the issue.
score: 0

http://stackoverflow.com/a/29871905
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/47883014
downvote count: 1
answers question: http://stackoverflow.com/q/29869372
has body: I think you want to build something like a "pageObject" (see https://github.com/angular/protractor/blob/master/docs/page-objects.md) for your custom-form-directive directive. This object will understand how the directive maps to primitives that Protractor will understand (e.g., specific input fields). It should take a locator so its callers can pass in the how to find the directive on the page, but the object should handle everything after that. var object = new customFormDirectiveObject(by.model('data.person')); depending on how your directive works you'd do something like: object.setName(first, last, user); or if its more dyanmic maybe something like this: object.setName({firstname: first, lastname: last, username: user });
score: 0

http://stackoverflow.com/q/29876730
has comment: http://stackoverflow.com/comment/47877758
linked to: http://stackoverflow.com/q/46155
type: Question
answer count: 2
tagged with: validation
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/47877883
tagged with: email
tagged with: regex
has body: I have used regex to test for the email input. It does give an alert when a wrong email (for eg without an @ or .com) is submitted but when I press ok for the alert, it still posts the email to the email address that is am directed to the page send_msg.php when it should not.. I am quite new to Javascript and PHP so I am still learning.. I know that the if clause should follow an else but I don't know how to make it post the email if it is true. And can how I make it just display a message below the email input field instead of making it raise an alert? function checkEmail(inputvalue){ var pattern=/^([a-zA-Z0-9_.-])+@([a-zA-Z0-9_.-])+\.([a-zA-Z])+([a-zA-Z])+/; if(pattern.test!=(inputvalue)){ alert("Please enter a valid email address"); return false; } } Get in touch Fill in the form below, and we'll get back to you within 24 hours. Name: Email: Message: Send Email
has title: Javascript regex email validation
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29876769
tagged with: php
has answer: http://stackoverflow.com/a/29876759
duplicate of: http://stackoverflow.com/q/46155

http://stackoverflow.com/comment/48099619
comment on: http://stackoverflow.com/a/29990138
score: 0
type: AnswerComment
type: Comment
has text: I'm working on a huge project with hundreds of selects so it's easier to specify what I don't want to be applied to as there are only going to be a few of these. Good idea though

http://stackoverflow.com/q/29901977
type: Question
has comment: http://stackoverflow.com/comment/47926641
downvote count: 0
has body: Asked this question a few weeks ago, but have not been able to find a solution - I'm a code novice, so I'll do my best to be more specific. I have a page with an accordion - it's built-in as a short code that comes with the site theme. I have links in external pages that have anchor tags that take you to the accordion page - right now when those links are clicked, user is taken to the term but the panel does not open. I would like for the panel of the accordion to also open. As-is, all the panels are closed when you get to the page. Here is the code I have so far to remove the 'closed' class when a link w/an anchor is clicked: var anchor = window.location.hash.substring(1); $('.' + anchor).removeClass('su-spoiler-closed'); I have not been able to get it to work, perhaps I don't have it in the right spot? Maybe jquery is not working on the page in general?
tagged with: javascript
has comment: http://stackoverflow.com/comment/47926720
tagged with: jquery
favorite count: 0
answer count: 3
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29902247
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47926666
upvote count: 1
has comment: http://stackoverflow.com/comment/47926728
has answer: http://stackoverflow.com/a/29902181
linked to: http://stackoverflow.com/q/21932607
has title: open accordion panel from external anchor link
score: 1
has answer: http://stackoverflow.com/a/43743091

http://stackoverflow.com/comment/47970489
score: 0
type: Comment
type: QuestionComment
has text: So the problem is that you can't get the styling to work with the ng-bind/ng-bind-template?
comment on: http://stackoverflow.com/q/29924101

http://stackoverflow.com/a/29989380
has comment: http://stackoverflow.com/comment/48113091
has comment: http://stackoverflow.com/comment/48102320
answers question: http://stackoverflow.com/q/29965136
has comment: http://stackoverflow.com/comment/48102344
has comment: http://stackoverflow.com/comment/48099442
downvote count: 0
has body: The modal isn't showing correctly because you don't have the jquery ui css loaded. &lt;link href='https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.3/jquery-ui.css' rel='stylesheet' /&gt; And go with the eventClick method. Edit 1: I have no luck to display the dialog box... it shows still only text... Okay, try this: eventClick: function(event){ $("&lt;div&gt;").dialog({ modal: true, title: event.title, width:350}); }, This will create a new element and make it a dialog.
score: 3
has comment: http://stackoverflow.com/comment/48102083
has comment: http://stackoverflow.com/comment/48099558
type: Answer
has comment: http://stackoverflow.com/comment/48105055
upvote count: 3

http://stackoverflow.com/a/29904345
score: 0
type: Answer
has body: function test() { var wordApp = new ActiveXObject("Word.Application") var doc = wordApp.Documents.Add() var col doc.Tables.Add(Range=doc.Range(0, 0), numrows=1, numcolumns=2) doc.Tables(1).Borders.Enable = true row = 1 col = 0 while (!rs.eof) { col = col + 1 alert(row) if (col = 1) { doc.Tables(1).Cell(row,1).Range.Text = rs.Fields("firstname").value col = col + 1 rs.movenext } if (col = 2) { if (rs.AbsolutePosition &lt; rs.RecordCount) { doc.Tables(1).Rows.Add() } doc.Tables(1).Cell(row,2).Range.Text = rs.Fields("firstname").value col = 1 rs.movenext } row++ } wordApp.Visible = true wordApp.Activate(); //wordApp.WindowState = 1 }
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29884101
answers question: http://stackoverflow.com/q/29884101

http://stackoverflow.com/a/32363054
downvote count: 0
score: 8
upvote count: 8
type: Answer
accepted answer of: http://stackoverflow.com/q/29911691
has comment: http://stackoverflow.com/comment/73716707
has comment: http://stackoverflow.com/comment/73707852
has body: As of version 1.13 cesium now supports GroundPrimitives. They will drape over terrain. It looks like this: http://cesiumjs.org/images/2015/09-01/groundPrimitives.gif This the example Cesium gives: var rectangleInstance = new Cesium.GeometryInstance({ geometry : new Cesium.RectangleGeometry({ rectangle : Cesium.Rectangle.fromDegrees(-140.0, 30.0, -100.0, 40.0) }), id : 'rectangle', attributes : { color : new Cesium.ColorGeometryInstanceAttribute(0.0, 1.0, 1.0, 0.5) } }); scene.primitives.add(new Cesium.GroundPrimitive({ geometryInstance : rectangleInstance }));
answers question: http://stackoverflow.com/q/29911691
has comment: http://stackoverflow.com/comment/56466204
has comment: http://stackoverflow.com/comment/56360678
type: AcceptedAnswer

http://stackoverflow.com/a/29946265
has body: not sure if your script worked the way you intended to when you passed deferred.resolve(result) as a callback to promise... so just change .then(deferred.resolve(result)); to .then(function(){ deferred.resolve(result) });
has comment: http://stackoverflow.com/comment/48015453
score: 3
has comment: http://stackoverflow.com/comment/48048109
has comment: http://stackoverflow.com/comment/48048390
has comment: http://stackoverflow.com/comment/48015820
has comment: http://stackoverflow.com/comment/48156531
has comment: http://stackoverflow.com/comment/48015437
has comment: http://stackoverflow.com/comment/48121928
answers question: http://stackoverflow.com/q/29945767
upvote count: 3
has comment: http://stackoverflow.com/comment/48156307
type: Answer
downvote count: 0
has comment: http://stackoverflow.com/comment/48013598

http://stackoverflow.com/comment/48070571
score: 0
type: Comment
type: QuestionComment
has text: Right, you're not using the data for the links at all -- if you want to do that, you need to take account of it when putting together `edges`.
comment on: http://stackoverflow.com/q/29972635

http://stackoverflow.com/comment/47987379
type: QuestionComment
has text: Then it is that simple. Thank you Lashane.
score: 0
comment on: http://stackoverflow.com/q/29932513
type: Comment

http://stackoverflow.com/comment/48050078
score: 0
type: AnswerComment
type: Comment
has text: you mean modal views as in a dialog that needs to be closed or handled before you do anything else?
comment on: http://stackoverflow.com/a/29963784

http://stackoverflow.com/comment/48074263
comment on: http://stackoverflow.com/a/29976735
type: AnswerComment
has text: ahhh. that makes sense. so the "var" used on line 4 is also declaring the variables on lines 10 and 12. Excellent! Thank you so much for your help!
score: 0
type: Comment

http://stackoverflow.com/q/29937792
upvote count: 1
has comment: http://stackoverflow.com/comment/47997804
answer count: 1
has comment: http://stackoverflow.com/comment/47997085
tagged with: javascript
favorite count: 0
has title: Use file_get_contents() and implode() to pass array to javascript not working
downvote count: 0
type: UnansweredQuestion
tagged with: php
has comment: http://stackoverflow.com/comment/47999221
type: Question
has answer: http://stackoverflow.com/a/29939148
score: 1
has body: I am developing a simple image gallery which shows images and related caption. All images are inside a directory and caption in another (as single files). A php script lists all files in both directories and pass arrays to a javascript wich change image and caption when the user press a button. [...] for($x = 2; $x &lt; $lenght; $x++) { $filesi[$x] = $imgdirectory."/".$lsi[$x]; } for($x = 2; $x &lt; $lenght; $x++) { $filename = $capdirectory."/".$lsc[$x]; $filesc[$x] = file_get_contents($filename); } //Create array for JS $captions = '["' . implode('", "', $filesc). '"]'; $images = '["' . implode('", "', $filesi). '"]'; ?&gt; &lt;script&gt; var captions = &lt;?php echo $captions; ?&gt;; var images = &lt;?php echo $images; ?&gt;; [...] Images work properly and I can also print caption's file name instead of caption i.e. $filesc[$x] = $filename; but when I use "file_get_contents()" to read file the gallery stops working. If I echo $captions and manually set $captions with the very same output e.g. $captions='["first caption","second caption", "..."]'; the gallery works properly, so the array should be properly formatted... Thank you in advance SOLUTION I was creating an array with two empty elements (0,1) in order to avoid ./ and ../ in file list, so I have added a +2 to the lsi index. for($x = 0; $x &lt; $lenght-2; $x++) { $filesi[$x] = $imgdirectory."/".$lsi[$x+2]; } In addition I have used json_encode, as suggested, instead of manual json encodig. The output seems to be the same but now the gallery works! var images = &lt;?php echo json_encode($filesi); ?&gt;;

http://stackoverflow.com/a/30357567
type: AcceptedAnswer
type: Answer
downvote count: 0
score: 1
has body: Accessing barometer information Sadly as of 2015 it's not possible to access barometer information in a native browser environment. A lot of work has been done on writing sensor API specifications, but as barometers are quite a rare hardware feature still they have not been receiving a lot of attention. It is however possible to bundle your web application in Cordova and use the barometer plugin for android to access the barometer from your code. This however means that the user has to install your application and this would only work Android. Using GPS information after all For the large majority of applications where you need altitude information there is only one possible altitude per coordinate pair (this is for example not true if you wish to determine the level you're at in a building, but current GPS altitude information isn't precise enough for that normally either way). In those cases you can request the GPS location and simply request the altitude from a service with a surface database. Two such services are the Google Elevation API (entire world) or the NED Point Query Service (US only?).
answers question: http://stackoverflow.com/q/29937410
accepted answer of: http://stackoverflow.com/q/29937410
has comment: http://stackoverflow.com/comment/48835598
has comment: http://stackoverflow.com/comment/48836583
upvote count: 1

http://stackoverflow.com/comment/48067227
type: Comment
type: QuestionComment
has text: :( *removed for being stupid*
comment on: http://stackoverflow.com/q/29973681
score: 1

http://stackoverflow.com/comment/47825435
type: QuestionComment
has text: In line 2, you create a var to hold the audio element. Why not separate that out with some logic that checks to see if you already have an audio element? This way you wouldn't receive duplicates, and you can reuse the same `audio` variable.
comment on: http://stackoverflow.com/q/29849258
score: 0
type: Comment

drupal
type: Tag
tag name: drupal
tags question: http://stackoverflow.com/q/29879301

http://stackoverflow.com/comment/48048383
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29963882
has text: Unless you have "ABS(x)+Floor(y)" in your `explist` it will not find it. Here is my jsbin if you'd like to expand on it http://jsbin.com/pisojupucu/1/edit?html,js,output

http://stackoverflow.com/comment/47925803
type: Comment
comment on: http://stackoverflow.com/a/29901053
score: 0
type: AnswerComment
has text: To elaborate on this, you can use jquery's .blur() function: `$(window).blur(function() {clearTimeout(mytimer);})`

http://stackoverflow.com/q/29912773
has comment: http://stackoverflow.com/comment/48623857
has comment: http://stackoverflow.com/comment/47951161
tagged with: hybrid-mobile-app
score: 18
has title: Issue with Android Hybid app to display remote image with Ionic framework?
upvote count: 18
has body: I am new to Ionic. I am using Ionic Framework (1.3.20), Angular JS, Cordova 5.0.0 Template file browse.html code: &lt;div class="col-50"&gt;&lt;img ng-src="{{availableImages[currentImage].src}}" /&gt;&lt;/div&gt; app.js code: .state('app.browse', { url: "/browse", views: { 'menuContent': { templateUrl: "templates/browse.html", controller: 'Ctrl' } } }) controller.js code .controller('Ctrl',function($scope) { $scope.currentImage = 0; $scope.availableImages = [ { src: "http://lorempixel.com/160/160/people/3" } ]; console.log("reading image in controller !!!"); }) Header details: Request URL:http://lorempixel.com/160/160/people/3 Request Method:GET Status Code:404 Not Found (from cache) Response Headers Client-Via:shouldInterceptRequest Request Headers Provisional headers are shown Accept:image/webp,*/*;q=0.8 User-Agent:Mozilla/5.0 (Linux; Android 5.0.2; XT1033 Build/LXB22.46-28; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/42.0.2311.129 Mobile Safari/537.36 Config.xml file: &lt;access origin="*"/&gt; Error on console: GET http://lorempixel.com/160/160/people/3 404 (Not Found) I verified the url http://lorempixel.com/160/160/people/3 is showing image in my mobile browser. but the image is not coming on the app.
tagged with: ionic-framework
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/47954441
has answer: http://stackoverflow.com/a/29913482
has comment: http://stackoverflow.com/comment/47952383
favorite count: 0
has comment: http://stackoverflow.com/comment/47952332
has comment: http://stackoverflow.com/comment/47950254
has comment: http://stackoverflow.com/comment/47948198
has answer: http://stackoverflow.com/a/29916802
has comment: http://stackoverflow.com/comment/47952817
tagged with: cordova
tagged with: angularjs
type: UnansweredQuestion

http://stackoverflow.com/a/43259131
upvote count: 1
has body: I've just spent hours on this issue. I couldn't use the $index solution from @eladcon, as my ng-repeat also used a filter, to the index isn't correct if the rows/items are filtered. I thought I would be able to just do this: $filter('filter')($scope.rows, {id: 1})[0] = newItem; but that doesn't work. I ended up iterating the array until I found a match, and then using the $index from the iteration (not from the ng-repeat) to set the array item to the new item. // i'm looking to replace/update where id = 1 angular.forEach($scope.rows, function(row, $index) { if (row.id === 1) { $scope.rows[$index] = newItem; } }) See here: https://codepen.io/anon/pen/NpVwoq?editors=0011
has comment: http://stackoverflow.com/comment/137977582
type: Answer
downvote count: 0
answers question: http://stackoverflow.com/q/29947176
score: 1

http://stackoverflow.com/q/29904260
tagged with: javascript
score: 0
has title: Replacing existing ios app with a PhoneGap version
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29955650
type: AnsweredQuestion
tagged with: cordova
type: Question
has body: I've been getting mixed reviews recently on one of my apps so I've been working on a HTML5 phonegap replacement. Do I just have to match the bundle ID up with the existing app? I have tried to create a new app using the following command phonegap create "CSCS Revision" --id "&lt;my bundle ID&gt;" --name "&lt;my app name&gt;". However, I have a problem, &lt;my bundle ID&gt; contains a hyphen, and phonegap tells me that it's an invalid character, is there a way to override this? The next thing I tried was creating the app and then changing the bundle ID. This seemed to work OK, but when I copied over the contents of my www directory from the other app it seems that some of the javascript files aren't included properly in the HTML. I have one file called data.js that just has a big array in it, but it seems that the array can't be accessed in the newly created app despite it working in the other app which is a direct copy.
accepted answer: http://stackoverflow.com/a/29955650
answer count: 1
tagged with: ios

http://stackoverflow.com/a/29955259
downvote count: 0
score: 1
has body: This function will generate SQL code which is missing quotes around the datetime variable, resulting in invalid SQL code. function sendShipPosition(position) { var input = ''; if (position.moving === true) { var currentdate = new Date(); var datetime = currentdate.getFullYear() + "-" + (currentdate.getMonth()+1) + "-" + currentdate.getDate() + " " + currentdate.getHours() + ":" + currentdate.getMinutes() + ":" + currentdate.getSeconds(); # Here! var input = ', moving_datetime = \'' + datetime + '\'' } connection.query('UPDATE ships SET x_axis = :x, y_axis = :y' + input + ' WHERE ship_id = :ship_id'), { x: parseInt(position.x), y: parseInt(position.y), ship_id: 1 }; }
upvote count: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29955214
answers question: http://stackoverflow.com/q/29955214
has comment: http://stackoverflow.com/comment/48031437
type: Answer

http://stackoverflow.com/comment/48040323
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29959451
has text: ok. If still any issue then show use your code. we will try to solve it.
score: 0

http://stackoverflow.com/comment/136557237
comment on: http://stackoverflow.com/a/64908581
type: AnswerComment
score: 0
has text: It does now, as of September 2022
type: Comment

http://stackoverflow.com/comment/48020590
type: QuestionComment
has text: @LelioFaieta I'm sorry, I don't follow. Where do I reference `.0`?
comment on: http://stackoverflow.com/q/29949822
score: 0
type: Comment

http://stackoverflow.com/a/29919808
type: Answer
upvote count: 0
has body: In struts2 you can get it - e.g., &lt;s:select name="name" headerKey="-1" list="countryList" id="country" value="%{countryList}" &gt;&lt;/s:select&gt; In jQuery you will have to get the list via a ajax call and iterate over it e.g, $.ajax({ url: 'rcmidAuditTrail.action', type: 'GET', async : false, dataType: 'json', error: function(data) { console.log('error'); }, success: function(list) { var html = '&lt;select&gt;' $.each(list,function(i,value){ html+='&lt;option&gt;'+value+'&lt;/option&gt;'; }); $('dropdownId').html(html); } });
downvote count: 5
score: -5
answers question: http://stackoverflow.com/q/29919596

http://stackoverflow.com/q/29928117
type: AnsweredQuestion
score: 1
type: Question
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: braintree
has answer: http://stackoverflow.com/a/29930890
tagged with: python
has title: How to post "amount" variable in a Braintree JS secure custom form?
upvote count: 1
has body: Is it possible to send your amount at the same time as your payment form when using braintree? The Braintree guide explicitly says: "Make sure you don't include name attributes in your form elements. If the form is accidentally submitted and name attributes are present, sensitive data can reach your server." So if using this simple implementation in HTML: &lt;form id="checkout" action="/your/server/endpoint" method="post"&gt; &lt;input data-braintree-name="number" value="4111111111111111"&gt; &lt;input data-braintree-name="expiration_date" value="10/20"&gt; &lt;input type="submit" id="submit" value="Pay"&gt; &lt;/form&gt; And my Python endpoint looks like this: @app.route('/payment', methods=['POST']) #@cross_origin() def do_payment(): nonce = request.form["payment_method_nonce"] result = braintree.Transaction.sale({ "amount": amount, "payment_method_nonce":nonce, "options": { "submit_for_settlement": True } }) ` Is it then possible to send the amount in a post without messing up the encryption for the credit card information ? Or do I need to implement a second AJAX callback POST and persist somehow in the Python backend or implement som kind of sessions handling in Flask ? What are my alternatives and best practice ? FYI: everything works as it is (if setting the amount to a static "10" for instance, the only thing missing is the amount variable in the backend since I can't send it using the payment form submit.
accepted answer: http://stackoverflow.com/a/29930890

http://stackoverflow.com/q/29847553
downvote count: 5
score: -4
has comment: http://stackoverflow.com/comment/47820804
type: AnsweredQuestion
has title: Why is it unable to match?
has comment: http://stackoverflow.com/comment/47820867
has comment: http://stackoverflow.com/comment/47820795
has comment: http://stackoverflow.com/comment/47820837
type: Question
possible better answer: http://stackoverflow.com/a/29847652
accepted answer: http://stackoverflow.com/a/29847658
has comment: http://stackoverflow.com/comment/47820851
tagged with: javascript
tagged with: jquery
has body: Why its unable to match? var d = $('#bstudylevel').val(); // Bachelor var g = $('#bfrench').val(); // Moedertaal var h = $('#bnederlands').val(); // Moedertaal switch(selected_language) { //NL case 'NL': if( ((d!=='Bachelor') || (d!=='Master') || (d!=='Doctoraat') ) &amp;&amp; ((g!=='Moedertaal') || (g!=='Zeer Goed') ) &amp;&amp; ((h!=='Moedertaal') || (h!=='Zeer Goed') ) ) { console.log("You do not match the requirement: ", d, g, h); return false; } break; case 'FR': if( ((d!=='Bachelier') || (d!=='Master') || (d!=='Doctorat') ) &amp;&amp; ((g!=='Très bon') || (g!=='Bon') ) &amp;&amp; ((h!=='Très bon') || (h!=='Zeer Goed') ) ) { console.log("You do not match the requirement: ", d, g, h); return false; } break; } console.log('Expected output is this..., not above'); Output: You do not match the requirement: Bachelor Moedertaal Moedertaal
has answer: http://stackoverflow.com/a/29847658
answer count: 3
has answer: http://stackoverflow.com/a/29847742
upvote count: 1
has comment: http://stackoverflow.com/comment/47820838
has comment: http://stackoverflow.com/comment/47821050
favorite count: 0
has answer: http://stackoverflow.com/a/29847652

http://stackoverflow.com/comment/47898911
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29870678
type: AnswerComment
has text: I used this method however I get an error in my console: `Uncaught SecurityError: Failed to execute 'getImageData' on 'CanvasRenderingContext2D': The canvas has been tainted by cross-origin data.`

http://stackoverflow.com/comment/47939498
comment on: http://stackoverflow.com/a/29899300
score: 0
type: AnswerComment
has text: What is moment-timezone expecting to receive as the timezone? I passing it as a string.
type: Comment

http://stackoverflow.com/comment/48019270
has text: I solved the issue by using @Rohit Batra's solution, but thanks!
type: AnswerComment
comment on: http://stackoverflow.com/a/29939897
score: 0
type: Comment

http://stackoverflow.com/q/29983431
score: 2
type: Question
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: ngdoc
tagged with: documentation
has answer: http://stackoverflow.com/a/37030133
favorite count: 0
has title: How to use ngDoc comments for routeConfig
has body: I am trying to document my Angular WebApp using ngdocs and grunt. I want to know that is there a way to document a route configuration because I feel that my routing system of WebApp if fairly complex and it needs some attention in its documentation part. Is there anyway I can have it on the levels of controllers, factory etc. Can I place it on below level: /** * @ngdoc controller * @name shippingSolutionApp.controller:MainCtrl * @description * # MainCtrl * PAGE LEVEL CONTROLLER: This is a page level controller. * * This is a empty controller of shippingSolutionApp. Any business logic to initiate the app must fall here when required. * * This holds the initialization process for both the sub-child WebApps: Admin Dashboard and User Dashboard * @requires * $scope */ Thanks, Ankit
tagged with: angularjs
upvote count: 2
type: UnansweredQuestion

http://stackoverflow.com/a/29935808
answers question: http://stackoverflow.com/q/29935390
score: 0
type: Answer
has body: This is my working example first.html second.html Note that div has default height = 0px you need to set height for divs to work this eg.
accepted answer of: http://stackoverflow.com/q/29935390
type: AcceptedAnswer

http://stackoverflow.com/a/29957009
score: 2
has body: Two things: Case is significant. If you declare the variable bee, you can't read it with Bee. .value is always a string. You need to convert the strings to numbers: var bee = Number(document.getElementById("beerPerc").value); If you don't do this, + will perform string concatenation, not addition. You don't need to call parseInt() on the result of a numeric calculation, that's always a number. function calculator2() { document.getElementById("liquorPerc").value = 100 - (parseInt(document.getElementById("beerPerc").value, 10) + parseInt(document.getElementById("winePerc").value, 10))) }
has comment: http://stackoverflow.com/comment/48034811
answers question: http://stackoverflow.com/q/29956988
downvote count: 0
upvote count: 2
type: Answer

http://stackoverflow.com/comment/47988930
type: Comment
has text: One other tip, not that it's much of a difference...note that `data.Employ_Status = isEmployee;` would also work.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29933306

http://stackoverflow.com/comment/48268127
comment on: http://stackoverflow.com/a/30070061
type: AnswerComment
has text: Where do you have that first `setTimeout`?
score: 0
type: Comment

http://stackoverflow.com/q/29858272
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/29858366
type: UnansweredQuestion
tagged with: css
has title: Want to copy url from container and then use it as bg but I can't
has body: So I have this code $(function () { if (window.location.pathname.indexOf('/u') == 0) { var imgdefondo = $('#field_id2 dd.ajax-profil_parent div.field_uneditable').text(); //*****imagen de fondo*****// $("td.row1 div#profile-advanced-details.genmed").css("background", "url('imgdefondo') no-repeat center"); } }); It's supposed to copy the text in the container named "Imagen de portada:" which should be an image and then use it as the background image of "td.row1 div#profile-advanced-details.genmed", but it doesn't work with my code, I tried a couple of javascript checkers and they said that the variable "imgdefondo" is unused, how do I modify the code to make it work like I want to? Hope you can help me Webpage: http://evolvelatam.foroweb.org/u1
type: Question
has answer: http://stackoverflow.com/a/29858344
tagged with: javascript

http://stackoverflow.com/comment/48097480
score: 3
has text: Yep, I forgot that step. You have to decode the JSON with [$.parseJSON(data)](https://api.jquery.com/jquery.parsejson/) to use it as a Javascript object, or it won't work.
type: AnswerComment
comment on: http://stackoverflow.com/a/29988302
type: Comment

http://stackoverflow.com/q/29857787
has comment: http://stackoverflow.com/comment/47848015
tagged with: webgl
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/29885249
tagged with: javascript
score: 0
tagged with: texture-mapping
has comment: http://stackoverflow.com/comment/47852204
has body: I'd like to get an opinion: I currently have the following program consisting of two multi-colored cubes that can be selected via the one html button and rotated by pressing corresponding keys on the keyboard. Here is my HTML file: Oops ... your browser doesn't support the HTML5 canvas element files webgl-utils.js, initShaders.js, and MV.js can be found here: http://www.cs.unm.edu/~angel/WebGL/7E/Common/ And here is the accompanying javascript file: var canvas; var gl; var numVertices = 36; var xAxis = 0; var yAxis = 1; var zAxis = 2; var axis1 = 0; var axis2 = 0; var rot1 = 1.0; // rate of rotation var rot2 = 1.0; var theta1 = [ 0, 0, 0 ]; var theta2 = [ 0, 0, 0 ]; // cube position along x, y, and z axis and size var posiz1 = [ 0, 0, 0, 1 ]; var posiz2 = [ 0, 0, 0, 1 ]; // used to send info back to html, I think var thetaLoc; var posLoc; var firstCube = true; var vertices = [ vec3( -0.5, -0.5, 0.5 ), vec3( -0.5, 0.5, 0.5 ), vec3( 0.5, 0.5, 0.5 ), vec3( 0.5, -0.5, 0.5 ), vec3( -0.5, -0.5, -0.5 ), vec3( -0.5, 0.5, -0.5 ), vec3( 0.5, 0.5, -0.5 ), vec3( 0.5, -0.5, -0.5 ) ]; var vertexColors = [ vec4( 0.0, 0.0, 0.0, 1.0 ), // black vec4( 1.0, 0.0, 0.0, 1.0 ), // red vec4( 1.0, 1.0, 0.0, 1.0 ), // yellow vec4( 0.0, 1.0, 0.0, 1.0 ), // green vec4( 0.0, 0.0, 1.0, 1.0 ), // blue vec4( 1.0, 0.0, 1.0, 1.0 ), // magenta vec4( 1.0, 1.0, 1.0, 1.0 ), // white vec4( 0.0, 1.0, 1.0, 1.0 ) // cyan ]; // indices of the 12 triangles that comprise the cube var indices = [ 1, 0, 3, 3, 2, 1, 2, 3, 7, 7, 6, 2, 3, 0, 4, 4, 7, 3, 6, 5, 1, 1, 2, 6, 4, 5, 6, 6, 7, 4, 5, 4, 0, 0, 1, 5 ]; window.onload = function init() { canvas = document.getElementById( "gl-canvas" ); gl = WebGLUtils.setupWebGL( canvas ); if ( !gl ) { alert( "WebGL isn't available" ); } gl.viewport( 0, 0, canvas.width, canvas.height ); gl.clearColor( 1.0, 1.0, 1.0, 1.0 ); gl.enable(gl.DEPTH_TEST); // Load shaders and initialize attribute buffers var program = initShaders( gl, "vertex-shader", "fragment-shader" ); gl.useProgram…
has title: Can I get a texture onto my second cube?
has answer: http://stackoverflow.com/a/29886145
accepted answer: http://stackoverflow.com/a/29886145
possible better answer: http://stackoverflow.com/a/29885249
type: AnsweredQuestion

http://stackoverflow.com/q/29874454
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47873678
has comment: http://stackoverflow.com/comment/47873622
type: Question
has body: I am writing a socket server in nodejs using websocket library, I have a requirement where if I give a logfilename in the server.js as a argument then all the logs should be redirected to logfile otherwise it should be displayed on the console. It seems to be very trivial issue but I am very new to node js, can you guys help me how to acheive it.
has answer: http://stackoverflow.com/a/29874545
accepted answer: http://stackoverflow.com/a/29874545
tagged with: javascript
score: 0
answer count: 1
tagged with: logging
tagged with: node.js
has title: log file redirection in node js

http://stackoverflow.com/a/29873251
has body: IE browsers up to IE8 do not support addEventListener (I'm assuming you meant the latest version you have when you said Internet Explorer Last version). attachEvent is the IE equivalent (well, not exactly equivalent). If your target browser is only IE8, you can just replace the addEventListeners with attachEvent calls, but a better option (seeing that you already seem to have jQuery) have be to change these to jQuery .bind (or .on if you have a later version of jQuery)
type: Answer
downvote count: 0
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/29871808
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29871808

http://stackoverflow.com/q/29961793
has body: I searched alot regarding this one... i know how can we disable embeding one's webpage to another website but i couldnot figure out how can we disable the javascript to be emebeded to other website. I mean: for eg: http://mixmax.website/java.js is the javascript. So how can i disable it to be embeded on other website like this: For eg: there is another website: http://otherwebsite.com which is embedding my javascript like this: &lt;script src="http://mixmax.website/java.js"&gt; &lt;/script&gt; Is there a way to disable that otherwebsite to embed my javascript? Any help will be appreciated.
favorite count: 0
answer count: 0
downvote count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/48046593
score: 1
has comment: http://stackoverflow.com/comment/48046513
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/48046665
has title: Is there a way to disable to embed Javascript to use from another website?
upvote count: 1

http://stackoverflow.com/q/29940156
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/29941443
tagged with: css
has answer: http://stackoverflow.com/a/29941443
type: AnsweredQuestion
score: 1
upvote count: 1
has title: Semantic UI and Meteor JS: Validating Form Without Changing Page
type: Question
has answer: http://stackoverflow.com/a/29981062
tagged with: javascript
has body: I have a semantic-ui form: Enter New Category Name ADD CATEGORY I use this form to enter new Categories on my Page. When I click the submit button with a unique name, the forms passes validation and I am able to insert that new category name into my MONGO DB database: var settings = { inline: true, revalidate: true, //on: 'blur', onFailure: function(){ console.log('failed validation'); return false; }, onSuccess:function(e){ console.log("onSuccess"); e.preventDefault; ProductCategories.insert({category_name : editedText}); return false; } }; This is my first time to use Semantic-UI form WITHOUT CHANGING page. This time, I use semantic-ui validation to make sure the category name inputted is UNIQUE (and therefore not yet in the DB) and to make sure it is not EMPTY. If I enter a name that is unique, and click the submit button. It passes the validation. It then calls the onSuccess callback as above and insert the category name into the MONGO DB database and because Meteor is REACTIVE, the page updates itself showing the new Category. My problem is that after calling the onSuccess callback, Semantic-UI seem to validate the form again. This puts me in a situation where the error messages are displayed again when it should not be. I'm stuck in this situation....if I don't do anything and just leave the value of input field as it is when it was clicked, then the validation this time checks the value again against the value in the DB and it invalidates the form because the value is no longer UNIQUE (as it has just been inserted). I have the option to make that input field empty again when onSuccess is called. But if I do that, semantic UI complains that the field is empty and it should not be empty. Ideally, I would like to write something inside the onSuccess callback to tell semantic-ui that it has done its job of validating that is why it has reached on onSuccess and PLEASE DON'T REVALIDATE as it will show the error messages that I don't want displayed..... I've tried p…
has answer: http://stackoverflow.com/a/29990161
answer count: 3
downvote count: 0
tagged with: meteor
accepted answer: http://stackoverflow.com/a/29981062
favorite count: 0
tagged with: semantic-ui

http://stackoverflow.com/comment/47959515
comment on: http://stackoverflow.com/q/29905247
score: 0
type: Comment
type: QuestionComment
has text: Please could you tell me how? They only have access to the code in the eval().

http://stackoverflow.com/a/34613339
upvote count: 7
downvote count: 1
answers question: http://stackoverflow.com/q/29963634
score: 6
type: Answer
has body: This is a bit late but I know it will help someone: If you are using datetimepicker make sure you include the right CSS and JS files. datetimepicker uses(Take note of their names); https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.17.37/css/bootstrap-datetimepicker.css and https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.17.37/js/bootstrap-datetimepicker.min.js On the above question asked by @mindfreak,The main problem is due to the imported files.

http://stackoverflow.com/comment/47877252
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29876454
score: 0
has text: I have only one directive. Nothing else in the JS file.

http://stackoverflow.com/comment/47990828
has text: is your code not working? if you want it to alert `pause` first, you need to swap your code in the `if`/`else`. Is this in a `$(document).ready(function(){` or `$(function(){`?
comment on: http://stackoverflow.com/q/29934359
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/a/29855976
has body: Try this: for (var x = 0; x &lt; tables.length; x++) { var item = $database[tables[x]]; console.log(item); } If your $database is dynamic and you don't want to have a hard-coded array of table names, you can also use Object.keys(): var tables = Object.keys($database);
has comment: http://stackoverflow.com/comment/47838027
answers question: http://stackoverflow.com/q/29855953
type: Answer
upvote count: 6
score: 6
accepted answer of: http://stackoverflow.com/q/29855953
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/48003155
type: Comment
type: QuestionComment
has text: what version of IE are you testing with? are you aware old versions of IE (<9) doesn't have console.log. and putting the rest of your form might help to see if there is any element-id related issues
comment on: http://stackoverflow.com/q/29941156
score: 0

http://stackoverflow.com/a/29979513
has body: Use javascript and Replace $(document).ready(function() { $('#UStoUK').click(function() { var url = 'mydomain.com/us/category/item/' url = url.replace('/us','/uk') window.location.href = url; }); });
score: 0
type: Answer
answers question: http://stackoverflow.com/q/29979466

http://stackoverflow.com/comment/47910952
score: 1
comment on: http://stackoverflow.com/q/29893781
type: Comment
type: QuestionComment
has text: Then you should have been explicit about the real question.

jquery-animate
tags question: http://stackoverflow.com/q/29943539
tag name: jquery-animate
tags question: http://stackoverflow.com/q/29856087
tags question: http://stackoverflow.com/q/29947547
tags question: http://stackoverflow.com/q/29993749
tags question: http://stackoverflow.com/q/29915937
type: Tag

http://stackoverflow.com/q/29966603
has comment: http://stackoverflow.com/comment/48053731
tagged with: css
answer count: 0
tagged with: angularjs
tagged with: twitter-bootstrap
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/48053499
has title: UI Angular Bootstrap modal template inserted inside modal-content
type: Question
has comment: http://stackoverflow.com/comment/48054427
has body: I use UI Angular Bootstrap modal dialog and I open it this way: $modal.open({ templateUrl: 'angular/loanscenario/modal.html', backdrop: 'static', dialogFade: false, keyboard: false }); And I have tamplate looking like this: My template. Why is this template completely inserted inside Bootstrap modal-content tags. How can you change that behavior? I want to write those tags myself and some custom css classes to them.
tagged with: javascript
tagged with: angular-ui-bootstrap
has comment: http://stackoverflow.com/comment/48053455
score: 0

http://stackoverflow.com/q/29932864
has answer: http://stackoverflow.com/a/29932900
has answer: http://stackoverflow.com/a/29932902
type: Question
tagged with: javascript
tagged with: show-hide
score: 0
answer count: 3
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29932877
has body: Hey guys I have searched for many answers and none of them seem to be working so I am going to put my code here and hopefully you can help me figure this out. I am going to have two buttons. The first button (show_Chappie) is going to show the hidden contents and another button (hide_Chappie) and hides it self when clicked. The second button (hide_chappie) is going to hide the contents and bring back the first button (show_chappie). The hide_chappie button itself would also be hidden. The information div is already hidden from the start. I did this on the CSS using the display:none; Here's my HTML code so far: Show More Info here. Show Less Here's my JavaScript code so far: function showInfo(){ document.getElementById('chappie_info').style.display = "inline-block"; document.getElementById('show_chappie').style.display = "none"; document.getElementById('hide_chappie').style.display = "inline-block"; } I haven't written the code for the hide_chappie button because I wanted to see this working first. So where have I gone wrong here? Thanks for the help in advance.
has title: Show/Hide onClick button not working
type: UnansweredQuestion
tagged with: css

http://stackoverflow.com/a/29856215
has body: This would remove the red circle. .bcolor{cursor: text;background-color: #72A4D2!important;}
score: 0
answers question: http://stackoverflow.com/q/29856126
type: Answer

http://stackoverflow.com/q/29923205
answer count: 1
tagged with: jquery
has title: Slide Toggle will not stay up once clicked?
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29923295
has body: I am making a menu and have ran in to some jQuery issues. I want my toggles to stay up once they have been clicked but instead they are sliding up but then straight back down again. I have managed so far to have one close and another open simultaneously. Any thoughts? Here is the current JS : jQuery(".food-content").hide(); jQuery(".food-content").first().slideToggle(500); jQuery('.food-item').click(function(){ jQuery(".menu-container, .full-menu-container").siblings().find('.food-content').slideUp(); jQuery(this).find('.food-content').slideDown(); }); I have made a JS Fiddle: https://jsfiddle.net/marmaaduke/uyb4Lzuy/
type: Question
tagged with: slidedown
tagged with: slideup
tagged with: slidetoggle
tagged with: javascript
score: 0

http://stackoverflow.com/q/29925370
answer count: 0
tagged with: pixel
type: UnansweredQuestion
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/47973446
type: Question
has title: In Javascript how are pixels in availHeight different to style pixels
tagged with: javascript
has comment: http://stackoverflow.com/comment/47982808
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/47972424
has comment: http://stackoverflow.com/comment/47973100
has body: I want to put four buttons on a page and spread their size to fill the height of the page so I am dividing window.screen.availHeight by 4. When I set the button style height to the result of that division (.style.height = buttonHgt + 'px';) it only fills half the page. On my Galaxy S4 Android the window.screen.availHeight gives me 640. Before I resize the height of my four buttons they are 250px in height (according to their style.height setting) but don't fill the page. Pixels in window.screen.availHeightdon't appear to be the same as pixels in style settings. Is there a way I can get the height of my screen in CSS pixels?!
tagged with: css

http://stackoverflow.com/comment/112666334
comment on: http://stackoverflow.com/q/29885351
type: QuestionComment
has text: how do you get all of that in chrome?
score: 0
type: Comment

http://stackoverflow.com/comment/47824419
comment on: http://stackoverflow.com/q/29849002
has text: I can not use any additional libraries here guys. only angular and jquery is what I have.
type: QuestionComment
type: Comment
score: 1

http://stackoverflow.com/a/29911036
type: Answer
upvote count: 3
score: 3
has body: You can check like this also.. if(($('#test').attr('class')).indexOf("icon$") &lt; 0) { }
downvote count: 0
answers question: http://stackoverflow.com/q/29910895
has comment: http://stackoverflow.com/comment/47945276

http://stackoverflow.com/q/29854321
upvote count: 1
has body: I would like to format mt x axis label via a calling a method as follows: xAxis: { labels: { template: "#= shortLabels(value) #" }, } function shortLabels(value) { var strValue = kendo.toString(value) strValue = strValue + ""; strValue = strValue.substring(1) return strValue; } However I am getting shortLabels is not defined error basically it does not call that method. http://jsfiddle.net/3yhbyy2g/31/
type: AnsweredQuestion
score: 1
accepted answer: http://stackoverflow.com/a/29854606
type: Question
tagged with: highcharts
downvote count: 0
answer count: 1
has title: How to call a function in kendo
tagged with: javascript
tagged with: kendo-ui
linked to: http://stackoverflow.com/q/30144782
has answer: http://stackoverflow.com/a/29854606
favorite count: 0

http://stackoverflow.com/q/29890491
tagged with: c#
has body: I have this function public string getCoordinates(double latitude, double longitude) { int latSeconds = (int)Math.Round(latitude * 3600); int latDegrees = latSeconds / 3600; latSeconds = Math.Abs(latSeconds % 3600); int latMinutes = latSeconds / 60; latSeconds %= 60; int longSeconds = (int)Math.Round(longitude * 3600); int longDegrees = longSeconds / 3600; longSeconds = Math.Abs(longSeconds % 3600); int longMinutes = longSeconds / 60; longSeconds %= 60; string result = string.Format("{0}° {1}' {2}\" {3}, {4}° {5}' {6}\" {7}", Math.Abs(latDegrees), latMinutes, latSeconds, latDegrees &gt;= 0 ? "N" : "S", Math.Abs(longDegrees), longMinutes, longSeconds, latDegrees &gt;= 0 ? "E" : "W"); return result; } it converts from double into string latitude and longitude I need the inversion, that I have this format of string latitude and longitude and I want to convert it to double.
has comment: http://stackoverflow.com/comment/47904936
has comment: http://stackoverflow.com/comment/47904674
tagged with: javascript
has comment: http://stackoverflow.com/comment/47904638
has comment: http://stackoverflow.com/comment/47904509
score: 0
has comment: http://stackoverflow.com/comment/47904445
has title: How to convert string Coordinates longitude and latitude into double
has comment: http://stackoverflow.com/comment/47905127
tagged with: asp.net
answer count: 0
type: UnansweredQuestion
tagged with: gis
has comment: http://stackoverflow.com/comment/47904958
type: Question

http://stackoverflow.com/a/29853645
answers question: http://stackoverflow.com/q/29853531
type: Answer
has comment: http://stackoverflow.com/comment/47833334
score: 0
upvote count: 1
downvote count: 1
has body: Change your function to this function transform(data) { for (var i = 0; i &lt; data.results.collection1.length; i++) { var price = data.results.collection1[i].price; if (Object.prototype.toString.call(price) === '[object Array]'){ data.results.collection1[i].price = price[price.length - 1]; } else { data.results.collection1[i].price = price; } } return data; } Note: Array.isArray is an Ecmascript 5 function and might not be defined in all enviroments.

http://stackoverflow.com/comment/47872146
comment on: http://stackoverflow.com/a/29869843
has text: @wuv1 [Document Object Model](https://developer.mozilla.org/en-US/docs/Glossary/DOM), it is the API you use to access and manipulate elements on the page. If you are interested in more info about how the DOM works and some history on how it came to be, Douglas Crockford's talk [An Inconvenient API - The Theory of the DOM](https://www.youtube.com/watch?feature=player_detailpage&v=Y2Y0U-2qJMs) is quite interesting.
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/comment/48115710
has text: The strings do not affect the calculations at all. I am merely prettifying the output by forming plural unit names and leaving out zero unit counts.
type: Comment
comment on: http://stackoverflow.com/a/29997973
score: 0
type: AnswerComment

http://stackoverflow.com/q/29950343
has comment: http://stackoverflow.com/comment/48021556
has comment: http://stackoverflow.com/comment/48026729
type: Question
has title: kendo UI Uncaught TypeError: e.bind is not a function
tagged with: javascript
tagged with: jquery
tagged with: kendo-ui
score: 0
has body: I am using kendo MVVM and kendo observable extend object to bind data from an Ajax call. In my object I am setting the data to a property in the Ajax call after the Ajax call has succeeded. I can successfully get the data to bind and show up. But, in the console, I get an error that is "Uncaught TypeError: e.bind is not a function". I have looked everywhere to see if anyone has experienced this issue before or might know what might triggers this error, but no luck... Here is some of the javascript code: (function (global) { kendo.data.ObservableObject.extend({ servicePlans : "", getServicePlans: function () { var that = this; $.ajax({ url: 'services-data.json', type: 'get', dataType: 'json', error: function(response){ console.log('error') }, success: function(response){ that.set("servicePlans", response.sPlans); } }); } app.servicesPlansData = { viewModel: new servicesPlansViewModel() }; })(window); $(document).ready(function(){ app.servicesPlansData.viewModel.getServicePlans(); kendo.bind($('.page'), app.servicesPlansData.viewModel); }); And some of the html: &lt;script type="text/x-kendo-tmpl" id="servicePlans-template"&gt; &lt;div class="plan"&gt; &lt;div class="drawer-tab"&gt; &lt;div class="plan-name"&gt; &lt;input type="text" data-bind="value: planName"&gt; &lt;/div&gt; &lt;/div&gt; &lt;/script&gt;
answer count: 0
type: UnansweredQuestion
tagged with: mvvm
has comment: http://stackoverflow.com/comment/48022224
has comment: http://stackoverflow.com/comment/48028422

http://stackoverflow.com/a/29934281
upvote count: 1
type: Answer
has body: You need to return the promise you create at the end of your two functions. function fetch(url) { var deferred = Q.defer(); // ... return deferred.promise; } It seems you are trying to return it from inside the callback. It needs to be returned immediately instead (so that handlers can be added).
answers question: http://stackoverflow.com/q/29934258
downvote count: 0
score: 1

http://stackoverflow.com/comment/47990622
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29909392
score: 0
has text: [Avoid using `document.write`](https://www.youtube.com/watch?feature=player_detailpage&v=Y2Y0U-2qJMs#t=1082s), use `console.log` for debugging instead. Any tutorials that tell you to use `document.write` are over a decade out of date and shouldn't be trusted. You also have a lot of variables that are capitalized. It is valid code, but in JS it has become a [convention](http://javascript.crockford.com/code.html) that only constructor functions be capitalized, other variables should start with lowercase letters.

http://stackoverflow.com/q/29904661
tagged with: javascript
has title: links with ui-sref does not display correct css
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/47932016
has answer: http://stackoverflow.com/a/29904736
has body: I have the following template in angular. For some reason, the css is not making my link the correct hex code. However, if I take out ui-sref="settings" and replace it with href="/settings", it works. Has anyone had this sort of problem before? HTML Account CSS #settings-nav-left a { color: #439FE1; }
tagged with: angularjs
has comment: http://stackoverflow.com/comment/47932074
accepted answer: http://stackoverflow.com/a/29904736
tagged with: css
type: AnsweredQuestion
tagged with: angular-ui-router
has comment: http://stackoverflow.com/comment/47932141
type: Question

http://stackoverflow.com/comment/47902713
type: Comment
comment on: http://stackoverflow.com/a/29889207
score: 0
type: AnswerComment
has text: @RLam I see, but it is not working. Here is jsfiddle... http://jsfiddle.net/2f4e669L/

http://stackoverflow.com/comment/47841936
type: Comment
type: QuestionComment
has text: I was thinking about having 2 buttons and one of them is hidden while the other can be seen, but I just feel it is waste of resources to keep having duplicate buttons. I have yet to examine this callback function...
score: 0
comment on: http://stackoverflow.com/q/29856105

http://stackoverflow.com/a/29968222
has body: Well actually you're confusing names here and to be honest: it doesn't help that you renamed the js files. So let's straighten this out: ScrollMagic main module is usually ScrollMagic.js, in your case I'm guessing scroll.js. This is the main library file of ScrollMagic, which should be loaded before all other ScrollMagic plugins, if using synchronous loading. GSAP is usually TweenMax.js (depending on version), in your case I'm guessing greensock.js. This is the GreenSock Animation Platform, which can provide the TweenMax, TweenLite, TimelineMax and TimelineLite objects (and potentially others). ScrollMagic GSAP Plugin is usually plugins/animation.GSAP.js, in your case I'm guessing gsap.js. This is a ScrollMagic plugin to be able to use GSAP with ScrollMagic. It sort of works like a bridge between them. Now because it works as a bridge the ScrollMagic GSAP Plugin requires both the ScrollMagic library and the GSAP library to be loaded. So the right order to load them is either ScrollMagic GSAP ScrollMagic GSAP Plugin or GSAP ScrollMagic ScrollMagic GSAP Plugin To avoid these kinds of issues I would first and foremost recommend never to rename javascript library files. While it might be okay if you work alone it will get very confusing for others. Secondly if you use synchronous loading don't use JavaScript to load them. Use html tags, which makes their load order much more obvious. What you're doing in your script isn't asynchronous at all, as your script loads one file after the other, not simultaneously. If you want to manage loading in js, use an asynchronous loader, like require.js (as suggested in the error message). With require.js you don't have to care about the order in which you load the files, as that is handled automatically. You can even rename the library files, if you absolutely want to (although I wouldn't recommend it), because coworkers would get a reference in your requirejs config to see what module is in what file.
has comment: http://stackoverflow.com/comment/48063627
has comment: http://stackoverflow.com/comment/48092926
downvote count: 0
score: 6
upvote count: 6
has comment: http://stackoverflow.com/comment/48061444
type: Answer
has comment: http://stackoverflow.com/comment/48092871
has comment: http://stackoverflow.com/comment/48058555
answers question: http://stackoverflow.com/q/29960385

http://stackoverflow.com/q/29890699
has answer: http://stackoverflow.com/a/29893626
has comment: http://stackoverflow.com/comment/47905173
tagged with: javascript
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29890711
has comment: http://stackoverflow.com/comment/47905948
has body: I have a javascript which call a server and get a JSON data which contains some config to enable/disable redirecting to another link. I need to delay the redirection by a few seconds, but it seems that setTimeout() is not getting called in my method. Even if I change redirect() as an anonymous function and pass it in setTimeout it is still not getting called. var xhr = new XMLHttpRequest(); var migrationConfig; xhr.onreadystatechange = function() { function redirect(){ alert("in redirect"); window.top.location=migrationConfig.REDIRECT_LINK; } if (xhr.readyState == 4 && xhr.status==200) { var data = xhr.responseText; migrationConfig = JSON.parse(data); if(migrationConfig.SHOW_REDIRECT_MESSAGE == 'Y'){ if (window.confirm(migrationConfig.REDIRECT_MESSAGE)){ document.body.innerHTML = ''; document.write(" You will now be redirected to the new URL at: "); document.write(" "+ migrationConfig.REDIRECT_LINK +" "); setTimeout(redirect,3000); } } } } xhr.open('GET', '/MyApp/migration-config?APP_NAME=MyApp', true); xhr.send(null);
has comment: http://stackoverflow.com/comment/47905351
has title: settimeout not getting called?
has comment: http://stackoverflow.com/comment/47905317
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/47905636
accepted answer: http://stackoverflow.com/a/29890711
tagged with: settimeout
possible better answer: http://stackoverflow.com/a/29893626
score: 0

http://stackoverflow.com/comment/48038824
type: QuestionComment
has text: have you try to add <%= javascript_include_tag 'consumer/carousels' %> in index.html.erb?
comment on: http://stackoverflow.com/q/29959085
score: 0
type: Comment

http://stackoverflow.com/comment/48068329
type: Comment
has text: Actually i am new on this, if you recoment me a library i can try it
comment on: http://stackoverflow.com/a/29973958
type: AnswerComment
score: 0

http://stackoverflow.com/comment/48039483
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29959386
has text: as requested can you share the html so that we can try out what is happening....

http://stackoverflow.com/a/29935633
has comment: http://stackoverflow.com/comment/48030961
has comment: http://stackoverflow.com/comment/48061062
accepted answer of: http://stackoverflow.com/q/29935506
has comment: http://stackoverflow.com/comment/48004717
has comment: http://stackoverflow.com/comment/48035021
has comment: http://stackoverflow.com/comment/48009112
has body: remove the brackets from 'initApp()' in document.addEventListener("deviceready", initApp, false); EDIT ** The above is just for semantics I think you need to change !SMS to typeof SMS === 'undefined'
has comment: http://stackoverflow.com/comment/48023475
score: 0
has comment: http://stackoverflow.com/comment/48023545
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/48007127
has comment: http://stackoverflow.com/comment/48007135
has comment: http://stackoverflow.com/comment/48034925
type: Answer
answers question: http://stackoverflow.com/q/29935506

http://stackoverflow.com/comment/47986272
comment on: http://stackoverflow.com/q/29931900
score: 0
type: QuestionComment
has text: @FelixKling, Your suggestions worked. Thank you
type: Comment

http://stackoverflow.com/comment/47879192
type: QuestionComment
comment on: http://stackoverflow.com/q/29867314
score: 0
type: Comment
has text: You can print the dom wrapped by jsdom by using something like `console.log(jsdom.serializeDocument(window.document))`.

http://stackoverflow.com/q/29991874
score: 0
possible better answer: http://stackoverflow.com/a/29991939
type: Question
has title: Javascript regex escape
accepted answer: http://stackoverflow.com/a/29992152
answer count: 2
tagged with: javascript
has body: I have a regular expression like this which extract the content between 2 characters and in this case its between 2 #'s (?&lt;=\#)(.*?)(?=\#) and um using it as follows var extract = str.match(/(?&lt;=\#)(.*?)(?=\#)/).pop(); but the regex gives errors since I think I need to escape it. How do I correctly apply escape characters for the above regex?
has answer: http://stackoverflow.com/a/29992152
tagged with: regex
has comment: http://stackoverflow.com/comment/48103194
has answer: http://stackoverflow.com/a/29991939
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/48103149

http://stackoverflow.com/q/29865717
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47856530
has comment: http://stackoverflow.com/comment/47856544
has body: I'm using Jasmine for testing my AngularJS application. I have an Authenticaiton controller, which calls a function which I define in the scope from the Application controller. So: 1. AppController $scope.setUser = function() {} 2. AuthenticationController $scope.setUser(User); I am testing the AuthenticationController, and setUser() is not inside the scope of AuthenticationController. How do I inject the scope/function from the AppController? The error message: TypeError: $scope.setUser is not a function Should I mock the whole function? Is the structure smelly? What's the best way to do this? EDIT: In the real app, AuthenticationController gets injected into my dashboard-app. AuthenticationController: angular .module( 'authentication', []) .controller('AuthenticationController', AuthenticationController); AuthenticationController.$inject = ['$scope', '$rootScope', 'AUTH_EVENTS', 'AuthenticationService']; Dashboard: angular .module('dashboard', [ 'authentication' ]) .run(run); Info: Names are changed in my question to make it easier to understand.
type: Question
has comment: http://stackoverflow.com/comment/47856398
has answer: http://stackoverflow.com/a/29867195
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/47856448
answer count: 1
has title: How to test function in $scope from different controller?
tagged with: jasmine

http://stackoverflow.com/a/29859241
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/29858840
score: 3
accepted answer of: http://stackoverflow.com/q/29858840
upvote count: 3
type: AcceptedAnswer
has body: Yes this is possible. You have to send a message from the iFrame, when parent receives the message, then you do something. Here is an example: http://jsbin.com/necuvi/2/. Here is some documentation on how it works. https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage

http://stackoverflow.com/a/29910526
has body: Tthough I really have no idea why would you like to do this. This one works for me or Another way Another more generic approach
downvote count: 0
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/29910137
type: Answer

http://stackoverflow.com/comment/47915397
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/29896414
type: Comment
has text: you need to include the jQuery library into your HTML. Bootstrap javascript library depends on it afaik and you're using it in your script.. `$('DomElement')`

http://stackoverflow.com/comment/47995705
has text: @JamesWong, I will try to update it to 4.0 and tell you about the result. Thanks.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29918859

http://stackoverflow.com/comment/48049415
comment on: http://stackoverflow.com/q/29964588
type: Comment
type: QuestionComment
score: 2
has text: It should be `.style.display = "block";` not `visble`

http://stackoverflow.com/q/29942491
has body: I want to test a Javascript function with Jasmine that has a structure like this: showEditUser: function (...) { // more code here... var editUserView = new EditUserView(); // more code here... editUserView.generate(...); } editUserView.generate() causes an error. That does not matter because I don't want to test it. But how can I prevent it from being called? EditUserView is a RequireJS Module that extends another Module called BaseView. The function generate() is defined in BaseView. There are other Modules that extend BaseView and I want all of them not to call generate while testing. How can I do that with Jasmine? It seems not to be possible with spyOn(...).and.callFake() because I don't have the editUserView Object when calling the function. Is there kind of a static way to tell Jasmine to callFake() the function generate in BaseView?
answer count: 1
tagged with: jasmine
has comment: http://stackoverflow.com/comment/48006994
accepted answer: http://stackoverflow.com/a/29946418
upvote count: 2
tagged with: requirejs
has comment: http://stackoverflow.com/comment/48008603
has title: Javascript Jasmine Testing: Prevent tested function to call function from object that was created within tested function
score: 2
type: AnsweredQuestion
type: Question
tagged with: testing
has answer: http://stackoverflow.com/a/29946418
tagged with: spy
downvote count: 0
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/48009137
linked to: http://stackoverflow.com/q/29745532

http://stackoverflow.com/q/29984806
type: UnansweredQuestion
score: 0
tagged with: scroll
has comment: http://stackoverflow.com/comment/48089073
has comment: http://stackoverflow.com/comment/48090456
tagged with: dom
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/48088948
has comment: http://stackoverflow.com/comment/48089454
tagged with: http://stackoverflow.com/tag/html
has body: I have an html notification view with a scrollbar. Each notification of the list reacts to onmouseover to display a little toolbar. When the user scrolls, the scrolling experience is not smooth due to these onmouseover events that are fired during the scrolling. How can I make the scroll smoother? Should I try to deactivate the onmouseover when user is scrolling? What is the best way to do it?
has title: onmouseover events and smooth scrolling
answer count: 0

http://stackoverflow.com/comment/47950172
comment on: http://stackoverflow.com/a/29914028
type: Comment
has text: what is the wise plan for redirecting to city specific pages/servers?
type: AnswerComment
score: 0

http://stackoverflow.com/q/29981895
has body: I was in an interview and I got all the questions right except for this one. The first question leading up to it was how do you write a function for mod(3,9) so that it returns 0. Ok, easy: function mod(a,b){ return b%a; } After that was how do you write the function mod(3)(9) so that it returns 0? I was stumped...
has comment: http://stackoverflow.com/comment/48083205
answer count: 3
has answer: http://stackoverflow.com/a/29981947
has comment: http://stackoverflow.com/comment/48083230
has comment: http://stackoverflow.com/comment/48083216
favorite count: 0
accepted answer: http://stackoverflow.com/a/29981930
downvote count: 2
linked to: http://stackoverflow.com/q/2272902
upvote count: 13
type: AnsweredQuestion
has title: How can I write a function for mod(3)(9)?
duplicate of: http://stackoverflow.com/q/2272902
has comment: http://stackoverflow.com/comment/48083796
has comment: http://stackoverflow.com/comment/48083231
score: 11
type: Question
has answer: http://stackoverflow.com/a/29981936
has answer: http://stackoverflow.com/a/29981930
has comment: http://stackoverflow.com/comment/48083338
has comment: http://stackoverflow.com/comment/48083234
tagged with: javascript
possible better answer: http://stackoverflow.com/a/29981936
has comment: http://stackoverflow.com/comment/48083221

http://stackoverflow.com/comment/47937162
comment on: http://stackoverflow.com/q/29907295
score: 0
type: Comment
type: QuestionComment
has text: Actually it is in the onrender function where I am making these changes. I am making it from scratch though so all I have at the moment is exactly what I have written above. Do I need to set those values at the scope of the onrender function?

http://stackoverflow.com/comment/75439037
has text: There is a proposed solution for this, for which there are already implementations in node.js (via a plugin) and webpack: http://2ality.com/2017/01/import-operator.html
type: QuestionComment
comment on: http://stackoverflow.com/q/29923879
score: 0
type: Comment

http://stackoverflow.com/comment/48100669
has text: This is a good approach. Something else to consider on top of this would be assigning `data` attributes in the element with the onClick assigned. For example: ` .. `, then `$('.row-class').click(function(e) { var rowId=$(this).data('rowId'); });`
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29990552
type: AnswerComment

http://stackoverflow.com/comment/47868493
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29871765
has text: production is a whole other story and depends on what kind of strategies you use for new releases. typically I don't see people using a restart for new code, rather they do a new deploy.

http://stackoverflow.com/comment/47818134
has text: use jQuery `slideToggle()` instead of all this js stuff.
comment on: http://stackoverflow.com/q/29846162
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47855797
comment on: http://stackoverflow.com/q/29865271
score: 0
type: Comment
type: QuestionComment
has text: I think you will want `var scopedFuncB = funcA(…);` (and maybe not even call `funcB()` from within `funcA`).

http://stackoverflow.com/q/29902594
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47931121
has answer: http://stackoverflow.com/a/41128349
has answer: http://stackoverflow.com/a/29931260
tagged with: camera
type: Question
answer count: 2
has title: Elevated camera look at point
has body: I'm rotating a sphere around the z-axis and want an elevated camera to look down at this sphere. Unfortunately the camera is 'unstable' and making me seasick. How do I prevent this wave motion in the camera? The code to move and look at the sphere is in the animate method of this JS Fiddle. function animate() { requestAnimationFrame(animate); var timer = Date.now() * 0.0009; sphere.position.x = Math.sin(timer) * 3000; sphere.position.y = Math.cos(timer) * 3000; camera.lookAt(sphere.position); render(); }
tagged with: 3d
has comment: http://stackoverflow.com/comment/47952901
tagged with: javascript
score: 0
tagged with: three.js

http://stackoverflow.com/q/29856768
tagged with: javascript
answer count: 1
downvote count: 0
score: 1
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/47872269
has answer: http://stackoverflow.com/a/29857105
has body: I am working on invoice generation program in php. In it I am using datetimepicker to use the invoice generation date and due date. Now I want due date field to be auto-filled by adding a specific value to the invoice generation date feild. Following is my html : 10 20 30 40 50 50 Invoice Date Due Date And my script is as follow : $( "#due_date" ).click(function() { var invoice_date = $("#invoice_date").val(); var invoice_duration = $("#invoice_duration").val(); var splited_invoice_date = invoice_date.split("/"); var day = splited_invoice_date[0]; var month = splited_invoice_date[1]; var year = splited_invoice_date[2]; var total_days = (+year_days) + (+month_days) + (+days); alert('day :' +day+ 'Month :' +month+ 'Year :' +year); }); Using this I am successfully getting the alert giving me segregated date. Now is there an easy of adding the value from the "select" field and adding it to the invoice_generation_date to finally get something to put in the due_date field. Basically I want a date addition formula. Sorry if I am ambiguous. Thanks in advance.
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: php
has comment: http://stackoverflow.com/comment/47839775
has title: Date addition formula javascript
upvote count: 1
type: Question

http://stackoverflow.com/a/29915507
has comment: http://stackoverflow.com/comment/47959491
accepted answer of: http://stackoverflow.com/q/29913207
type: AcceptedAnswer
score: 0
has comment: http://stackoverflow.com/comment/47995185
type: Answer
has body: My guess is that this piece of code is causing the problem: // I do not see $annee being used before this, so it might be always NULL here if($annee == NULL){ $annee='2015'; // I also do not see $annee being used again after this. If we set it to '2015' where is it used again? }else{ $dayL-&gt;setDate(intval($annee), intval($dateL[1]), intval($dateL[2])); $dayF-&gt;setDate(intval($annee), intval($dateF[1]), intval($dateF[2])); // Why are you setting the dates again here, if you just set them above? } Could you please clarify this code?
has comment: http://stackoverflow.com/comment/47994604
has comment: http://stackoverflow.com/comment/47997014
answers question: http://stackoverflow.com/q/29913207

http://stackoverflow.com/comment/47969155
comment on: http://stackoverflow.com/a/29923507
has text: @AbhishekMahapatra. First remove `$.parseJSON()` line from your code. Then use `console.log(JSON.stringify(variable))` and tell us what you see. Because if your `obj` looks like `[{"userId":"dfeterter"}]`, then this solution shud work. Also print `console.log(variable[0].userId)`
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/29900030
score: 1
answers question: http://stackoverflow.com/q/29899844
downvote count: 0
has body: you must to loop on your elments to check them here is my code to do that $(document).ready(function(){ $(".event").each(function(){ if(($(this).children().length)<3) { $(this).hide(); } }); }) 1 1 1 1 1 1 1 1 1 1 1
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/47922760

http://stackoverflow.com/a/29907484
has body: If you're not using the api (Which isn't advisable), you could just put the page into a string, and extract the long/lat from within ... It's given multiple times on the page as the parameter ll ... I'm not very good with regex, so I'll give an example using strstr &lt;?php $url='https://www.google.com/maps/place/Space+Needle/@47.620506,-122.349277,17z/data=!4m6!1m3!3m2!1s0x5490151f4ed5b7f9:0xdb2ba8689ed0920d!2sSpace+Needle!3m1!1s0x5490151f4ed5b7f9:0xdb2ba8689ed0920d'; $result=file_get_contents($url); $ll=explode(',',substr(strstr(strstr($result,'?ll='),'&amp;',true),4)); $long=$ll[0]; $lat=$ll[1]; ?&gt;
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29907130
answers question: http://stackoverflow.com/q/29907130
upvote count: 2
type: Answer
score: 1
downvote count: 1

http://stackoverflow.com/q/29915897
has body: I'm trying to create a slideshow that is opened in a new window when the user presses a button. It uses two arrays with the values of the url:s and the texts associated with the images. With the current code, I only get the last value of the imageText array pushed into the variable textList. How can I get the text-attributes inside the input-tags inserted into my textList array? I only want the values of the images that have the associated checkbox checked. The html: (there are multiple divs like this, with different images and texts) Text: The javascript: function slideShow() { var imageCreatiText = []; var pictureTexts = []; for (i=0; i< outerDiv.length; i++) { imageText = textTag.getElementsByTagName("input")[0]; } pictureTexts = imageText.getAttribute("value"); textList.push(pictureTexts); newWindow(400, 500 , "images.htm", imgList, textList); } The variable textTag is declared like this in another function: textTag = this.getElementsByClassName("innerDiv")[0];
has title: Creating arrays containing text attributes from input elements
has comment: http://stackoverflow.com/comment/47953372
type: Question
has comment: http://stackoverflow.com/comment/47953610
tagged with: javascript
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/47953643
has comment: http://stackoverflow.com/comment/47953503
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29916176

http://stackoverflow.com/comment/47997661
type: QuestionComment
score: 0
has text: @jcubic: How do i unisolate? I thought i would be to able to use the external scope because of the restrict property on the directive. Could you update the plunk?
comment on: http://stackoverflow.com/q/29937919
type: Comment

http://stackoverflow.com/a/29884938
type: Answer
answers question: http://stackoverflow.com/q/29882452
has comment: http://stackoverflow.com/comment/47919264
has body: Is there a simpler way? That looks a little complex to me. I was looking for something like this: http://jsfiddle.net/Gajotres/8uac7/ but using my code above. Thanks [1]: http://jsfiddle.net/Gajotres/8uac7/
score: 0

http://stackoverflow.com/comment/47914575
has text: Uh, not using jQuery would be one benefit.
score: 1
comment on: http://stackoverflow.com/q/29885393
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29983502
score: 1
upvote count: 1
has body: Your promises array is empty, that's why $q.all is executed before your other requests. In order to work, you need to fill in the promises array with your requests as following: promises.push($http.post(urlDistinte, "", configDistinta).then (function(response) {...})); promises.push($http.post(urlDistinteIngredienti, "", configDistintaIngrediente)...); And then $q.all will execute after all requests return success.
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/29913963

http://stackoverflow.com/q/29946401
tagged with: google-chrome
has answer: http://stackoverflow.com/a/66789971
answer count: 4
has answer: http://stackoverflow.com/a/29947496
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/76569840
has body: I'm looking at the documentation page and I can't figure out whats wrong in my code: chrome.browserAction.setIcon({ details.imageData = { "48": "Icons/iconfavorite48x.png", "64": "Icons/iconfavorite64x.png", "128": "Icons/iconfavorite128x.png" } }); the documentaion says : Note that 'details.imageData = foo' is equivalent to 'details.imageData = {'19': foo}' so I'm extremely confused
downvote count: 0
tagged with: javascript
favorite count: 0
type: Question
score: 14
tagged with: google-chrome-extension
accepted answer: http://stackoverflow.com/a/29947496
has title: why is this chrome.browserAction.setIcon method not working?
upvote count: 14
has answer: http://stackoverflow.com/a/73582333
possible better answer: http://stackoverflow.com/a/66789971

http://stackoverflow.com/comment/47863792
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29869268
has text: Maybe it doesn't hit it on the first iteration, could be `xmlValues[71][0]` depending on how many `zadanie` elements there are. Anyway, [$.each](http://api.jquery.com/each/) can give you the `index` of each element so there is no need to keep incrementing your own `i` variable
score: 0

http://stackoverflow.com/comment/48129257
type: AnswerComment
score: 0
has text: I just tested by making a brand new Suitelet then copying and pasting your exact code into it. I get Hello, World as expected.
type: Comment
comment on: http://stackoverflow.com/a/29949543

http://stackoverflow.com/comment/47939436
has text: @NietzscheProgrammer What is the function that removes a single line from the `slip`? It seems like you have posted the code that removes a whole slip, rather than the one that removes a single line (the one that gets called when you click the single `x` on the right hand side in the video). Is that correct?
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29907876

http://stackoverflow.com/q/29952248
type: Question
has comment: http://stackoverflow.com/comment/48026053
tagged with: javascript
has answer: http://stackoverflow.com/a/29952915
has comment: http://stackoverflow.com/comment/48025446
has title: How can I create a "game over" image zoom into the screen using HTML & Javascript?
has body: I am currently developing a HTML game for one of my programming classes and I want to add a "game over" screen that will display an image and information on their score before dying. What I would like to happen is for the image to overlay the body of the page and start small in the middle of the screen and "expand" or zoom into the screen to a specific size. I'm not sure if that's clear but here is what I'm sort of looking for: But I would like it to zoom in rather than just appear. Any links or help would be greatly appreciated because I don't even know what to search on google to get information on this! Thanks in advance for any help!
favorite count: 0
has comment: http://stackoverflow.com/comment/48026817
has answer: http://stackoverflow.com/a/29952783
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/48027038
tagged with: css
answer count: 4
score: 2
has answer: http://stackoverflow.com/a/29953007
upvote count: 3
has answer: http://stackoverflow.com/a/29953187
downvote count: 1

http://stackoverflow.com/comment/48136114
score: 0
type: Comment
type: QuestionComment
has text: I don't know php. but lets continue this on monday. have a great weekend.
comment on: http://stackoverflow.com/q/29992561

http://stackoverflow.com/q/29947680
has body: I'm trying to wrap the plugin Justified Gallery in an Ember component. The main problem that I'm facing is that the list of photos in the gallery come from an API, so they're part of the model. What I have so far: App.JustifiedGalleryComponent = Ember.Component.extend({ _init: function() { this.$().justifiedGallery({ rowHeight: 150, fixedHeight: false, margins: 7 }); }.on('didInsertElement') }); Template {{#each photo in items}} &lt;div&gt; &lt;img src={{photo.thumbUrl}} /&gt; &lt;/div&gt; {{/each}} But I can't get that to work, probably because the list of photo is inside an each loop, and when the plugin is applied the photos are still not in the DOM? What would be the approach for this problem? Thanks! EDIT: Taking as a reference the component for Masonry I've got this almost sorted, but the first time that I navigate to the URL nothing shows, if I go to a second route (inside the ember app) and go back to the gallery then it displays fine and justified. This is my component now: import Ember from 'ember'; var getOptions = function (keys) { var properties = this.getProperties(keys); Object.keys(properties).forEach(function (key) { if (properties[key] === "null") { properties[key] = null; } if (properties[key] === undefined) { delete properties[key]; } }); return properties; }; export default Ember.Component.extend({ classNames: ['justified-grid'], options: null, items: null, setup: Ember.on('didInsertElement', function() { this.set('options', getOptions.call(this, [ 'rowHeight', 'fixedHeight', 'margins' ])); this.justifyGrid(); }), justifyGrid: Ember.observer('items.@each', function() { var _this = this; imagesLoaded(this.$(), function() { _this.$().justifiedGallery(_this.get('options')); _this.set('gridInitialized', true); }); }) });
type: Question
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29951865
has title: How can I wrap jQuery Justified Gallery in an Ember Component?
downvote count: 0
answer count: 1
score: 1
favorite count: 0
tagged with: ember.js
upvote count: 1
accepted answer: http://stackoverflow.com/a/29951865
type: AnsweredQuestion

http://stackoverflow.com/comment/47915308
has text: @LittlePanda I'm not sure what you mean by a headless test.. i am aiming simply write a series of stand alone tests that run after the other on a local machine. Each test looks similar to the one above but performing different tasks.
type: QuestionComment
comment on: http://stackoverflow.com/q/29894519
type: Comment
score: 0

http://stackoverflow.com/comment/48008416
comment on: http://stackoverflow.com/a/29930557
type: AnswerComment
score: 0
type: Comment
has text: This doesn't work. This prints the html into the email instead of formatting it. I did finally figure this out this morning. `htmlbody` should have been `htmlBody`. I knew it was something stupid I was overlooking. However, thanks for getting me to look harder at this section of my code.

http://stackoverflow.com/comment/47837158
has text: Oh yes, with the first option you would also want to call the render function in the loader callback function.
type: Comment
comment on: http://stackoverflow.com/a/29849443
score: 0
type: AnswerComment

http://stackoverflow.com/comment/47985649
has text: @Xan I just do not know which AJAX code to add.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29931548

http://stackoverflow.com/comment/48595685
comment on: http://stackoverflow.com/a/29977708
score: 0
type: Comment
has text: No it didn't I am using a work around currently. I will post an update soon.
type: AnswerComment

http://stackoverflow.com/comment/48000738
score: 0
type: AnswerComment
type: Comment
has text: Pls i am new to ajax, so I need more explanation/assistance. The line(2) is showing error. ie var. Also, the url which is the php script that will fetch total stock from database. How will I be able to determine the product. e.g $val = "SELECT qty FROM stock WHERE prod_name='".GET['prod_name']."'; $conf = mysqli_query($con,$val); $fetchVal = mysqli_fetch_array($conf); $stock = $fetchVal['prod_name']; pls, check am I on course or how is there a way to do it better. Also, note that this will mean I have to make the user click, but I don't think that is a good idea. pls help.
comment on: http://stackoverflow.com/a/29937951

http://stackoverflow.com/a/30002738
score: 0
answers question: http://stackoverflow.com/q/30001197
has body: use the following plugin as it allows all kind of data as native jquery request in your submitHandler place the ajaxSubmit() http://malsup.com/jquery/form/
type: Answer

http://stackoverflow.com/q/29992742
type: Question
answer count: 2
possible better answer: http://stackoverflow.com/a/29992923
tagged with: javascript
has title: In Javascript how do I iterate the results of getElementsByClassName() and modify display attribute
favorite count: 0
score: 0
has body: How do I iterate the results of getElementsByClassName() This is what I had: function togglePotentialMatchesLinks() { alert("fred"); var els = document.getElementsByClassName("releasegroupingpotential"); var e; for(e in els) { e.style.display = e.style.display=="none" ?"table-row-group" :"none"; } return true; } I have since read its not actually an array but a NodeList or a HtmlCollection, but that has left me none the wiser how to modify the function so that it works. Update Now working based on Trandences answer function togglePotentialMatchesLinks() { var els = document.getElementsByClassName("releasegroupingpotential"); var e; for (var i = 0; i &lt; els.length; ++i) { e = els[i]; e.style.display = e.style.display=="none" ?"table-row-group" :"none"; } return true; }
has comment: http://stackoverflow.com/comment/48105001
accepted answer: http://stackoverflow.com/a/29992770
has answer: http://stackoverflow.com/a/29992923
upvote count: 1
has answer: http://stackoverflow.com/a/29992770
type: AnsweredQuestion
downvote count: 1

http://stackoverflow.com/a/29997466
type: Answer
answers question: http://stackoverflow.com/q/29997408
score: 0
has body: If I were you the first step I'd take is to add a class to all the elements that you want to use to trigger this function(the things you click on). You can remove the onClick from them. Give them all class "ajaxLink" or whatever you prefer. Also give them an id, the number of the tab. For example: &lt;div class="ajaxLink" id="2"&gt;&lt;/div&gt; $('.ajaxLink').click(function(event){ ajaxLink(event.target.id); }); function ajaxLink(id){ var age = $("#age").val(); $.get("&lt;?php echo _SITE_ADDRESS; ?&gt;/linktab/"+id, {"age":age},function(r){ }); } From what I understand from your question, if your previous code works this should too. If not let me know what error you are getting.

http://stackoverflow.com/a/29942662
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29942602
type: Answer
has body: You forgot to inject the data in the array notation: myApp.controller('myController', [ '$scope', 'randomData', // &lt;-- this one function ($scope, randomData) { console.log("randomData:" + randomData); } ])
upvote count: 2
answers question: http://stackoverflow.com/q/29942602
score: 2
has comment: http://stackoverflow.com/comment/48006152

http://stackoverflow.com/comment/48010278
type: AnswerComment
comment on: http://stackoverflow.com/a/29944617
has text: but if i use it directly then it works.
type: Comment
score: 0

http://stackoverflow.com/comment/47862999
score: 0
comment on: http://stackoverflow.com/q/29851298
type: QuestionComment
type: Comment
has text: Thanks to the solutions so far I am reading and exploring them further and hope to get a working solution.

http://stackoverflow.com/comment/48020078
score: 0
has text: When trying second method,getting error `Error: $scope.actions.data.push is not a function`
type: Comment
comment on: http://stackoverflow.com/a/29948773
type: AnswerComment

http://stackoverflow.com/a/29846826
answers question: http://stackoverflow.com/q/29846702
upvote count: 3
score: 3
downvote count: 0
type: Answer
has body: use Math.max.apply() method to get max value from a numeric array. var arr = $('li[data-target]').map(function(){ return $(this).data('target') }); console.log(Math.max.apply(Math,arr)); Fiddle Demo

http://stackoverflow.com/comment/48011288
type: Comment
has text: @A.Wolff, I am not saying that it isn't a solution for me. It will solve the problem. I would personally prefer to not require a css file for 4 lines of css is all. I could always use jQuery to inject a `style` tag into the head of the document.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29944785

http://stackoverflow.com/comment/48040865
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29960135
has text: Without seeing more of your code it's hard to know for sure, but it would appear either the context of `this` inside the callback function is not `main` or you need to run `$scope.$apply();` at the end of the function.
score: 0

http://stackoverflow.com/comment/47850429
type: AnswerComment
has text: That's great to see ;) Enjoy angular and underscore ;)
type: Comment
comment on: http://stackoverflow.com/a/29862409
score: 0

sonarqube
tags question: http://stackoverflow.com/q/29965108
tags question: http://stackoverflow.com/q/29929641
type: Tag
tags question: http://stackoverflow.com/q/29937532
tag name: sonarqube

sequelize.js
type: Tag
tags question: http://stackoverflow.com/q/29866133
tags question: http://stackoverflow.com/q/29977855
tag name: sequelize.js

http://stackoverflow.com/comment/47862770
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29868778
has text: Thanks for the suggestion. Can you please elaborate on why specifically using a jquery click event listener is a bad idea in this case? Also, is this related with why the paging is generating incorrectly?

http://stackoverflow.com/comment/47969995
comment on: http://stackoverflow.com/q/29923661
type: Comment
type: QuestionComment
score: 0
has text: Also post the html so we can see the document.searchCridResults.psn structure.

http://stackoverflow.com/q/29989987
has answer: http://stackoverflow.com/a/29990272
type: Question
tagged with: http://stackoverflow.com/tag/html
upvote count: 2
answer count: 2
has answer: http://stackoverflow.com/a/29990418
has title: change textbox value by previous checkbox
tagged with: checkbox
type: UnansweredQuestion
has body: Actually the text box should be depend on previous checkbox. I mean If the checbox 1 is on green the text box1 value is 0 if chbok1 is white txbox1 is 1. it is also same as other checkbox. Basically the textbox should depend the previous check box. I have tried this way but not working $(this).parents().siblings('.value').val(1); Thanks in advance!
score: 2
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0

http://stackoverflow.com/q/29849331
type: AnsweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/47824680
answer count: 1
has comment: http://stackoverflow.com/comment/47824743
tagged with: javascript
score: 0
has body: I looked through other answers and questions and I just cannot find a solution. I'm trying to make a simple fraction calculator for debugging and testing my JavaScript skills (since I've been doing nothing but Python and re-sharpening skills) and I seem to have run into an issue. It's simple, a user puts in a number in an , and for a , then once more to complete 2 fractions. Then there is 4 buttons; * , / , + , and - . I also have a debug . When it is clicked, an document.getElementById("*button*").addEventListener("click", function() { debug() })} function is fired, and should console.log(document.getElementById("*button*").innerHTML), but I get undefined. In Short Why is it returning undefined, and how can I print the current value in an field? My Code HTML debug * / + - CSS html, body { background: #96C9FF } #wrap { background: #96C9FF; margin-top: 100px; } #fraction_calc { background: #6BB3FF; text-align: center; margin: auto; height: 360px; width: 750px; } .container { background: #2E93FF; border-radius: 10px; min-width: 625px; min-height: 225px; padding-top: 25px; margin: auto; margin-top: 50px; display: inline-block; } .num_11 { width: 50px; background: #000000; color: #FFFFFF; margin-left: auto; margin-right: auto; text-align: center; } .num_12 { width: 50px; background: #000000; color: #FFFFFF; text-align: center; } .num_2 { width: 50px; background: #000000; color: #FFFFFF; text-align: center; } .den_11 { width: 50px; background: #000000; color: #FFFFFF; text-align: center; } .den_12 { width: 50px; background: #000000; color: #FFFFFF; text-align: center; } .den_2 { width: 50px; background: #000000; color: #FFFFFF; text-align: center; } JavaScript ///just makes the input only accept numbers function isNumberKey(evt) { var charCode = (evt.which) ? evt.which : event.keyCode if (charCode > 31 && (charCode < 48 || charCode > 57)) return false; return true; } /*function calc() { document.getElementById("multiply").addEventListener("click", function() { var multip…
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29849719
has title: JavaScript Print input innerHTML returns undefined?
accepted answer: http://stackoverflow.com/a/29849719

replace
tags question: http://stackoverflow.com/q/29938657
tags question: http://stackoverflow.com/q/29947734
tags question: http://stackoverflow.com/q/29953271
tags question: http://stackoverflow.com/q/29901111
type: Tag
tags question: http://stackoverflow.com/q/29992034
tags question: http://stackoverflow.com/q/29963145
tag name: replace
tags question: http://stackoverflow.com/q/29945331

http://stackoverflow.com/q/29968816
tagged with: serialization
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29971574
has body: I'm getting an error: Uncaught InvalidStateError: Failed to read the 'selectionDirection' property from 'HTMLInputElement': The input element's type ('checkbox') does not support selection. on: &lt;div class="panel-heading paddingRight20px"&gt; &lt;input style="position: absolute;" type="checkbox" data-bind="checked: IsSelectedCoverage" /&gt; &lt;/div&gt; When I am debugging the code, I found that it was giving this error when I am trying to serialize the viewmodel (which has the IsSelectedCoverage observable). Ajax call where I am serializing: self.finish = function () { debugger; var CorrespondenceData = ko.toJSON(self); $.ajax({ url: endPoints.Finish + '/' + self.MemberId(), type: 'POST', dataType: 'json', data: CorrespondenceData, contentType: 'application/json; charset=utf-8', beforeSend: function () { startSpinner(); } }) I am not sure if this is due to serializing the model.
has comment: http://stackoverflow.com/comment/48057498
tagged with: knockout.js
type: Question
has comment: http://stackoverflow.com/comment/48069981
tagged with: javascript
tagged with: jquery
has title: Getting error for checkbox binding in knockout during serialization
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1

http://stackoverflow.com/a/29859331
score: 1
has body: It's this: $("#first-name").click(function(){ mixpanel.track("First Name Input Clicked"); }) Because tack_links is expecting to go to another page. This will just simply track the click.
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/29855551
type: Answer
accepted answer of: http://stackoverflow.com/q/29855551
upvote count: 1

http://stackoverflow.com/q/29870991
favorite count: 0
type: Question
linked to: http://stackoverflow.com/q/23263380
has title: Deprecation warning: moment construction falls back to js Date
has comment: http://stackoverflow.com/comment/65880922
accepted answer: http://stackoverflow.com/a/29871231
possible better answer: http://stackoverflow.com/a/29871040
has answer: http://stackoverflow.com/a/29871040
tagged with: momentjs
upvote count: 2
has body: I am attempting to convert this datetime 150423160509 //this is utc datetime To the following format: 2015-04-24 00:05:09 //local timezone by using the moment.js var moment = require('moment-timezone'); var a = moment.tz('150423160509', "Asia/Taipei"); console.log( a.format("YYYY-MM-DD H:m:s") ); but it gives me this error Deprecation warning: moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release
has answer: http://stackoverflow.com/a/29871231
answer count: 2
type: AnsweredQuestion
score: 2
downvote count: 0
tagged with: javascript

http://stackoverflow.com/q/29910154
possible better answer: http://stackoverflow.com/a/29910236
has answer: http://stackoverflow.com/a/29910236
type: Question
has answer: http://stackoverflow.com/a/29910283
has body: I need to get the contents of all the cells in a row, combine them, and put them into a textarea. I think I need the .each() function, like: $('table tr').each(function() { $(this).find('td').text().appendTo(textarea); // not right }); But I don't know how to combine the contents of each cell into one and then put it into the textarea. Basically, I have a table like this: 1 2 3 4 1 2 3 4 1 2 3 4 And I want it to end up like this: 1,2,3,4 1,2,3,4 1,2,3,4 http://jsfiddle.net/qy1e7to6/33/ I really appreciate any help you can give. Thank you.
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29910269
answer count: 3
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
has title: Merge/combine contents of table cells with jQuery
score: 1
favorite count: 0
accepted answer: http://stackoverflow.com/a/29910269
upvote count: 1
type: AnsweredQuestion

http://stackoverflow.com/a/29999729
score: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29999384
answers question: http://stackoverflow.com/q/29999384
type: Answer
has comment: http://stackoverflow.com/comment/48119862
has body: The markup you posted isn't properly nested, although it might be that's how you posted them. Anyhow a double-check won't hurt. Since the inner table is inside a td after the inner table is closed we need a &lt;/td&gt;&lt;/tr&gt; before the outre table is closed. Secondly you're using $("#report tr:table").show(); which throws unsupported pseudo: table you can instead use: $("#report tr").find("table").closest("tr").show(); jsfiddle ====== EDIT: Modified the code so it only shows the outer .odd rows and expand when clicked: $("#report &gt; tbody &gt; tr:odd").addClass("odd"); $("#report &gt; tbody &gt; tr:not(.odd)").hide(); //$("#report tr").find("table").closest("tr").show(); $("#report").on('click', 'tr.odd', function () { $(this).next("tr").toggle(); $(this).find(".arrow").toggleClass("up"); }); updated jsfiddle

http://stackoverflow.com/a/30013043
upvote count: 2
accepted answer of: http://stackoverflow.com/q/29984518
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 2
has body: First, your question mixes two things. BackboneJS and RequireJS are completely unrelated What you observe (module dependency structure in the scripting panel vs. all those files actually not downloaded) is due to the Debugger support of "Source maps" Since I guess your confusion is caused by this I'll start with ... Source maps Modern browsers support source maps. Their intention is to reveal the original source code when it has been concatenated and/or minified into one file. The source map file describes e.g. the symbol ZZyb at line 1 char 20563 is mapped to e.g. the file/somewhere/in/the/tree at line 34 char 1 and is named someView. Minified files reference the source map using the # sourceMappingURL=getaround-min.js.map signature. More on source maps: http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/ When downloading the minified file (https://www.getaround.com/js/150502002818/getaround-min.js) on that website you've linked, you will observe that signature at the end of the file: //# sourceMappingURL=getaround-min.js.map You can then download that file. This is what your debugger does. RequireJS vs. BackboneJS You can use RequireJS to modularize your own code or in conjunction with other Frameworks that do not already ship with such technologies. AngularJS for example has it's own dependency management which allows you to define named dependencies and finally you start the application. This allows you to just concatenate (and minify) all sources into one file without taking care of the definition order. Even though Backbone and Require are unrelated they work very well together. RequireJS RequireJS implements the so called AMD spec. A module defines dependencies and a callback to implement that module. depA: // Require depB and depC and after they've been loaded // call the callback function and pass those // dependencies. Finally return that module. define(["depB", "depC"], function(depB, depC){ // by convention depB will resolve to depB.js rela…
answers question: http://stackoverflow.com/q/29984518

http://stackoverflow.com/q/29983479
tagged with: this
favorite count: 0
tagged with: angularjs
downvote count: 3
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/48086969
score: -3
upvote count: 0
has comment: http://stackoverflow.com/comment/48086218
has title: I can't understand the scope of named controller in Angularjs and the use of keyword this
has comment: http://stackoverflow.com/comment/48087172
has answer: http://stackoverflow.com/a/29983730
type: Question
has comment: http://stackoverflow.com/comment/48086238
has body: I'm trying to understand the use of named controllers (controller as syntax) in Angular. In my app I have the same controller associated with some different divs. In html page the controllers is always named (myCtrl as C). And inside the controller I used this. The controller has some variables and some methods bound/called within html page. I have some strange behavior that I tried to replicate in this example: var app=angular.module("myApp", []); app.controller("ctrl", function(){ vm=this vm.name="Pippo"; vm.msg=function(){alert(vm.name)} }) app.controller("ctrl2", function(){ this.name="Pippo"; this.msg=function(){alert(this.name)} }) app.controller("ctrl3", function($scope){ $scope.name="Pippo"; $scope.msg=function(){alert($scope.name)} }); http://jsfiddle.net/k66Za/111/ My case is the first one, the one using ctrl1. As you can see, what I expect clicking the first button is not what I get: instead of returning ctrl1 name it returns ctrl2 name. Of course it's my lack, but I don't see the difference between ctrl1 and ctrl2. Could some one please explain to me what's happening in my example and if I should use $scope, this and, most of all, why using vm (where vm=this) is different from using this?
has answer: http://stackoverflow.com/a/29984979
tagged with: javascript
answer count: 2

http://stackoverflow.com/comment/47882408
comment on: http://stackoverflow.com/a/29878730
type: AnswerComment
score: 0
has text: Just edited my question with a better example of what I want :)
type: Comment

http://stackoverflow.com/a/70204121
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/135952864
answers question: http://stackoverflow.com/q/29879582
has body: All credit to @wnbittle and @alexey-altteam for their answer on the github issue#5903. Worked for me with fabricjs 4.2.0. Add this function at the bottom of the fabric.js file: (function(){ var defaultOnTouchStartHandler = fabric.Canvas.prototype._onTouchStart; fabric.util.object.extend(fabric.Canvas.prototype, { _onTouchStart: function(e) { var target = this.findTarget(e); // if allowTouchScrolling is enabled, no object was at the // the touch position and we're not in drawing mode, then // let the event skip the fabricjs canvas and do default // behavior if (this.allowTouchScrolling &amp;&amp; !target &amp;&amp; !this.isDrawingMode) { // returning here should allow the event to propagate and be handled // normally by the browser return; } // otherwise call the default behavior defaultOnTouchStartHandler.call(this, e); } }); })();
downvote count: 0
score: 1

http://stackoverflow.com/a/29966981
type: Answer
has body: Okay guys, I managed to solve everything. Apparently the php function couldn't find my credentials to log in to the database server because I defined them on top of the php file (and since javascript only executed the function, these credentials were undefined). Solution: I just copy-pasted the credentials at the start of each function so these were defined. And tadaah! It worked :). Now I realize why the responseText was full of tables, because it started to return error tables about the connection. I hope my explanation will help other people who have this issue as well. Cheers, and thanks for all the helpfull answers, Mistergrave.
answers question: http://stackoverflow.com/q/29965573
downvote count: 0
score: 1
upvote count: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29965573

http://stackoverflow.com/a/29933310
type: AcceptedAnswer
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/48083597
has body: You can use sendEmail() to send one or more emails via Salesforce. It can be either a SingleEmailMessage or a MassEmailMessage. MassEmailMessage is more useful if you are dealing with a collection of Contacts, Leads or Users. See What's the Advantage of using MassEmailMessage instead of multiple SingleEmailMessage?
score: 1
has comment: http://stackoverflow.com/comment/48083523
upvote count: 1
accepted answer of: http://stackoverflow.com/q/29918200
answers question: http://stackoverflow.com/q/29918200
has comment: http://stackoverflow.com/comment/48086164

http://stackoverflow.com/comment/47849913
comment on: http://stackoverflow.com/a/29862233
has text: Brackets only does what you want when you can fill in multiple elements with the same name. Radio buttons don't work that way, because you can only select one of them.
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/a/29872869
upvote count: 2
has comment: http://stackoverflow.com/comment/47936373
has body: It may not be possible to do this in a single loop. I would be inclined to create an object in a first pass, and then build the data structure in a second. Something like: var obj = oldArray.reduce(function(memo, item) { // Get the unique value you're interested in, e.g. "name1" var key = item[0]; // If you've already got it, push this value on the end if (memo[key]) { memo[key].push(item); } else { // otherwise, create a new array with this single value memo[key] = [ item ]; } // Don't forget to return memo, or you'll have one of those // "bang your head against the wall" moments return memo; }, {}); // create a new array and push all the values on var newArray = []; for (var k in obj) { newArray.push(obj[k]); } // or an alternative way to do the same thing var newArray = Object.keys(obj).reduce(function(memo, k) { memo.push(obj[k]); return memo; }, []);
answers question: http://stackoverflow.com/q/29872731
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/47871261
accepted answer of: http://stackoverflow.com/q/29872731
type: Answer
score: 2

http://stackoverflow.com/comment/47943997
score: 1
type: QuestionComment
type: Comment
has text: http://stackoverflow.com/a/21587316/3894168 answer should help you.
comment on: http://stackoverflow.com/q/29910668

http://stackoverflow.com/comment/48115076
comment on: http://stackoverflow.com/q/29997681
type: Comment
has text: Yikes. Settle down.
type: QuestionComment
score: 6

http://stackoverflow.com/comment/47953893
score: 0
type: Comment
comment on: http://stackoverflow.com/q/29915297
type: QuestionComment
has text: Hi @RobertLongson, I got it working thanks to Ian from google group, thanks anyway! The fiddle working: https://jsfiddle.net/agevu82g/8/

http://stackoverflow.com/comment/47871994
has text: seems like your test is happening before list.js. what if you wrap your tests in `jQuery(document).ready(function ($) {}`
comment on: http://stackoverflow.com/q/29873487
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29879740
type: Answer
score: 3
upvote count: 3
downvote count: 0
has comment: http://stackoverflow.com/comment/47885140
answers question: http://stackoverflow.com/q/29879501
has body: var str = "hello world"; for(var i = 0; i &lt; 3; i++) { str = removeRandomLetter(str); } alert(str); function removeRandomLetter(str) { var pos = Math.floor(Math.random()*str.length); return str.substring(0, pos)+str.substring(pos+1); } If you want to replace 3 random charc with other random chars, you can use 3 times this function: function substitute(str) { var pos = Math.floor(Math.random()*str.length); return str.substring(0, pos) + getRandomLetter() + str.substring(pos+1); } function getRandomLetter() { var letters="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; var pos = Math.floor(Math.random()*letters.length); return letters.charAt(pos); }
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29879501
has comment: http://stackoverflow.com/comment/47885378

http://stackoverflow.com/a/29996830
downvote count: 0
has body: What's going on is that the layers property of the featureCollection property is not an array, it's a JSON encoding of an array. You need to decode it again to process the contents. Assuming json_obj is the full object, you need to do: var layers = JSON.parse(json_obj.featureCollection.layers); Then you can access layers[i].layerDefinition.currentDefinition. I don't know why it's done that way -- you may want to fix the code that creates the JSON in the first place, and remove the part that calls JSON.stringify() when storing into the layers property.
score: 4
has comment: http://stackoverflow.com/comment/48119556
type: Answer
answers question: http://stackoverflow.com/q/29996686
upvote count: 4

http://stackoverflow.com/a/29872841
type: Answer
has body: Okay, now that I understand what you're after better - here you are. First, a caveat: there are arrays for which this is impossible. For instance, any array in which more than half the elements have the same value cannot be shuffled to keep those values away from each other. That said: var insert = function(val,arr) { if (arr.length &gt; 1) { for (var i=1;i&lt;arr.length;i++) { if (arr[i-1] !=val &amp;&amp; arr[i] != val) { arr.splice(i,0,val); return arr; } } } arr.splice(0,0,val); return arr; } var shuffle = function(arr) { return arr.reduce(function(p,c,i,a) { return insert(c,p); }, []); } shuffle() returns a new array built by shuffling the values of the input array; if you'd rather have them shuffled 'in place' by mutating the input array, that's easy enough to do. There may exist theoretically-shuffleable arrays which this algorithm fails for. I haven't found any in brief testing, but I also haven't proven they don't exist. The algorithm here is: Start with an empty 'destination' array. For each element in the input array, traverse the destination array and insert it into the first position found where it does not equal either of its neighbors. If no such position is found, stick it at the front. (This would perform slightly better if it weren't ignoring the possibility of putting things in position 0 right off) shuffle([4,4,4,3,3,3,2,2,2,1,1,1,1]) = [3, 1, 2, 1, 4, 1, 2, 1, 3, 2, 4, 3, 4] shuffle([1,2,3,4,4,2,3,1,1,4,3,2,2]) = [2, 3, 2, 4, 2, 1, 3, 1, 4, 2, 3, 4, 1] shuffle([1,1,1,1,1,1,1,2,2,2,2,2,2,2]) = [2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1] JSfiddle
downvote count: 0
answers question: http://stackoverflow.com/q/29871091
score: 1
upvote count: 1

ms-word
tags question: http://stackoverflow.com/q/29884101
tag name: ms-word
type: Tag
tags question: http://stackoverflow.com/q/29903636

http://stackoverflow.com/comment/47853004
score: 1
has text: Do you mean pairwise, or as a path?
type: QuestionComment
comment on: http://stackoverflow.com/q/29863915
type: Comment

http://stackoverflow.com/q/29947600
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: google-maps-api-3
has answer: http://stackoverflow.com/a/30727455
has title: Gmaps not working properly on js
has comment: http://stackoverflow.com/comment/48070120
has body: I've a gmap loading problem with Google JavaScript API and it does not load completely when initialized the project. I tried all of available solutions but it did not work. In addition, if reloaded or resized the page, it works. @Scripts.Render("~/bundles/gmaps") Html: Just seems top left of the page! how can I fix this problem?
linked to: http://stackoverflow.com/q/16276035
has comment: http://stackoverflow.com/comment/48211405
has comment: http://stackoverflow.com/comment/48302959
upvote count: 2
tagged with: jquery-gmap
has comment: http://stackoverflow.com/comment/48210463
accepted answer: http://stackoverflow.com/a/30727455
type: Question
score: 2
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/15689656
has comment: http://stackoverflow.com/comment/48358121
tagged with: asp.net-mvc
has comment: http://stackoverflow.com/comment/48357877
linked to: http://stackoverflow.com/q/23982996
has comment: http://stackoverflow.com/comment/48210102
has comment: http://stackoverflow.com/comment/48211488
downvote count: 0
answer count: 1

http://stackoverflow.com/q/29853413
type: AnsweredQuestion
score: 0
has answer: http://stackoverflow.com/a/29856795
tagged with: raphael
type: Question
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29856795
answer count: 1
has body: Using Raphael JS I want to have a continuing sweeping clock. I have kind of got it implemented but there is a problem. The transform on the animation constantly requries a increasing integer to rotate. Eventually I'm going to hit a max integer. If I use 0,90,180,270. When it hits 0 again it goes back the other way. CodePen -> http://codepen.io/ianw92/pen/yNLdZz Javascript: var svg = Raphael("container",400,400), triangle = svg.path("M210 200L190 200L200 100Z").attr({fill:"#000"}), circle = svg.circle(200,200,5).attr({fill:"#f00"}); // Rotation settings var handAngle = 45, centerX = 200, centerY = 200; y = 0 function a() { y = (y + 90) % 360; triangle.animate({transform: "r"+y + "," + centerX + "," + centerY}, 500, b); } function b() { y = (y + 90) % 360; triangle.animate({transform: "r"+y + "," + centerX + "," + centerY}, 500, a); } a()
has title: Raphael JS sweeping clock

http://stackoverflow.com/q/29900398
score: 0
answer count: 1
has body: Currently I create a small modeling tool using Snap SVG. var p = Snap.path(pathString).attr({fill:'none', stroke:'black', strokeWidth:1}); creates connections between other elements. Every element, including the paths are clickable. Since it is hard to click exactly the path I tried to create an invisible outline around the path using Snap.filter.shadow so that a click event could be triggered for the path: var filter = this.paper.filter(Snap.filter.shadow(2,2,1)); filter.click(function() { do_as_if_i_clicked_the_path(); }); p.attr('filter', filter); But adding a click event to the filter doesn't work. Is there any way to create an invisible outline that is connected to the path so I can add events on it?
has comment: http://stackoverflow.com/comment/47994414
tagged with: path
has answer: http://stackoverflow.com/a/29938181
type: AnsweredQuestion
tagged with: outline
type: Question
has comment: http://stackoverflow.com/comment/47935547
accepted answer: http://stackoverflow.com/a/29938181
tagged with: javascript
has title: Clickable outline around Snap SVG path
tagged with: click

http://stackoverflow.com/a/29886591
has comment: http://stackoverflow.com/comment/47897342
has body: You should add it in your app dependency array like you did for ngRoute module, angular-translate dependency module name is pascalprecht.translate var app = angular.module('app', ['ngRoute', 'home', 'about', 'contact', 'session', 'auth-token-interceptor', 'pascalprecht.translate' //&lt;--here the angular-translate dependancy inject ] );
type: AcceptedAnswer
downvote count: 0
score: 1
type: Answer
has comment: http://stackoverflow.com/comment/47897299
upvote count: 1
has comment: http://stackoverflow.com/comment/47897364
accepted answer of: http://stackoverflow.com/q/29886510
answers question: http://stackoverflow.com/q/29886510

database
tags question: http://stackoverflow.com/q/29986696
tags question: http://stackoverflow.com/q/29991865
tags question: http://stackoverflow.com/q/29859521
type: Tag
tags question: http://stackoverflow.com/q/29896697
tag name: database
tags question: http://stackoverflow.com/q/29973574
tags question: http://stackoverflow.com/q/29968113
tags question: http://stackoverflow.com/q/29989296
tags question: http://stackoverflow.com/q/29996008

http://stackoverflow.com/comment/47835091
type: Comment
comment on: http://stackoverflow.com/q/29853382
score: 0
has text: where is rankedSolo5 being set? could be a race issue with your data load
type: QuestionComment

http://stackoverflow.com/q/29918834
has answer: http://stackoverflow.com/a/29919048
tagged with: javascript
has answer: http://stackoverflow.com/a/29920798
score: 0
tagged with: visualforce
tagged with: salesforce
has comment: http://stackoverflow.com/comment/47958887
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/29920798
has comment: http://stackoverflow.com/comment/47961261
has body: I have used AngularJS while developing a visual force page and was trying to create a record under a custom object, I could see that the Salesforce controller is returning the ID to javascript callback function and am using $scope.lblMsg={value:result['message']} inside the success condition but I was unable to populate that into a label field and label field isn't displayed, whereas when I use document.getElementById('lblMsg').innerHTML=result['message']; I was able to display the message. Can you please suggest what might be the mistake using AngularJS ? and also specify any effective solution to perform the task with AngularJS. Please find the link below where the above form is hosted http://ganeshforce-developer-edition.ap2.force.com/
has comment: http://stackoverflow.com/comment/47961469
type: AnsweredQuestion
has title: Angular JS unable to display a field when the result is retrieved from salesforce
type: Question
answer count: 2
possible better answer: http://stackoverflow.com/a/29919048

http://stackoverflow.com/q/29956548
tagged with: angularjs
has answer: http://stackoverflow.com/a/29956682
type: AnsweredQuestion
upvote count: 1
accepted answer: http://stackoverflow.com/a/29956682
tagged with: unit-testing
type: Question
tagged with: javascript
answer count: 1
has body: I am trying to test a http request with dynamic url I have something in my service file like My service file. //other service codes.. //other service codes.. var id = $cookies.id; return $http.get('/api/product/' + id + '/description') //id is dynamic Test file describe('test', function () { beforeEach(module('myApp')); var $httpBackend, testCtrl, scope; beforeEach(inject(function (_$controller_, _$httpBackend_, _$rootScope_) { scope = _$rootScope_.$new(); $httpBackend = _$httpBackend_; testCtrl = _$controller_('testCtrl', { $scope: scope }); })); it('should check the request', function() { $httpBackend.expectGET('/api/product/12345/description').respond({name:'test'}); $httpBackend.flush(); expect(scope.product).toBeDefined(); }) }); I am getting an error saying Error: Unexpected request: GET /api/product/description I am not sure how to test the dynamic url. Can anyone help me about it? Thanks a lot!
downvote count: 0
score: 1
favorite count: 0
has title: Angular testing http request error

http://stackoverflow.com/q/29959525
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
answer count: 0
downvote count: 0
score: 1
has title: Zeroclipboard: Copy content from a div, new paragraph tags not kept
type: Question
tagged with: javascript
has body: I created on page where users can select from a drop down menu several email templates in an editable div (to highlight some elements). I use zeroclipboard for them being able to copy / paste the content to an email in our online application If a template is selected and pasted immediately, it works perfectly. When you add a line, the code creates a paragraph, which is fine, but when you paste it, new tags are removed I checked the content of my clipboard and I can see that the new paragraph is ignored. New text is added straight after the last word of the previous paragraph After some investigations I found in zeroclipboard documentation this: client.on('copy', function(event) { var text = document.getElementById('yourTextArea').value; var windowsText = text.replace(/\n/g, '\r\n'); event.clipboardData.setData('text/plain', windowsText); }); The code of my page is: Copy to Clipboard I can't find a way to combine both. It seems working fine with a textarea but not with a div. My knowledge in JS is not good enough and I can't count how many websites I went trying to find an answer without success. Any advises?
upvote count: 1
favorite count: 0

http://stackoverflow.com/comment/47926239
type: QuestionComment
has text: Do you get errors on the console? Is updateResults defined so that it is global? Also with onchange the event will not fire until the input element lose focus
score: 0
comment on: http://stackoverflow.com/q/29901790
type: Comment

http://stackoverflow.com/q/29864245
score: 1
has comment: http://stackoverflow.com/comment/47854254
tagged with: bresenham
has comment: http://stackoverflow.com/comment/47853836
has comment: http://stackoverflow.com/comment/47853686
has title: Extract vertices from an ARC in generic way
type: Question
upvote count: 1
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/47856397
favorite count: 0
tagged with: rasterize
has body: I want to get all the vertices from an ARC. I have all the data (for ex : start point, end point, start angle, end angle, radius) which will used to draw an arc but my need is I have to generate all the vertices from the arc data. I have already tried with one or two algorithm but I failed to get the exact vertices from an arc data. I used Bresenham's algorithm but I failed. Right now I am using below code but its not working .. double theta = 2 * 3.1415926 / 100; double c = Math.cos(theta); double s = Math.sin(theta); double t; double x = ((ArcTo) element).getRadius();//we start at angle = 0 double y = 0; for(int ii = 0; ii &lt; 100; ii++) { coordinates.add(new Coordinate(x + element.getCenterPoint().getX(), y + element.getCenterPoint().getY()));//output vertex //apply the rotation matrix t = x; x = c * x - s * y; y = s * t + c * y; } Please help me. Thank you.
tagged with: geometry
downvote count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29875398
tagged with: algorithm

http://stackoverflow.com/a/29911439
has comment: http://stackoverflow.com/comment/47944933
upvote count: 2
answers question: http://stackoverflow.com/q/29911246
has comment: http://stackoverflow.com/comment/47945002
has comment: http://stackoverflow.com/comment/47944953
type: Answer
has body: How can I prevent that from occurring without passing in the number as a string? Is that possible? No. Leading zeros are of no significance in the number system / representation JS uses and thus they are not stored in the internal representation of a number. (or, if you like that better, a number has infinite leading zeros)
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/47946152
has comment: http://stackoverflow.com/comment/47945062

http://stackoverflow.com/comment/47867742
type: QuestionComment
comment on: http://stackoverflow.com/q/29871091
score: 0
type: Comment
has text: I don't think the questioner wants to remove any elements to create this non-duplicate neighbor array. He wants to move elements around in the array to achieve this scenario, based off his example.

http://stackoverflow.com/a/29906444
accepted answer of: http://stackoverflow.com/q/29904290
downvote count: 0
upvote count: 2
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47976637
type: Answer
answers question: http://stackoverflow.com/q/29904290
has body: I feel like the most elegant way to handle this challenge is via recursion. function getCombos(target, min, max, n) { var arrs = []; if (n === 1 && target <= max) { arrs.push([target]); } else { for (var i = min; i < target / n && i <= max; i++) { var arrays = getCombos(target - i, i + 1, max, n - 1); for (var j = 0; j < arrays.length; j++) { var array = arrays[j]; array.splice(0, 0, i); arrs.push(array); } } } return arrs; } Explanation This works by climbing up from the minimum number i as the first item in each array, and passing the remainder (target-i) back into the recursive function to be split into n-1 components, with the minimum increased by one with each recursive call. 15 = (1 + 14) = 1 + (2 + 12) 15 = (1 + 14) = 1 + (3 + 11) 15 = (1 + 14) = 1 + (4 + 10) ... 15 = (1 + 14) = 1 + (6 + 8) 15 = (2 + 13) = 2 + (3 + 10) 15 = (2 + 13) = 2 + (4 + 9) ... 15 = (4 + 11) = 4 + (5 + 6) Note that the numbers at the first index of each array will never exceed target/n, where target is the number you're summing to, and n is the number of items in the array. (So when splitting 15 into 3 components, the first column will always be less than 5.) This holds true for the other columns as well, but n is reduced by 1 as the index of the array climbs. Knowing this allows us to recurse without requiring extra parameters on our recursive function. Working Example Check out the snippet below to see it in action. function getCombos(target, min, max, n) { var arrs = []; if (n === 1 && target <= max) { arrs.push([target]); } else { for (var i = min; i < target / n && i <= max; i++) { var nextTarget = target - i; var nextMin = i + 1; var arrays = getCombos(nextTarget, nextMin, max, n - 1); for (var j = 0; j < arrays.length; j++) { var array = arrays[j]; array.splice(0, 0, i); arrs.push(array); } } } return arrs; } document.getElementById("submit").onclick = function () { var target = document.getElementById("target").value; var min = document.getElementById("min").value; var max = doc…
score: 2

http://stackoverflow.com/comment/48089327
score: 1
has text: You're just adding a property to the array object, not an indexed element to the array.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29985028

http://stackoverflow.com/q/29950633
has answer: http://stackoverflow.com/a/29951039
type: Question
has title: Adding a item to a list in JavaScript
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/48022214
score: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/48022407
type: UnansweredQuestion
has body: I'm a debutant in JavaScript so please be patient with me, in this code I have a list of ingredients, when the user puts something in the input area and then click on the body, the text must be added as another item in the list before the last one, but my code is just not working and I can't find the problem. function ajout(){ var newingredient = document.createElement("li"); var ingredient = document.getElementById("in2").value; var text=document.createTextNode(ingredient); newingredient.appendChild(text); var lastone=document.getElementById("last"); var list=getElementById("listecommissions"); list.insertBefore(newingredient, lastone); } kitchen 1kg de farine un pack de lait add one more ...

http://stackoverflow.com/q/29992503
type: UnansweredQuestion
tagged with: gmaps.js
has answer: http://stackoverflow.com/a/30035012
tagged with: google-maps
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: google-maps-api-3
type: Question
score: 0
has title: display information from road on mouseOver gmaps.js
upvote count: 1
answer count: 1
downvote count: 1
has body: I try to display information from road on mouseOver, same as infoWindow for Marker. my code for road drawing using gmaps.js &lt;script type="text/javascript"&gt; var map; $(document).ready(function () { var map = new GMaps({ div: '#map', lat: 33.764610, lng: -78.973307, }); map.drawRoute({ origin: [33.764471, -78.973162], destination: [33.771615, -78.979610], travelMode: 'driving', strokeColor: '#0F0', strokeOpacity: 0.6, strokeWeight: 10 /* mouseover: function(e) { alert('You clicked in this marker'); } */ }); });

http://stackoverflow.com/q/29860960
tagged with: javascript
has answer: http://stackoverflow.com/a/29861131
downvote count: 0
has title: Html multipe input type color ,inserting the selected colors to database
tagged with: jquery
has comment: http://stackoverflow.com/comment/47847845
favorite count: 0
tagged with: ajax
accepted answer: http://stackoverflow.com/a/29863625
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47847815
has comment: http://stackoverflow.com/comment/47847802
has answer: http://stackoverflow.com/a/29861025
tagged with: php
has body: I am using the input type color to select the color to customize my site. I am inserting the selected color to database and retrieve it back and apply to the site this is working nice for a single input type color. For now i have an input type color and a button with this when i select the color and click the button then , the area name and color inserted to database like area name = footer and color = #CCC, now my problem is that i want to do this for all the content,header,left sidebar and right sidebar. I can use multiple button with multiple input type, but that seem not professional ,i want multiple input type color and one button for all. Any help would be appreciated. thanks in advance. /**The working code for a single input type color with a button***/ Choose Colour: &lt;input class="color" name="color1" id="color1" placeholder="click to choose colour"&gt; &lt;input type="submit" onclick="changebodycolour('color1')" value="Apply" /&gt; /**My function to insert the value to database table**/ function changebodycolour(c1) { var selectedcolur = document.getElementById(c1).value; //alert(selectedcolur); $("#color1").empty(); $("#loginScreen").empty(); $.ajax({ url: ""+pat+"changecolour.php?ipp="+encodeURIComponent(selectedcolur), type: 'POST', beforeSend: function() { $('body').css({ opacity: 0.5 }); $("#loading_img").show(); }, success: function(data) { $("#loading_img").hide(); $("#loginScreen").fadeIn('slow').append(data).delay(1300).fadeOut('slow'); $('body').css({ opacity: 2 }); } });//end ajax call } /**And this is php code**/ $sql = "Insert into gr_colours values('','".$_GET['ipp']."','body')"; $db-&gt;insert($sql);
has comment: http://stackoverflow.com/comment/47847823
answer count: 4
type: AnsweredQuestion
score: 1
possible better answer: http://stackoverflow.com/a/29862264
has answer: http://stackoverflow.com/a/29862264
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/29863625

http://stackoverflow.com/comment/47888999
comment on: http://stackoverflow.com/a/29882506
score: 0
type: AnswerComment
type: Comment
has text: return { getData: getData } Can you please help me with this? Why you use getData: getData? here

http://stackoverflow.com/q/29872254
linked to: http://stackoverflow.com/q/1074200
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47870337
has comment: http://stackoverflow.com/comment/47870015
linked to: http://stackoverflow.com/q/2212486
tagged with: django
has body: I am trying to update a div element in my html page with a png image which gets returned from the Django server. In my client-side script where I send an ajax POST request on a button click, I have - $('#mybtn').click(function (event) { event.preventDefault(); $.ajax({ url: "/analysis", type: "POST", data: { 'data': $("#analysis_list").val(), csrfmiddlewaretoken: document.getElementsByName('csrfmiddlewaretoken')[0].value }, success: function (response) { $('#imagediv').html('&lt;img src=' + response + ' /&gt;'); }, }); }); In my views.py, I have - def analysis(request): dataFromClient = dict(request.POST)['data'][0] pathToImg = testAnalytics(dataFromClient) img = Image.open(pathToImg) response = HttpResponse(content_type="image/png") img.save(response, "PNG") return response Where testAnalytics method generates the image to be displayed according to the data sent by client and returns the path to it. Image is imported from PIL. I am facing problem with rendering the image at client-side javascript. When I assign response to src attribute of the &lt;img&gt; tag, I see raw image data on the browser instead of the image (as discussed in here - How to update a div with an image in Django?). I am not sure where I am going wrong. I have also tried base64 encoding on the response as follows (but not sure whether I have implemented correctly) - success: function (response) { $('#imagediv').html('&lt;img alt="Embedded Image" src="data:image/png;base64,' + response + '" /&gt;'); } I have referred to following links to get upto this point - Django: How to render image with a template Serve a dynamically generated image with Django I am fairly new to web-programming as well as Django. Any insights regarding the problem will be really helpful. Thanks in advance.
linked to: http://stackoverflow.com/q/1207190
type: Question
has answer: http://stackoverflow.com/a/29873971
score: 5
has answer: http://stackoverflow.com/a/29873894
upvote count: 5
tagged with: base64
has comment: http://stackoverflow.com/comment/47870048
has comment: http://stackoverflow.com/comment/47869760
has comment: http://stackoverflow.com/comment/47869634
possible better answer: http://stackoverflow.com/a/29873894
answer count: 2
has title: How to serve an image in Django using jquery
downvote count: 0
has comment: http://stackoverflow.com/comment/47870157
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/29873971
favorite count: 0
has comment: http://stackoverflow.com/comment/47870096
has comment: http://stackoverflow.com/comment/47869813
has comment: http://stackoverflow.com/comment/47869702
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/20981691

http://stackoverflow.com/comment/48114360
type: QuestionComment
comment on: http://stackoverflow.com/q/29994467
score: 0
type: Comment
has text: Welcome to Stack Overflow! I formatting your code

http://stackoverflow.com/a/29978061
upvote count: 4
answers question: http://stackoverflow.com/q/29978022
has body: getElementsByClassName returns an array like object. There is no innerHTML property on it. You need to either act on all the divs returned or a specific one. See docs for further examples. https://developer.mozilla.org/en-US/docs/Web/API/Document/getElementsByClassName
score: 4
downvote count: 0
type: Answer

http://stackoverflow.com/comment/48089131
has text: But wouldn't it still work, since .specific-step still IS the parent?
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29984891
type: AnswerComment

http://stackoverflow.com/comment/48114776
score: 2
has text: No source code = nothing to work with or do you expect people to build it all for you? Have you made any attempt(s) of doing this yourself? If so I would recommend editing your question and adding some source code for people to work with **and** display your attempt(s), explain why you think your attempt(s) don't work as intended. If you cannot display source code/attempt(s) then I wish you the very best with your wish list. *No source code > No attempts will result in users downvoting you.*
comment on: http://stackoverflow.com/q/29997398
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/48116635
comment on: http://stackoverflow.com/q/29998231
score: 0
type: QuestionComment
has text: @codeomnitrix can you redirect a client request to the server Y from server X?
type: Comment

http://stackoverflow.com/a/29858838
has body: Looking at the documentation, you probably need to capitalize object on that line.
score: 3
has comment: http://stackoverflow.com/comment/47843550
has comment: http://stackoverflow.com/comment/47843639
type: Answer
answers question: http://stackoverflow.com/q/29858731
upvote count: 3
downvote count: 0

http://stackoverflow.com/comment/48098050
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29987753
has text: Could be typo? Should be presenterNotes(), not presentationNotes().

http://stackoverflow.com/a/29921981
has comment: http://stackoverflow.com/comment/102782995
type: Answer
has comment: http://stackoverflow.com/comment/55870513
accepted answer of: http://stackoverflow.com/q/29921696
answers question: http://stackoverflow.com/q/29921696
has body: Pay attention: Attribute href is obligatory, without it the area-tag does nothing! To add a click event, you'll need to block default href. Your code should start as follows: $(".blue").on("click", function(e){ e.preventDefault(); /* your code here */ }); Live example here.
type: AcceptedAnswer
downvote count: 1
upvote count: 40
score: 39

http://stackoverflow.com/q/29951579
score: 1
has title: MeteorJS iron-router "sub-templates" or re-render prevention or optional parameter
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/29957580
downvote count: 0
tagged with: javascript
has body: I'm trying to migrate a two year old meteor project with many deprecated packages to the current version. But I'm stuck with iron-router and this: A route /map showing an interactive map with markers When a user click on a marker an absolute positioned div with full-width-height opens and show a detail page The url should change to /map/&lt;markerId&gt; so the user can share url and use back button The div holding the map should not be destroyed or rerendered because the user should not loose his "map-state" like zooming &amp; scrolling when going back I tried several approaches but didn't find a solution that solve point 3 and 4 simultaneously. With the old router package it just worked with the two routes setting a different Session variable and rendering the same template. Thanks in advance for ideas
has answer: http://stackoverflow.com/a/29959467
has comment: http://stackoverflow.com/comment/48028820
tagged with: meteor
favorite count: 0
possible better answer: http://stackoverflow.com/a/29959467
tagged with: iron-router
accepted answer: http://stackoverflow.com/a/29957580
upvote count: 1
type: AnsweredQuestion

http://stackoverflow.com/comment/50056602
has text: I "solved" this problem by changing to slick slider, works great
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29982613

http://stackoverflow.com/comment/47887031
comment on: http://stackoverflow.com/q/29881339
type: Comment
type: QuestionComment
score: 2
has text: It is very hard to know what you want without you give us an example and the expected result. Consider edit your question. See [How do I ask a good question?](http://stackoverflow.com/help/how-to-ask)

http://stackoverflow.com/a/29991240
has comment: http://stackoverflow.com/comment/48104431
answers question: http://stackoverflow.com/q/29990977
upvote count: 3
has comment: http://stackoverflow.com/comment/48102851
accepted answer of: http://stackoverflow.com/q/29990977
type: Answer
has body: Use $(document).clearQueue(); in the function called on keyup. $(document).keyup(function() { $(document).clearQueue(); }); You will have to bind each event on the document as a queue then only you can use clearQueue. You can do it like as follows: $(document).queue(function(){ $(this).keypress(function(){ }); });
downvote count: 0
score: 3
has comment: http://stackoverflow.com/comment/48101919
has comment: http://stackoverflow.com/comment/48105194
type: AcceptedAnswer

http://stackoverflow.com/a/29913294
has comment: http://stackoverflow.com/comment/47949707
score: 0
has comment: http://stackoverflow.com/comment/47949890
type: Answer
has comment: http://stackoverflow.com/comment/47953134
has body: Move the console.log inside function processRow(rows) so that it looks like function processRow(rows) { retValue = rows; console.log(retValue); } also change processRow(row, function() { retValue = row; }); To processRow(row); The second parameter was unused.
answers question: http://stackoverflow.com/q/29913206

http://stackoverflow.com/q/29933871
answer count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/47989976
type: UnansweredQuestion
has title: Close button of the bootstrap popover not working properly
has comment: http://stackoverflow.com/comment/47990375
tagged with: twitter-bootstrap
has comment: http://stackoverflow.com/comment/47990417
type: Question
has body: I have a problem with the close button of the popover. The first time, i close the popover is fine, but the moment i open another one and try to close it, it does not work anymore. Here my JS for the popover: $(function () { $('[data-toggle="popover"]').popover({ "html": true, "title": '&lt;span class="text-info"&gt;&lt;strong&gt;title&lt;/strong&gt;&lt;/span&gt;'+ '&lt;button type="button" id="close" class="close" &gt;&amp;times; &lt;/button&gt;', "content": function(){ var div_id = "tmp-id-" + $.now(); return details_in_popup($(this).data('url'), div_id); } }).on('shown.bs.popover', function(e){ var popover = jQuery(this); $('.close').on('click', function(e){ popover.popover('hide'); }); }); }); Any clue what is causing this problem ? Thanks!
tagged with: javascript
tagged with: popover
score: 0
has comment: http://stackoverflow.com/comment/47990150
has answer: http://stackoverflow.com/a/29934040

http://stackoverflow.com/a/29866164
upvote count: 1
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/29866027
downvote count: 0
answers question: http://stackoverflow.com/q/29866027
score: 1
has body: Just add the required Open Graph tags to the link you want to share: https://developers.facebook.com/docs/sharing/best-practices#tags http://ogp.me/ That being said, if you want to add a "message", that´s not possible at all and not allowed anyway. The message always must be 100% user generated and prefilling is not allowed.

http://stackoverflow.com/comment/48114330
score: 0
type: Comment
has text: By the way the point about the API key is not that you'd be posting it on stackoverflow, it becomes public because all I have to do is view source on your webpage and I can steal it. Then I could abuse your API key and get you banned from forecast.Io. That's why they recommend you setup a server-side proxy which would hide the API key from the client side.
comment on: http://stackoverflow.com/a/29997328
type: AnswerComment

http://stackoverflow.com/q/29997408
tagged with: javascript
has comment: http://stackoverflow.com/comment/48115283
has answer: http://stackoverflow.com/a/29997481
has title: JQuery load a page in background
answer count: 3
has comment: http://stackoverflow.com/comment/48114596
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/29997914
tagged with: http://stackoverflow.com/tag/html
tagged with: php
accepted answer: http://stackoverflow.com/a/29997914
type: AnsweredQuestion
has body: I have a few menutabs in my website. When the user clicks on one, it expands or hides, but when it does a page is loaded (in the background) to save the way he wants (without refresh). I'm using this: function ajaxLink(){ var age = $("#age").val(); $.get("&lt;?php echo _SITE_ADDRESS; ?&gt;/linktab/1",{"age":age},function(r){ }); } It's not meant for this but it works for a single tab; if I want to add more tabs then I have to add more of these and change the function name and in a href I have to add onclick="ajaxLink()". (The age var is there for no reason. I can't get it out without breaking the code.) How can I change this to make it a single jQuery so when a user clicks on a tab with id=1 it goes /linktab/1, tab with id=2 it goes /linktab/2, and so on. Thanks
upvote count: 2
score: 1
downvote count: 1
type: Question
possible better answer: http://stackoverflow.com/a/29997466
has answer: http://stackoverflow.com/a/29997466

http://stackoverflow.com/comment/47917845
comment on: http://stackoverflow.com/q/29897612
type: Comment
type: QuestionComment
score: 3
has text: this needs to be done with ajax

http://stackoverflow.com/comment/47895859
comment on: http://stackoverflow.com/q/29885818
type: Comment
type: QuestionComment
has text: depends on server type, use `htaccess` for example in apache or web.config in IIS
score: 0

http://stackoverflow.com/comment/75600235
score: 6
type: AnswerComment
has text: This threw me because when I initially saw the filter, I thought it was the *opposite*--that safe would escape HTML.
type: Comment
comment on: http://stackoverflow.com/a/29866068

http://stackoverflow.com/q/29942144
type: Question
possible better answer: http://stackoverflow.com/a/29942223
has answer: http://stackoverflow.com/a/29942741
tagged with: javascript
answer count: 2
has title: Dropdown header from hover to click
tagged with: jquery
accepted answer: http://stackoverflow.com/a/29942741
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion
score: 0
has answer: http://stackoverflow.com/a/29942223
has body: I use this code inside our header to display our cart. Currently the dropdown is displayed on hover. How can I modify this so that the dropdown is displayed onclick? &lt;a href="#header-cart" class="skip-link skip-cart &lt;?php if($_cartQty &lt;= 0): ?&gt; no-count&lt;?php endif; ?&gt;"&gt; &lt;span class="icon"&gt;&lt;/span&gt; &lt;span class="label"&gt;&lt;?php echo $this-&gt;__('Cart'); ?&gt;&lt;/span&gt; &lt;span class="count"&gt;&lt;?php echo $_cartQty; ?&gt;&lt;/span&gt; &lt;/a&gt; &lt;div id="header-cart" class="block block-cart skip-content"&gt; &lt;?php echo $this-&gt;getChildHtml('minicart_content');?&gt; &lt;/div&gt; I use this code for the dropdown on the website: &lt;?php //Drop-down ?&gt; var ddOpenTimeout; var dMenuPosTimeout; var DD_DELAY_IN = 200; var DD_DELAY_OUT = 0; var DD_ANIMATION_IN = 0; var DD_ANIMATION_OUT = 0; $('.clickable-dropdown &gt; .dropdown-heading').click(function() { $(this).parent().addClass('open'); $(this).parent().trigger('mouseenter'); }); //$('.dropdown-heading').on('click', function(e) { $(document).on('click', '.dropdown-heading', function(e) { e.preventDefault(); }); $(document).on('mouseenter', '.dropdown', function() { var ddToggle = $(this).children('.dropdown-heading'); var ddMenu = $(this).children('.dropdown-content'); var ddWrapper = ddMenu.parent(); &lt;?php //$(this); ?&gt; &lt;?php //Clear old position of dd menu ?&gt; ddMenu.css("left", ""); ddMenu.css("right", ""); &lt;?php //Show dd menu ?&gt; if ($(this).hasClass('clickable-dropdown')) { &lt;?php //If dropdown is opened (parent already has class 'open') ?&gt; if ($(this).hasClass('open')) { $(this).children('.dropdown-content').stop(true, true).delay(DD_DELAY_IN).fadeIn(DD_ANIMATION_IN, "easeOutCubic"); } } else { &lt;?php //Add class 'open' to dd ?&gt; clearTimeout(ddOpenTimeout); ddOpenTimeout = setTimeout(function() { ddWrapper.addClass('open'); }, DD_DELAY_IN); //$(this).addClass('open'); $(this).children('.dropdown-content').stop(true, true).delay(DD_DEL…

http://stackoverflow.com/q/29944171
has body: If I want to skip a number of items in a for loop in PHP, I might use PHP's native in_array(needle,haystack); function in the following manner: PHP $Fruit = array('Apple','Banana','Cucumber','Grapes','Pear','Tomato'); $Salad = array('Tomato','Cucumber'); $Herb = array('Banana'); $countFruit = count($Fruit); for ($i = 0; $i &lt; $countFruit; $i++) { if (in_array($Fruit[$i],$Salad)) continue; $fruitBowl[] = $Fruit[$i]; } This will give me a $fruitBowl of: array('Apple','Banana','Grapes','Pear'); I realize I could use the much simpler $fruitBowl = array_diff($Fruit,$Salad); but bear with me - I'm making up this example as I go along. How do I reproduce this (or something similar) in Javascript? Here's what I have come up with: Javascript var Fruit = ['Apple','Banana','Cucumber','Grapes','Pear','Tomato']; var Salad = ['Tomato','Cucumber']; var Herb = ['Banana']; var fruitBowl = []; var countFruit = Fruit.length; for (var i = 0; i &lt; countFruit; i++) { if (Salad.indexOf(Fruit[i]) !== -1) {continue;} fruitBowl.push(Fruit[i]); } Having got this far, my question is specifically this: Is the Javascript if (Salad.indexOf(Fruit[i]) !== -1) {continue;} now (in 2015) the standard way to reproduce if (in_array($Fruit[$i],$Salad)) continue; in PHP? Or is there a less obscure way of going about it? N.B. I understand that jQuery has inArray and Prototype has Array.indexOf but I'm just looking for a plain JavaScript solution.
tagged with: function
tagged with: arrays
has comment: http://stackoverflow.com/comment/48009536
tagged with: javascript
linked to: http://stackoverflow.com/q/237104
favorite count: 0
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/48009405
upvote count: 1
tagged with: php
linked to: http://stackoverflow.com/q/784012
score: 0
has title: Reproduce in plain Javascript the PHP function in_array(needle, haystack)
downvote count: 1
type: Question

http://stackoverflow.com/comment/47956187
has text: The return value from [*setDate*](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-date.prototype.setdate) is the *timeclip*, i.e. the Date's internal time value, which is milliseconds since the epoch (1 January, 1970).
comment on: http://stackoverflow.com/q/29917374
type: Comment
type: QuestionComment
score: 2

http://stackoverflow.com/q/29891666
favorite count: 0
has body: I'm trying to increase a text value using two buttons, one on each side of the text, which either increase the value by 10 or decrease it by 10, and the value can't go under 10km or over 90km. Here is the app screen so you can see what I mean: Update: I've now been given code to work with but it doesn't have the "km" value after the number so it goes 10,20,30 instead of 10km, 20km, 30km. Does anyone know how to adjust this code to do what I want? &lt;script language='javascript' type='text/javascript'&gt; $(document).ready(function(){ $("#increment").click(function(){ if($('#number').val() !="90"){ var $n = $("#number"); $n.val(Number($n.val())+10); } }); $("#decrement").click(function(){ if($('#number').val() !="10"){ var $n = $("#number"); $n.val(Number($n.val())-10); } }); }); &lt;/script&gt; &lt;/head&gt; &lt;style&gt; .Radius{ font-size:14px; font-family:"gillsans"; color: #4361AD; text-align: center; } &lt;/style&gt; &lt;body&gt; &lt;div id="Maincontainer"&gt; &lt;input type="text" value="10" id="number" class="Radius" style="background-color:transparent; border:0px solid white; width:110px; margin-left:15px;"/&gt; &lt;input type="button" id="increment" value="Increment"/&gt; &lt;input type="button" id="decrement" value="decrement"/&gt; &lt;/div&gt; &lt;/body&gt; https://jsfiddle.net/deepanv29/4b7adopb/
has comment: http://stackoverflow.com/comment/47906883
has answer: http://stackoverflow.com/a/29892214
has answer: http://stackoverflow.com/a/29892500
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/29892500
possible better answer: http://stackoverflow.com/a/29891874
tagged with: css
has comment: http://stackoverflow.com/comment/47906885
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/47907312
has title: How to increase and decrease a text value with two buttons
type: AnsweredQuestion
tagged with: c#
has comment: http://stackoverflow.com/comment/47906889
has comment: http://stackoverflow.com/comment/47906816
has answer: http://stackoverflow.com/a/29891874
tagged with: javascript
type: Question
answer count: 3
upvote count: 1

http://stackoverflow.com/a/29977934
has comment: http://stackoverflow.com/comment/48075843
has body: temp doesn't have a prototype. Object has a prototype. You can change the prototype for all Objects by calling Object.prototype but you can't change it for just once object.
has comment: http://stackoverflow.com/comment/48075599
answers question: http://stackoverflow.com/q/29977892
type: Answer
has comment: http://stackoverflow.com/comment/48075862
has comment: http://stackoverflow.com/comment/48075505
has comment: http://stackoverflow.com/comment/48075906
has comment: http://stackoverflow.com/comment/48075548
has comment: http://stackoverflow.com/comment/48075627
has comment: http://stackoverflow.com/comment/48075482
has comment: http://stackoverflow.com/comment/48076069
score: 0
has comment: http://stackoverflow.com/comment/48075661
has comment: http://stackoverflow.com/comment/48075565

http://stackoverflow.com/a/55393039
downvote count: 0
answers question: http://stackoverflow.com/q/29851587
type: Answer
upvote count: 1
has body: You need to process your data structure to get this done. var a = [ { "Sound": "0.550951615" }, { "Battery": 0.2567320563 }, { "Screen": 0.0703125 }, { "RAM": 0.1246117102 }, { "Connectivity": 0 }, { "Camera": 0.2721623766 }, { "Design": 0.3677622768 }, { "Processor": 0 } ] var keyValue = {} a.forEach(function(e) { keyValue[Object.keys(e)[0]] = Object.values(e)[0] }) Output of console.log(keyValue) {"Sound":"0.550951615","Battery":0.2567320563,"Screen":0.0703125,"RAM":0.1246117102,"Connectivity":0,"Camera":0.2721623766,"Design":0.3677622768,"Processor":0}
score: 1

http://stackoverflow.com/a/29882254
answers question: http://stackoverflow.com/q/29881984
has body: The event handler window.onload needs to be assigned a function to invoke. So, you just need to add the keyword 'function' before the block of code and then assign that to window.onload. Additionally, if you want to play nice with other code on the page you could grab a reference to any existing onload handler and then invoke in your onload function. var oldOnLoad = window.onload; window.onload = function() { if (typeof oldOnLoad === 'function') { oldOnLoad(); } var replies = document.getElementsByClassName("reply-wrapper"); var retweets = document.getElementsByClassName("retweet-wrapper"); var favs = document.getElementsByClassName("fav-wrapper"); for (var i = 0; i &lt; replies.length; i++) { replies[i].style.backgroundImage = "url(images/reply.png)"; } for (var i = 0; i &lt; retweets.length; i++) { retweets[i].style.backgroundImage = "url(images/retweet.png)"; } for (var i = 0; i &lt; favs.length; i++) { favs[i].style.backgroundImage = "url(images/favorite.png)"; } }; Note: it might be worth mentioning that loading the background images in the onload event handler could cause your page to appear to load slow because it will wait for all other content on the page to finish loading. You might want to do something like instead: &lt;div id="reply-wrapper" style="display: block; width: 250px; height: 250px;"&gt;&lt;/div&gt; &lt;script&gt; (function() { document.getElementById('reply-wrapper').style.backgroundImage = "url(//dummyimage.com/250x250/000/fff)"; })(); &lt;/script&gt;
has comment: http://stackoverflow.com/comment/47891912
downvote count: 0
has comment: http://stackoverflow.com/comment/47890414
upvote count: 2
type: Answer
score: 2

http://stackoverflow.com/a/29919434
answers question: http://stackoverflow.com/q/29919394
score: 3
has body: document.getElementById("number").innerHTML=i+"&lt;/br&gt;"; will replace the HTML of number, change it to document.getElementById("number").innerHTML+=i+"&lt;/br&gt;";// see the `+`
downvote count: 1
type: Answer
upvote count: 4

http://stackoverflow.com/q/29926413
tagged with: jquery
type: UnansweredQuestion
tagged with: infinite-scroll
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29926672
has body: I want to know a code for continuous website that if i scroll to the bottom and will get back to top, and otherwise. i already in a half way that i used this code for the bottom page : $(document).ready(function() { $(document).scroll(function(){ if (document.documentElement.clientHeight + $(window).scrollTop() &gt;= $(document).height()) { $(document).scrollTop(0); } }); }); how can i make conversely? from top to the bottom page? EDIT: $(document).ready(function() { $(document).scroll(function(){ if (document.documentElement.clientHeight + $(window).scrollTop() &gt;= $(document).height()) { $(document).scrollTop(0); } else if ($(window).scrollTop() &lt;= 0) { $(document).scrollTop($(document).height()); } }); }); i tried that code and it works, but i think there is a little bug there, i need to scroll a bit more to get to bottom from top or otherwise, why is that happen? Thanks
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/29926551
has title: never ending scrolling page (scrolling top and back to bottom of the page or otherwise)
score: 0
answer count: 2
linked to: http://stackoverflow.com/q/4249353

http://stackoverflow.com/a/29940941
has comment: http://stackoverflow.com/comment/68623081
upvote count: 18
answers question: http://stackoverflow.com/q/29940691
type: AcceptedAnswer
downvote count: 0
has body: This is a known bug that happened from iOS6 Safari. The resize event fires randomly while scrolling. Fortunately it's not a jQuery issue. This answer to a similar problem might solve your issue as well. For the lazy: 3Stripe posted that you should "Store the window width and check that it has actually changed before proceeding with your $(window).resize function" His code snippet: jQuery(document).ready(function($) { /* Store the window width */ var windowWidth = $(window).width(); /* Resize Event */ $(window).resize(function(){ // Check if the window width has actually changed and it's not just iOS triggering a resize event on scroll if ($(window).width() != windowWidth) { // Update the window width for next time windowWidth = $(window).width(); // Do stuff here } // Otherwise do nothing }); });
type: Answer
has comment: http://stackoverflow.com/comment/79399870
score: 18
has comment: http://stackoverflow.com/comment/68568923
has comment: http://stackoverflow.com/comment/48003845
has comment: http://stackoverflow.com/comment/56839123
has comment: http://stackoverflow.com/comment/56655777
accepted answer of: http://stackoverflow.com/q/29940691

http://stackoverflow.com/q/29923487
accepted answer: http://stackoverflow.com/a/29923739
type: Question
has answer: http://stackoverflow.com/a/29923739
has title: Cyclic writings on the same file
answer count: 1
tagged with: javascript
score: 0
has body: I've to do cyclic writings on the same file in nodejs. In particular this is the pseudo-code: value = 77; for(var i=0; i&lt;list.length; i++){ if(list[i] &gt; 10){ proxy.setNewState(value, function(response){ console.log(response); }); } } The function "setNewState" do some nested operations: (1) write in a file "out.txt" something... (2) run a module that using that file to produce an URL to do an HTTP request to a server (NB: I need to write a file because this the module runs some shell commands where this file is used). (3) return the response using the callback. My problem (I think) is that the "for" cycle is not good because the file is re-write and so the HTTPs are not correctly executed. Any helps? What should I do?
tagged with: node.js
type: AnsweredQuestion

http://stackoverflow.com/q/29933410
has comment: http://stackoverflow.com/comment/47989387
tagged with: jquery
has title: Pass data from one page to another after button click jquery
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
answer count: 0
has comment: http://stackoverflow.com/comment/47990427
type: Question
has comment: http://stackoverflow.com/comment/47990396
has body: Is it possible to pass multiple data from one page to another on event button click.I ask this because i need to generate a report for my html page from the form that i search from database i need to create a separate html that i can print like how you print .doc files. Questions: Pass data (many) from one page to another after button click Print the html page just like how you print .doc files
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/47989360

http://stackoverflow.com/comment/48110535
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29994458
has text: You can see that in 3-1-2 nothing is changed. I want the section 3 to be placed on top, then 1, then 2

http://stackoverflow.com/a/29957188
type: Answer
has body: Alrightie. So I have some personal experience with this, as i was trying to write an HTML file, including javascript. I had a tag, and wanted the user to click the button i made, and it would get the value from the form. After hours of research, i discovered a variant of document.getElementById() this variant was document.getElementById().value given an html form with an id, call the second function i listed (the .value one) with the id of the form in the parenthesis with quotes around the id. This will grab any text from the form. EG Input text here Submit so what the above is takes an HTML input, and when the button is clicked, it sets the form_data variable to the value of the contents of the form. so if the user typed in "name" into the form, then form_data="name" hope that helps. REMEMBER document.getElementById().value
score: 0
answers question: http://stackoverflow.com/q/29956126

http://stackoverflow.com/q/29907952
upvote count: 2
tagged with: http://stackoverflow.com/tag/json
type: Question
has comment: http://stackoverflow.com/comment/47938522
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29908076
has body: I have json data that looks like this { "projects":{ "COMMERCIAL":[ { "ppID":"87", "pTitle":"5th Street Lofts" }, { "ppID":"94", "pTitle":"Skip-a-Long Child Development Services" } ], "CORPORATE":[ { "ppID":"86", "pTitle":"Caxton Building" }, { "ppID":"68", "pTitle":"Swiss Valley Corporate Headquarters" } ], "EDUCATION (COLLEGIATE)":[ { "ppID":"20", "pTitle":"Ashford University - Athletic Field" }, { "ppID":"64", "pTitle":"St. Ambrose University - Center For Health And Science Education" } ] }, "error":"0" } In this example, "COMMERCIAL", "CORPORATE", and "EDUCATION (COLLEGIATE)" are unknown fields names. I'm getting it from my CGI, which looks like this: $.ajax({ url: "cgi/myCGI.exe", dataType: "json", error: ajaxError, success: function(json){ if(json.error !== "0"){ alert("error processing request: "+json.error); return; } var temp=""; var i=0; for(i=0;i<=json.projects.length-1;i++){ // tried something like this } $.each(json.projects, function(ppID, pTitle) { // tried something like this }); // add to my html } }); Ultimately, I want to add HTML to the webpage, like COMMERCIAL Fidlar Technologies Skip-a-Long Child Development Services CORPORATE etc. I can't figure out how to get the names of each project "sub title" then it's individual field values. EDIT: First, I noticed that json.projects.length is undefined. I also tried json.projects[0].length but it is also undefined. in $.each(json.projects, function(ppID, pTitle) { console.log("test: "+ppID); console.log("test: "+pTitle); }); ppID works, but pTitle says [object,object]
answer count: 2
score: 2
downvote count: 0
tagged with: jquery
favorite count: 0
possible better answer: http://stackoverflow.com/a/29908117
has title: parsing json multiple array with unknown field names with jquery
has answer: http://stackoverflow.com/a/29908117
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29908076

http://stackoverflow.com/comment/47842151
type: Comment
has text: Hey! Thanks for that, I did change it to c1[0] and etc, but still no luck.
comment on: http://stackoverflow.com/q/29858047
score: 0
type: QuestionComment

http://stackoverflow.com/comment/48102121
score: 0
type: Comment
has text: This did it! I've bookmarked that link. Thank-you!
comment on: http://stackoverflow.com/a/29991228
type: AnswerComment

http://stackoverflow.com/a/29871252
accepted answer of: http://stackoverflow.com/q/29863573
score: 0
answers question: http://stackoverflow.com/q/29863573
type: Answer
has comment: http://stackoverflow.com/comment/47887983
has body: Dojo will generate your output layer file in your output directory - as you've discovered - but because the need for some modules that aren't mentioned in your layer file can still occur at runtime, Dojo also packages up all the other input files into the output directory too so that they're available on demand. (It can optionally minify the layer files and those standalone files, separately.) Having said that, you don't have to use those on-demand files: I've never managed to find a way to stop it doing that copy/transform, so I generate my layer files (being very careful to ensure that I can't possibly need any other modules at runtime) throw away all the other files It can occasionally be a bit fiddly to ensure that the layer files are complete, but you're talking about a very small set, so it should be okay for your case. I don't believe there's any sort of straightforward way to stop Dojo generating them in the first place, unfortunately.
type: AcceptedAnswer

http://stackoverflow.com/comment/47989890
has text: So for the last example...if you did not include callback( ) in the body of iExecuteYourCallback, the bottom iExecuteYourCallback(function () {console.log...)}) would not execute?
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29933813
type: AnswerComment

http://stackoverflow.com/comment/47879897
comment on: http://stackoverflow.com/q/29876454
has text: See the second line in your error, it says that it was unable to fetch the html file. Check if the path specified is correct. Also, chrome normally doesnot allow referencing of files. Try the html in firefox, if that loads. Or use some static server like apache
type: Comment
score: 0
type: QuestionComment

http://stackoverflow.com/comment/48104103
comment on: http://stackoverflow.com/q/29991518
score: 0
has text: I'm sorry man....but I have given my part too...and when I inspect my page it seems to be working fine inside , in the html, but it does not reflect on the page
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29894629
has comment: http://stackoverflow.com/comment/47912958
tagged with: jquery
has answer: http://stackoverflow.com/a/29894866
has title: jQuery.on("click") firing multiple times for a single click
has comment: http://stackoverflow.com/comment/47913509
type: Question
has comment: http://stackoverflow.com/comment/47912885
has comment: http://stackoverflow.com/comment/47912115
has comment: http://stackoverflow.com/comment/47912117
has comment: http://stackoverflow.com/comment/47912299
has comment: http://stackoverflow.com/comment/47912248
has comment: http://stackoverflow.com/comment/47912886
has body: I am having trouble with my jQuery code. Basically I want to load more message entrys after user clicks button. Problem is, it returns results 3 times. I have tried literally everything - .unbind (used .bind) / .off / .stopPropagation() and other methods I thought of. I searched all over google, but still couldn`t manage to find solution. Maybe someone can clarify where my problem is? $(document).ready(function(){ $("#website_post_content_table_bottom_settings_left :input").on("click", function(event){ if($('.website_post_content_table_data#bigNews').is(":visible")){ var currentId = $('.website_post_content_table_entry:last').attr("id"); $.ajax({ type: "POST", url: "php/admin_functions.php", data: {callFunction: "getMoreNewsEntrys", id: currentId}, cache: false, success: function(html){ $('.website_post_content_table_data').after(html); } }); } }); }); EDIT: HTML Ielādēt papildus: EDIT v3: I made new javascript file, only for this small code and it STILL returns it 3 times: $(document).ready(function(){ $("#website_post_content_table_bottom_settings_left :input").one("click", function(event){ $('.website_post_content_table_data').after(' Something More '); }); });
has answer: http://stackoverflow.com/a/29895973
score: 0
has comment: http://stackoverflow.com/comment/47913276
has comment: http://stackoverflow.com/comment/47912687
has comment: http://stackoverflow.com/comment/47912158
answer count: 3
has answer: http://stackoverflow.com/a/29895115
has comment: http://stackoverflow.com/comment/47912684
has comment: http://stackoverflow.com/comment/47913375
has comment: http://stackoverflow.com/comment/47913042
has comment: http://stackoverflow.com/comment/47912412
tagged with: javascript
has comment: http://stackoverflow.com/comment/47913124
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47912309
has comment: http://stackoverflow.com/comment/47912805
has comment: http://stackoverflow.com/comment/47914567

http://stackoverflow.com/comment/48272378
has text: @luisddm glad to hear it, KreepN's note (below) to use dot notation is worth giving heed to.
type: Comment
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/29971463

http://stackoverflow.com/comment/87640270
comment on: http://stackoverflow.com/a/45332959
score: 5
type: AnswerComment
has text: when i try using this with react `Component`, it doesn't work. just FYI to anyone else who might have wanted it for this purpose.
type: Comment

http://stackoverflow.com/comment/48076286
has text: Probably duplicate with this one: http://stackoverflow.com/questions/21414901/prevent-bootstrap-tooltip-from-hiding-on-click-over-it
score: 1
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29976845

http://stackoverflow.com/comment/48136079
type: QuestionComment
score: 0
has text: @StephenMuecke One more question. What if i will remove one row? for example i have got row 1 2 and 3. I remove row 2. So i have got 1 and 3 row left. However controls in these rows are named like Question[1].Title and Question[3].Title what leads me to retrive only First row in my model (3 is gone becouse there is no 2nd one, so how it could be 3rd:) ) . How to handle it?
comment on: http://stackoverflow.com/q/30001496
type: Comment

import
type: Tag
tag name: import
tags question: http://stackoverflow.com/q/29878824

http://stackoverflow.com/a/29848809
score: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/29848617
answers question: http://stackoverflow.com/q/29848617
type: AcceptedAnswer
has body: indexOf will check for two objects that occupy the same space in memory. I think what you want in this case is angular.equals(obj1, obj2) for the equality comparison.

http://stackoverflow.com/q/29914381
type: UnansweredQuestion
has title: Internationalization (i18n) / Localization for Node.js web application
tagged with: node.js
tagged with: internationalization
has comment: http://stackoverflow.com/comment/47950622
upvote count: 5
type: Question
score: 5
downvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/68142186
linked to: http://stackoverflow.com/q/11645740
tagged with: javascript
favorite count: 0
tagged with: web
has body: I have a web application build using Node.js. I wish to do internationalization and support english and Spanish language. Whenever the user selects the english link the static content of my 'index.ejs' page should be in english and when he selects Spanish it should change accordingly. How can I do that? What would be the simplest way to do that? Also, How can I improve Search Engine Optimization (SEO)?
has answer: http://stackoverflow.com/a/30232321
has comment: http://stackoverflow.com/comment/68234847

http://stackoverflow.com/q/29866413
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/29866984
type: Question
tagged with: angularjs-directive
has title: AngularJS directive conditionally based on controller variable
tagged with: javascript
has body: I want to display an error message about invalid login credentials whenever the user tries to logs in through non-matching username and password combination (through a request to the server, which returns the status for invalid login details in that case). I have created a directive for the same: app.directive('invalid', function ($compile) { return { scope: true, restrict: 'A', link: function link(scope, element) { element.bind('submit', function (){ var text = ' Invalid username or password '; el = $compile( text )( scope ); element.append(el); }); } } }); (notice the ng-if on the appended element) I have applied this directive to the form element in the following manner: Whenever the user credentials are invalid (checked through a request made to the server), the variable $scope.invalidCredentials is set to true (inside global controller). It's working fine except for the fact that the directive triggers each time that the form is submitted. [No matter what the value of $scope.invalidCredentials]. ng-if doesn't seem to work. Please help. Thanks in advance
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/29866984
accepted answer: http://stackoverflow.com/a/29866819
has comment: http://stackoverflow.com/comment/47857831
tagged with: angularjs
has answer: http://stackoverflow.com/a/29866819

http://stackoverflow.com/a/64908581
has comment: http://stackoverflow.com/comment/118432664
downvote count: 0
has body: You just need to add a CSS property overscroll-behavior: none to your body body { overscroll-behavior: none } More details are in this article
has comment: http://stackoverflow.com/comment/136557237
type: Answer
answers question: http://stackoverflow.com/q/29894997
upvote count: 2
score: 2
has comment: http://stackoverflow.com/comment/116141966

http://stackoverflow.com/comment/47986815
type: AnswerComment
has text: I don't think that's quite right, since the [doc](http://ionicframework.com/docs/api/directive/ionView/) for `ion-view` explicitly states that it has to be a child of `ion-nav-view`
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29932065

http://stackoverflow.com/comment/47853547
type: Comment
has text: You're right @MehranHatami, I forgot to mention I was using coffeescript.
score: 0
comment on: http://stackoverflow.com/q/29864014
type: QuestionComment

http://stackoverflow.com/comment/47949006
comment on: http://stackoverflow.com/q/29913183
score: 1
type: Comment
type: QuestionComment
has text: Here is a fiddle http://jsfiddle.net/hwgg2L0t/

http://stackoverflow.com/comment/47996894
comment on: http://stackoverflow.com/a/29936230
type: Comment
has text: @Relm yes... `var $this = $(this)` - is used to cache the reference
type: AnswerComment
score: 1

http://stackoverflow.com/comment/48087172
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29983479
has text: Sorry, I didn't told you to change the content of input box. try this: http://jsfiddle.net/k66Za/112

http://stackoverflow.com/a/29979781
has comment: http://stackoverflow.com/comment/48079250
upvote count: 1
has body: You can try $("#btn-assignment").click(function(){ $(".dropdown li").eq(0).trigger("click"); }); This will trigger 'click' onto the first LI element, which should reselect it I attached this event to the 'Assignment Performance' button http://jsfiddle.net/2v57wnys/1/
answers question: http://stackoverflow.com/q/29979629
downvote count: 0
has comment: http://stackoverflow.com/comment/48079752
score: 1
type: Answer

http://stackoverflow.com/a/29852333
upvote count: 1
answers question: http://stackoverflow.com/q/29851873
downvote count: 1
score: 0
has body: Marrying this answer with Drake's: function colorNumberToHex(colorNumber) { function toHex(n) { n = n.toString(16) + ''; return n.length &gt;= 2 ? n : new Array(2 - n.length + 1).join('0') + n; } var r = toHex(colorNumber % 256), g = toHex(Math.floor( colorNumber / 256 ) % 256), b = toHex(Math.floor( Math.floor(colorNumber / 256) / 256 ) % 256); return '#' + r + g + b; }
type: Answer

http://stackoverflow.com/comment/48141000
type: Comment
comment on: http://stackoverflow.com/a/30010428
score: 0
has text: It does not work for me with html5mode enabled. Also in the plunkr it is commented out. May you please bring an example with html5enabled on? I get sort of redirected twice. I printed console.log($location,$location.path(), $location.search());. The first time i get "/" Object {vid: "Auto1"} and then "/" Object {}
type: AnswerComment

http://stackoverflow.com/a/29960739
has comment: http://stackoverflow.com/comment/48047774
has body: I have been always using template system where I include all the needed files in one place and other blade.php files extend this template.
score: 0
type: Answer
answers question: http://stackoverflow.com/q/29960530
has comment: http://stackoverflow.com/comment/48050549

http://stackoverflow.com/a/29966029
score: 0
type: Answer
answers question: http://stackoverflow.com/q/29965886
has body: You can combine the input event with the innerHTML to grab the data: document.querySelector("p").addEventListener("input", function(e) { document.querySelector("input[type=hidden]").value = e.target.innerHTML; }); Working Example This will update the hidden input any time the user changes the content of the p either by keypress or copy/paste.

http://stackoverflow.com/comment/47966210
score: 0
has text: or only `.find(".slots .in")`
type: AnswerComment
comment on: http://stackoverflow.com/a/29922346
type: Comment

http://stackoverflow.com/a/29920198
score: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29919833
answers question: http://stackoverflow.com/q/29919833
type: Answer
has body: You will have to hash the markers upon their creation. There are a number of ways to do this but here's a simple one to get you started: var markers = {}; $.getJSON('marker_data.php').then(function(data) { data.forEach(function(record) { options = foo; //create the options object for the marker markers[record.id] = new google.maps.marker(foo); }); }); Alternatively you could store them in an array, but that could make it harder to retrieve a specific marker, I tend to cache them in an object by id. Once you have the hash/array, its easy enough to iterate: for (var id in markers) { if (id == activeID) { marker.setIcon('assets/images/website/marker-active.png'); } else if (id != 777) { marker.setIcon('assets/images/website/marker.png'); } } My example assumes you're using jQuery for AJAX and php on the backend, but adjust to suit your stack.

http://stackoverflow.com/q/29909868
type: Question
has comment: http://stackoverflow.com/comment/47942000
has comment: http://stackoverflow.com/comment/47983597
tagged with: javascript
has body: If you have an html file where you toggle a boolean on click, sometimes i'm able to do it directly in the view and sometimes I have to create a function in my controller to toggle the boolean. Why does this work sometimes but not all the time? Only works sometimes.. Toggle Always works.. Toggle ... $scope.updateVar = function() { $scope.myVar = !$scope.myVar; };
has answer: http://stackoverflow.com/a/29909933
downvote count: 0
answer count: 1
has title: Setting a $scope variable in view does not work unless I call a function to do it
favorite count: 0
has comment: http://stackoverflow.com/comment/53018749
tagged with: angularjs
has comment: http://stackoverflow.com/comment/47941977
type: UnansweredQuestion
score: 1
upvote count: 1

http://stackoverflow.com/comment/48116901
type: Comment
has text: Actually, in gulp when I merge them, i put angular.module('app', ['ngRoute']) since it will create it and as you mention the one without [] is getter. Var app = angular.module('app') is just mistake while i was taking some parts of code to put it here.
comment on: http://stackoverflow.com/a/29998716
type: AnswerComment
score: 0

http://stackoverflow.com/a/29938014
type: Answer
has comment: http://stackoverflow.com/comment/47998161
has body: You haven't send day value to directive like this:
has comment: http://stackoverflow.com/comment/47997780
has comment: http://stackoverflow.com/comment/47997585
accepted answer of: http://stackoverflow.com/q/29937919
answers question: http://stackoverflow.com/q/29937919
score: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47997890

http://stackoverflow.com/q/29906228
answer count: 2
has title: HTML 5 Local Storage - deleting after refresh
tagged with: jquery-mobile
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47936857
score: 0
has comment: http://stackoverflow.com/comment/47937062
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29906285
type: UnansweredQuestion
tagged with: local-storage
has body: I am a beginner to javascript, html5, and jquery and am trying to use locale storage for the first time in an app that I am designing. However, once I added the "getIncomeArray" function to my code, the local storage would get deleted after I refreshed... fiddle function getIncomeArray(){ //get or create storage arrays var incomeArray = localStorage.getItem["incomeArray"]; console.log(incomeArray); if (!incomeArray) { incomeArray = []; localStorage.setItem("incomeArray", JSON.stringify(incomeArray)); //code console.log("there is no array so I made one"); } else{ incomeArray = JSON.parse(incomeArray); console.log("there is an array and I parsed it"); } return incomeArray; }
has answer: http://stackoverflow.com/a/29906306
type: Question

http://stackoverflow.com/comment/48045267
comment on: http://stackoverflow.com/a/29962372
type: Comment
has text: Thanks for solution with $.each and clone(). I will use this one, because it suits me better.
type: AnswerComment
score: 0

http://stackoverflow.com/q/29926315
answer count: 0
tagged with: javascript
type: UnansweredQuestion
has body: I have a devexpress combobox control, on the 'valueChanged' event, I call some client-side code. Inside this code I have an alert() to which I'd like to pass a c# string. I've seen posts on SO that say use something like @Html.Raw(string) however, this doesn't seem to be working with this dev-express control. My alert just keeps spitting out anything as a string like: alert('@Html.Raw(someC#String)'); comes out as: @Html.Raw(someC#String) string text = "text message"; @Html.DevExpress().ComboBox( settings =&gt; { settings.Properties.ClientSideEvents.ValueChanged = "function(s,e) { alert('@text'); }"; the above snippet isn't displaying correctly by the way, everything inside the double quotes should show up like a string, on the settings.Properties.ClientSideEvents.ValueChanged line
downvote count: 0
has comment: http://stackoverflow.com/comment/47975108
score: 1
favorite count: 0
type: Question
tagged with: devexpress
tagged with: combobox
has comment: http://stackoverflow.com/comment/47974533
has comment: http://stackoverflow.com/comment/47974723
upvote count: 1
tagged with: c#
tagged with: asp.net-mvc
has comment: http://stackoverflow.com/comment/47974572
has title: devexpress clientside event pass string

http://stackoverflow.com/a/29890327
type: Answer
answers question: http://stackoverflow.com/q/29890156
has body: $("#listMails &gt; option").each(function() { alert(this.value); });
accepted answer of: http://stackoverflow.com/q/29890156
has comment: http://stackoverflow.com/comment/47904855
score: 0
type: AcceptedAnswer

http://stackoverflow.com/q/29901790
possible better answer: http://stackoverflow.com/a/29901877
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29901896
favorite count: 0
has comment: http://stackoverflow.com/comment/47928202
accepted answer: http://stackoverflow.com/a/29901917
answer count: 5
has answer: http://stackoverflow.com/a/29901981
has answer: http://stackoverflow.com/a/29902117
has comment: http://stackoverflow.com/comment/47930261
type: AnsweredQuestion
score: 2
upvote count: 3
has comment: http://stackoverflow.com/comment/47929477
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/47926239
has comment: http://stackoverflow.com/comment/47926246
has answer: http://stackoverflow.com/a/29901877
has answer: http://stackoverflow.com/a/29901917
tagged with: javascript
has body: I tried using the "input" event on the text box but it doesn't work. I've read a few posts on Stack Overflow but none of them worked. Here's my most recent HTML and Javascript code using onchange: function updateResults(){ document.write("Wroks"); } &lt;input id="search-box" onchange="updateResults();"&gt; &lt;/input&gt; I tried changing HTML to onchange="updateResults;" but didn't work. I also tried changing HTML to onchange="updateResults(event);" and then Javascript to function updateResults(event){...} Nothing that I tried worked.
has title: How do I check when an input is changed?
has comment: http://stackoverflow.com/comment/47926192

http://stackoverflow.com/q/29929071
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
upvote count: 8
has comment: http://stackoverflow.com/comment/48107971
tagged with: node.js
score: 8
tagged with: electron
has comment: http://stackoverflow.com/comment/48002531
has comment: http://stackoverflow.com/comment/47980660
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47980508
has title: Frameless Browser window zero height
has comment: http://stackoverflow.com/comment/48107647
type: Question
has body: I'm creating a new frameless Browser window in Electron, with its height and width set at 0 but, at least in windows, the window is shown with some width and height. Also i have not loaded any content inside. var mainWindow = new BrowserWindow({ width: 0, height: 0, resizable: false, frame: false, center: true, show: true, 'use-content-size': false, 'always-on-top': true }); Is it possible to have a frameless window with 0 height/width?
has comment: http://stackoverflow.com/comment/48015063
has answer: http://stackoverflow.com/a/31394445

http://stackoverflow.com/comment/48000646
score: 0
type: QuestionComment
type: Comment
has text: Maybe those two links will help. Generators are a feature in Node >0.11 and IO.js. So maybe you read up on those. With this approach you'll avoid loads of callbacks or using the async library. Generators are exquisit when it comes to recursiveness IMHO at 2ality: http://www.2ality.com/2015/03/no-promises.html at strongloop: https://strongloop.com/strongblog/node-js-callback-hell-promises-generators/
comment on: http://stackoverflow.com/q/29939567

http://stackoverflow.com/q/29886352
has comment: http://stackoverflow.com/comment/47941106
tagged with: dojo
accepted answer: http://stackoverflow.com/a/29913619
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47902757
type: Question
has answer: http://stackoverflow.com/a/29913619
answer count: 1
tagged with: javascript
has title: Getting Dojo widgets like dojox.layout.ContentPane working for Android apps developed using Cordova with NetBeans
score: 0
tagged with: android
has comment: http://stackoverflow.com/comment/47903048
has body: I'm trying to get widgets like dojox.layout.ContentPane working properly in a Netbeans Cordova environment for Android and iOS. I'm using as the main contentPane that will render the pages based on what the user press. Is it possible to get it working or are there better alternatives in Dojo for this purpose? &lt;script type="text/javascript"&gt; require([ "dojox/layout/ContentPane", "dijit/registry", "dojo/domReady!" ], function( ContentPane, registry ) { var contentPanel = new ContentPane({ ioMethod: dojo.xhrPost, executeScripts:"true", style: "height: 100%", region:"center" },"contentPanel"); contentPanel.setHref("home.html"); }); &lt;div id="contentPanel" padding-bottom:10px"&gt; &lt;/div&gt; This is the error line that appears in firebug console var error = new RequestError('Unable to load ' + response.url + ' status: ' + _xhr.status, response); Update1: Am suspecting that this is related to Android SDK issue that many others are facing which is caused by _ characters in many of the Dojo files (Google Issue link). Dojo Build was suggested. But I have not manage to "build everything into 1 file" that has been suggested to work The Dojo Build profile I tried: var profile = (function(){ return { basePath: "./../../../../../web/html/js/",//file path start from Util\dojoSDK\util\buildscripts\profiles releaseDir: "./../../../Util/release", action: "release", layerOptimize: "closure", optimize: "shrinksafe", cssOptimize: "false", mini: false, stripConsole: "normal", selectorEngine: "acme", packages:[/**/{ name: "dojo", location: "../../../Util/dojoSDK/dojo" },{ name: "dojox", location: "../../../Util/dojoSDK/dojox" },{ name: "dijit", location: "../../../Util/dojoSDK/dijit" }], layers: { "dojo/dojo": { include: [ "dojo/dojo", "dojo/i18n", "dojo/domReady", "dojo/parser" *all .js files in Dojo with _* ], customBase: true, boot: true } } }; })(); FINAL UPDATE: Apparently this is NOT caused by the underscore issue highlighted in Update1 above. I have reused the complete ex…
tagged with: netbeans
tagged with: cordova

http://stackoverflow.com/comment/47898440
score: 0
type: AnswerComment
type: Comment
has text: It doesn't allow a right-click *on the DOM* - browser right clicks are a different story
comment on: http://stackoverflow.com/a/29887186

http://stackoverflow.com/comment/56360678
type: Comment
has text: Is it possibile to use GroundPrimitives also for paths? This is my code: var target = viewer.entities.add({ position: sample, path: { resolution: 60, material:Cesium.Color.BLUE, width: 4, trailTime: 360, leadTime: 0 } }); where sampe is a Cesium.SampledPositionProperty, so the path is extending over time. How can I drape the path over terrain?
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/32363054

http://stackoverflow.com/comment/47958286
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29917591
has text: **@Yashika Garg**, thank you i can log my controller now. But i'm still confused about how using -- require -- in a directive.
type: Comment

http://stackoverflow.com/comment/48109941
has text: hmm.. can you try putting an alert after u set the attribute?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29994908

http://stackoverflow.com/comment/48104455
has text: While this code may solve the problem, a few words of explanation would go a long way to training current and future readers of this answer.
type: Comment
comment on: http://stackoverflow.com/a/29992388
score: 0
type: AnswerComment

adaptive-design
type: Tag
tags question: http://stackoverflow.com/q/29974533
tag name: adaptive-design

http://stackoverflow.com/comment/48013117
comment on: http://stackoverflow.com/a/29946091
score: 0
type: Comment
has text: The `wp-one` and `wp-two`classes are variable, can be other different classes, so I can't just use them as selectors.
type: AnswerComment

http://stackoverflow.com/q/29948929
answer count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/29949183
accepted answer: http://stackoverflow.com/a/29949183
tagged with: timezone
linked to: http://stackoverflow.com/q/2587345
type: AnsweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/48018812
has comment: http://stackoverflow.com/comment/48018750
tagged with: date
has comment: http://stackoverflow.com/comment/48021432
type: Question
has title: BST date string to javascript date
downvote count: 0
tagged with: javascript
linked to: http://stackoverflow.com/q/19797608
has body: How can I convert the BST date string to Javascript date object? The follwing code gives me error for BST but works for other timezone var data='Tue Apr 28 16:15:22 BST 2015'; var date = new Date(data); console.log(date) Output Invalid Date var data='Tue Apr 28 16:15:22 BST 2015'; var date = new Date(data); console.log(date) var data2='Fri Mar 27 11:53:50 GMT 2015' var date2 = new Date(data2); console.log(date2)
upvote count: 1

http://stackoverflow.com/q/29909004
has comment: http://stackoverflow.com/comment/47940767
has answer: http://stackoverflow.com/a/29909302
has comment: http://stackoverflow.com/comment/47946195
tagged with: event-delegation
has comment: http://stackoverflow.com/comment/47940574
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47946312
has comment: http://stackoverflow.com/comment/47940636
has comment: http://stackoverflow.com/comment/47940597
has comment: http://stackoverflow.com/comment/47941092
has title: jQuery - Event delegation is occuring multiple times
has answer: http://stackoverflow.com/a/29909107
has body: I'm using event delegation in the pagination for my website. When you click the &lt; or &gt; buttons it moves the page up or down. The problem is that if you don't release the mouse button, in a split-second it will keep repeating the click handler. How can I make it so that this event only occurs once per-click? Here's my code: $(document).on('mousedown', '#prev', function(event) { // Page is the value of the URL parameter 'page' if (page != 1) { page--; var state = { "thisIsOnPopState": true }; history.replaceState(state, "a", "?page=" + page + ""); } // Refresh is a custom function that loads new items on the page refresh(); });
type: Question
tagged with: javascript
tagged with: jquery
score: 0
tagged with: jquery-events
answer count: 3
has comment: http://stackoverflow.com/comment/47940785
has answer: http://stackoverflow.com/a/29909137

http://stackoverflow.com/comment/48299709
type: Comment
type: QuestionComment
has text: If you program your server to allow for that…
comment on: http://stackoverflow.com/q/29957932
score: 0

http://stackoverflow.com/comment/48157861
comment on: http://stackoverflow.com/a/29887014
type: AnswerComment
score: 0
has text: Sorry for the late reply. About how to improve the understanding of the webside, I don't really know but I think you overestimate the knowledge of the user. I really new in pouchdb and I spend a lot of time making researching after reading something on your website. Also the samples are made for really specific case, when I want to do something a little different I am completely lost. And it's maybe an impression but I think that all the lexicon is not describe.
type: Comment

http://stackoverflow.com/comment/70362690
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29888536
has text: Mods, this is NOT a duplicate of the linked question, as there is not a Javascript-related answer in the linked question. The other OP asked for a solution in either language and got ONLY php (server-side) answers. Take the flag off this question.

http://stackoverflow.com/q/29929430
downvote count: 0
score: 1
type: Question
tagged with: javascript
tagged with: touch
has body: I have a webapp project I am working with a graphical chart that I want to respond to the touchstart and the touchmove events. I have the events bound to an element that is overlaying the chart canvas element and for the most part everything is working as expected. I am however, experiencing some behavior where the events eventually stop triggering. I am seeing this happen in at least two ways: First case: It all appears to be a somewhat sporadic stopping (I can't narrow down exactly what it is that is going on right before they stop). Everything will work fine for a while but then eventually touch events just stop triggering. Second case: When I update the app (which removes the bound element, reappends a new element to DOM, and then re-binds the new element with the same events). After this update I get exactly one single touchstar/touchmove to trigger. After that single firing no further touch events to trigger. Here is the website I am working on: mortgagevista.com I can't for the life of me figure out what is going on. I have spent hours reading up on forums and SO and still can't seem to figure out what the issue is. Unfortunately I am even out of ideas on how to troubleshoot the problem. I have been using the emulator in the chrome dev tools reproduce the problem. Does this issue sound familiar to anybody? Any common issues or pitfalls with the touch events that I might be missing? Any ideas on how to best go about troubleshooting this? (Sorry, I know this is a really vague question but I am out of ideas on even how to narrow down what is happening).
upvote count: 1
answer count: 1
tagged with: jquery
favorite count: 0
has title: JS touchmove events that stop triggering.
type: UnansweredQuestion
tagged with: events
has answer: http://stackoverflow.com/a/29940867

http://stackoverflow.com/q/29977093
tagged with: responsivevoice
downvote count: 0
type: UnansweredQuestion
tagged with: text-to-speech
has comment: http://stackoverflow.com/comment/48073870
type: Question
score: 3
linked to: http://stackoverflow.com/q/22560413
has body: I'm using responsivevoice.js JavaScript library to listen to articles online. It's the best free Text-to-speech I found, better then lots of paid ones I tried, but I need to download the audio as well and I have no idea on how to do that. Any ideas on how could I do that ? Or is there any other good Text-to-speech, with unlimited characters and download capabilities ? I made a quick demo to better illustrate the situation.
answer count: 1
tagged with: javascript
upvote count: 3
has answer: http://stackoverflow.com/a/32228319
has comment: http://stackoverflow.com/comment/48074147
favorite count: 0
has title: How to download speech (audio) created from text using Text-to-speech responsivevoice.js?

http://stackoverflow.com/q/29997605
tagged with: d3.js
type: UnansweredQuestion
has body: I am trying to project a d3 map of the US. For some reason, it looks like this: I used mapshaper.org to create a topojson. I took a look at this link: d3 toposjon map troubleshooting … why does it look like all zig zags and shards? but it wasn't very helpful. Here is my code: D3 Test Could you help me out? Thanks!
has title: Why does my d3 map look strange?
tagged with: topojson
has comment: http://stackoverflow.com/comment/48132081
has comment: http://stackoverflow.com/comment/48115519
answer count: 0
has comment: http://stackoverflow.com/comment/48136965
score: 1
upvote count: 1
tagged with: geojson
type: Question
has comment: http://stackoverflow.com/comment/48116648
tagged with: javascript
linked to: http://stackoverflow.com/q/26132342
has comment: http://stackoverflow.com/comment/48115258
downvote count: 0
favorite count: 0

http://stackoverflow.com/q/29909473
favorite count: 0
has title: How to get a clear concept of React key property?
has answer: http://stackoverflow.com/a/29909610
score: 2
has body: I've been using ReactJS recently but when it comes to "key" property I really don't know how it works. Say in parent component I do render like : render: function() { // dataList = [{id: 1}, {id: 2}, {id: 3}]; =&gt; initial state // dataList = [{id: 2}, {id: 3}, {id: 4}]; =&gt; second dataList state var someComponentList = []; this.state.dataList.forEach(function(data) { someComponentList.push( &lt;SomeComponent key={data.id} id={data.id}/&gt; ) }) return ( &lt;div&gt; {someComponentList} &lt;/div&gt; ) } In SomeComponent : var SomeComponent = React.createClass({ render : function({ // Render work here }), componentWillReceiveProps: function(nextProps) { console.log(this.props.id == nextProps.id); } }) So in componentWillReceiveProps I expect 3 false console result (which I do if I didn't give key attribute to &lt;SomeComponent&gt;) after setState() but actually I have only 1 false because ReactJs seems to know that {id: 2} &amp; {id: 3} are identical even they're given in different order in dataList state I found some brief documentation on Reactjs official : When React reconciles the keyed children, it will ensure that any child with key will be reordered (instead of clobbered) or destroyed (instead of reused). can somebody explain how it works?
upvote count: 2
type: UnansweredQuestion
type: Question
tagged with: javascript
tagged with: reactjs
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/47941343

http://stackoverflow.com/comment/48022121
has text: it is the same time. Z is zulu - which means zero hours offset from UTC/GMT where the GMT+0100 is 1 hour added to the GMT time.
type: Comment
type: QuestionComment
score: 3
comment on: http://stackoverflow.com/q/29950598

http://stackoverflow.com/comment/48038965
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29959091
has text: Use `.on()` to attach event handler, like `iframe.on( "click", "a.offsite", function() { alert( "Clicked..." ); });` See the reference: http://api.jquery.com/live/#event-delegation
score: 0

http://stackoverflow.com/a/29900282
accepted answer of: http://stackoverflow.com/q/29896134
answers question: http://stackoverflow.com/q/29896134
has comment: http://stackoverflow.com/comment/48177862
has comment: http://stackoverflow.com/comment/47929259
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/48174598
has comment: http://stackoverflow.com/comment/48175815
has comment: http://stackoverflow.com/comment/48177925
has body: You will need a websocket parser. I don't think you'd expect a lot of code here, so I'll put a link to a websocket parser that I wrote for my Web Framework simpleS. You can try to use it for some learning purposes, but I'd suggest to use a ready framework like that I mentioned. The websocket parser is located here: https://github.com/micnic/simpleS/blob/master/lib/parsers/ws.js Quick start: wsParser(limit, client) limit - limit in bytes of the received frame / message (zero for infinity, I use 0 for data received from the server) client - boolean to specify if the parser is used on the client-side or the server-side The parser may be used as a regular writable stream: var parser = new wsParser(0, false); socket.pipe(parser); parse.on('error', function (error) { // handle the error }.on('frame', function (frame) { // handle the frame /* The structure of a frame: { data: buffer, fin: boolean, length: int, masked: boolean, opcode: int } */ }); UPDATE Simplified parsing process explained: var buffer = new Buffer(0); // intermediate container for data var frame = null; // frame object var limit = 0; // limit in bytes for data, may be any needed value var message = new Buffer(0); // message data container var state = 0; // flag for the current parser state var index = 0; // read index inside the buffer data socket.on('readable', function () { var data = this.read() || new Buffer(0); // get the new received data buffer = Buffer.concat([buffer, data]); // concat the received data if (state === 0) { // waiting for a new frame frame = { // create the frame object data: new Buffer(0), fin: (buffer[index] &amp; 128) === 128, length: buffer[index + 1] &amp; 127, masked: (buffer[index + 1] &amp; 128) === 128, opcode: buffer[index] &amp; 15 }; // validate the frame based on the websocket protocol limitations // set the next step flag based on the frame properties if (frame.length &gt; 125) { state = 1; } else { state = 2; } index += 2; // skip frame header bytes } if (state === 1)…
type: Answer
has comment: http://stackoverflow.com/comment/47950322
score: 0
has comment: http://stackoverflow.com/comment/48178673
has comment: http://stackoverflow.com/comment/48175215
has comment: http://stackoverflow.com/comment/48175366

http://stackoverflow.com/a/29862182
accepted answer of: http://stackoverflow.com/q/29854755
type: Answer
answers question: http://stackoverflow.com/q/29854755
upvote count: 1
has body: try to replace your code: var myLatlng = new google.maps.LatLng(-33.7332739, 73.0911567); with this: var myLatlng = new google.maps.LatLng(33.732889, 73.091667); this demo: link function initialize() { var myLatlng = new google.maps.LatLng(33.732889, 73.091667); var mapOptions = { zoom: 20, center: myLatlng } var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions); var marker = new google.maps.Marker({ position: myLatlng, map: map, title: 'Hello World!' }); } google.maps.event.addDomListener(window, 'load', initialize);
score: 1
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/29994984
type: Question
accepted answer: http://stackoverflow.com/a/29995071
tagged with: jqgrid
tagged with: javascript
tagged with: jquery
tagged with: free-jqgrid
score: 0
answer count: 1
has title: How to fix Cannot read property 'cellIndex' of undefined dragging from one jqgrid column to other in free jqgrid
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29995071
has body: Free jqgrid has beforeSelectRow event handler defined as beforeSelectRow: function (rowid, e) { var colName = $.jgrid.getCellIndex($(e.target).closest('td')[0]), .... If mouse button is hold down in one jqgrid column, mouse cursor is moved to other column in same row and mouse button is released, exception Cannot read property 'cellIndex' of undefined Line 566 occurs at line 808 colName = $.jgrid.getCellIndex($(e.target).closest('td')[0]), with stack trace below (line numbers from todays jquery.jqgrid.src.js ) If mouse cursor is moved to other row holding button down, this exception does not occur. How to fix or diagnose this ? It looks like $(e.target).closest('td')[0] is undefined on dragging between columns in same row. Uncaught TypeError: Cannot read property 'cellIndex' of undefined Line 566 Column 12TypeError: Cannot read property 'cellIndex' of undefined at Object.$.extend.getCellIndex (http://localhost:52216/admin/Scripts/jqgrid-4.8.0/js/jquery.jqgrid.src.js:566:12) at HTMLTableElement.$grid.jqGrid.beforeSelectRow (http://localhost:52216/admin/Grid/Index/DoklstlG?_user=admin&amp;_company=1:808:38) at HTMLTableElement.$.extend.fullBoolFeedback (http://localhost:52216/admin/Scripts/jqgrid-4.8.0/js/jquery.jqgrid.src.js:1508:35) at HTMLTableElement.$.extend.feedback (http://localhost:52216/admin/Scripts/jqgrid-4.8.0/js/jquery.jqgrid.src.js:1533:34) at HTMLTableElement.feedback (http://localhost:52216/admin/Scripts/jqgrid-4.8.0/js/jquery.jqgrid.src.js:1618:26) at HTMLTableElement.&lt;anonymous&gt; (http://localhost:52216/admin/Scripts/jqgrid-4.8.0/js/jquery.jqgrid.src.js:4283:55) at HTMLTableElement.jQuery.event.dispatch (http://localhost:52216/admin/Scripts/jquery-1.11.2.js:4665:9) at HTMLTableElement.elemData.handle (http://localhost:52216/admin/Scripts/jquery-1.11.2.js:4333:46) Update After adding lines in question razor parser throws syntax error. I tried to this it using but error still occurs. I fixed this by using beforeSelectRow: function (rowid, e) { var…

http://stackoverflow.com/comment/47990017
has text: Hi thanks for the reply, any other possibilities to achieve similar results ?
score: 0
comment on: http://stackoverflow.com/q/29926229
type: Comment
type: QuestionComment

p5.js
tags question: http://stackoverflow.com/q/29869910
type: Tag
tag name: p5.js

http://stackoverflow.com/a/29885463
has body: This isn't quite so simple. The __proto__ property is a dynamic link to the .constructor's prototype. However, .constructor isn't overwritten in these cases (though it can be in certain hand-made libraries). When you're looking for a reference to Foo to show up in that chain, it's a very "classical" viewpoint, and less to do with prototypal inheritance, which inherits from a concrete instance, rather than a class, and in the case of JS, references (when not scalar), rather than copies. The tl;dr reason is simply: Object.create's constructor is Object, {}'s constructor is Object and Object.prototype's constructor is Object. The Long Way First thing to know: names in these lookups aren't tied to variables, but rather they're tied to functions, typically. Once upon a time, the field where this information could be found was hidden, and now it's found it's way to the .name property of a function (function Foo () { } Foo.name; //Foo) in many browsers now (much like __proto__ used to be invisible. Second bit: names which you see in console references, and in type-checks, aren't based on the proto, but on a property called .constructor. // Equivalent assignments var obj1 = { }; var obj2 = new Object(); var obj3 = Object.create(Object.prototype); obj1.constructor; // Object obj2.constructor; // Object obj3.constructor; // Object If we were to change the dynamic a little, and introduce the more "classical" approach to instance-creation, which is paseé, but will see a resurgence in ES6 with the class sugar... function Foo () { this.isFoo = true; } var foo = new Foo(); foo.isFoo; // true foo.constructor; // Foo foo.__proto__ === Foo.prototype; // true foo.__proto__.constructor; // Object That last little bit there is telling, for your immediate question; Foo.prototype is nothing but a plain ol' Object instance. In the days of JS where everybody was looking for the best possible way of making JS feel like Java / C#, you'd see something like: function Foo () { } function Bar() {…
downvote count: 0
score: 2
has comment: http://stackoverflow.com/comment/47896403
upvote count: 2
answers question: http://stackoverflow.com/q/29885351
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29885351
type: Answer